Note that there are some explanatory texts on larger screens.

plurals
  1. POVideoJS player doesn't play on iPad with AngularJS
    primarykey
    data
    text
    <p>We recently switched from a straight PHP(Laravel) app to an AngularJS app. I used VideoJS in both instances on an MP4 file.</p> <p>The PHP version worked and now the AngularJS version doesn't. HTML5 gives me an Error Code 4 MEDIA_ERR_SRC_NOT_SUPPORTED.</p> <p>This is not an encoding issue because I can play the file directly in Chrome and Safari on an iPad and it worked before when based on PHP. </p> <p>I believe it's because javascript dynamically loads the video after it's been loaded via the directive.</p> <p>This works fine in desktop, iPad/iPhone is only one with this problem.</p> <p>How do I get this thing to play?</p> <p>HTML</p> <pre><code>&lt;video ui-if='upload.filename' class="video-js vjs-default-skin" ng-src='{{ main.videoUrl }}{{ upload.filename }}' height='400' width='100%' poster='/image/resize/{{ upload.image }}/400/400' videojs controls&gt;&lt;/video&gt; </code></pre> <p>VideoJS Directive</p> <pre><code>directives.directive('videojs', [function () { return { restrict: 'A', link: function (scope, element, attrs) { attrs.type = attrs.type || "video/mp4"; attrs.id = attrs.id || "videojs" + Math.floor(Math.random() * 100); attrs.setup = attrs.setup || {}; var setup = { 'techOrder': ['html5', 'flash'], 'controls': true, 'preload': 'auto', 'autoplay': false, 'height': 400, 'width': "100%", 'poster': '', }; setup = angular.extend(setup, attrs.setup); l(setup) element.attr('id', attrs.id); var player = videojs(attrs.id, setup, function() { this.src({ type: attrs.type, src: attrs.src }); }); } }; }]); </code></pre> <h2>Update 1</h2> <p>Videogular is an excellent solution <a href="https://github.com/2fdevs/videogular" rel="nofollow">https://github.com/2fdevs/videogular</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload