When building an Ionic/AngularJS app with the Appery.io App Builder you can add an
HTML component to play back video files.
In this tutorial, you will learn how to do this.
To start, you need to create a new Ionic app.
- Drag an
HTMLcomponent to the page and click Edit to modify the code.
- Add the following to the tag editor:
1<video controls="controls" width="640" height="340" name="Video Name" ></video>
- Save it and switch to the
- For the
init()function, pass the following:
- Now, create a new function and name it
makeActionand add the next code, replacing
urlToVideowith the URL of the video you need to play:
12345var vidURL = "urlToVideo";var myVideo = document.getElementsByTagName('video');myVideo.src = vidURL;myVideo.load();myVideo.play();
Below is the example of playing back the video with
Note that some HTML video may be unavailable for playback.