Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 71531

Controlling Video and events

$
0
0

@loki9182 wrote:

Does anyone have recommendations on good practices for playing video in an Ionic app? I'm using the latest version of Ionic and I'll be loading multiple videos from an external server but I'm having problems with a few things:

Setting the src of the video dynamically, I've tried both options:

  <video #myVideo id="myVideo" width="100%" autoplay="true" controls>
    <source [src]="videoURL" type="video/mp4"/>
  </video>

or the alternative

  <video #myVideo id="myVideo" width="100%" autoplay="true" controls>
    <source src="{{videoURL}}"/>
  </video>

In both cases, the video does not start. I need this to work for Android and iOS. I also need to be able to play/pause the videos from JS functions, not just auto-play them. I'll also be loading the videos in an *ngFor loop so I need to be able to connect to each separately.

Any recommendations?

Cordova CLI: 6.3.1
Ionic Framework Version: 3.2.1
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.3.7
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 10
Node Version: v6.10.3
Xcode version: Not installed

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 71531

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>