How to Use the HTML Video Tag to Play Videos in an Ionic/AngularJS App

Posted: May 23rd, 2016Author:

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.

  1. Drag an HTML component to the page and click Edit to modify the code.
  2. Add the following to the tag editor:

    EditHTML

    Edited HTML tag

  3. Save it and switch to the SCOPE tab.
  4. For the init() function, pass the following:
  5. Now, create a new function and name it makeAction and add the next code, replacing urlToVideo with the URL of the video you need to play:

Below is the example of playing back the video with URL = http://clips.vorwaerts-gmbh.de/VfE_html5.mp4:

Sample video playback with embedded player

Note that some HTML video may be unavailable for playback.