video.js icon indicating copy to clipboard operation
video.js copied to clipboard

iPad iOS 9.1 failed play back with VideoJS v5.2.1

Open MikeLeVasseur opened this issue 11 years ago • 13 comments

With VideoJS version 5.2.1 - 5.7.1:

I'm not getting any video play back on the iPad (Gen 3 iPad and Gen1 iPad Mini) with iOS 9.1 - 9.2.1. When clicking on the video, the icon just spins.

However, the video plays back fine on my iPhone 5 with iOS 9.1 - 9.2.1.

All of the PC desktop browsers such as Chrome, IE, Edge, Firefox work great. Android phone testing was successful as well.

Find it strange that the iPhone works great while the iPad does not. Figured both would fail since they are both using iOS 9.1.

MikeLeVasseur avatar Nov 23 '15 18:11 MikeLeVasseur

At this point, we're very simple in how we are embedding with VideoJS

                    <video id="example_video_1" class="video-js vjs-default-skin vjs-big-play-centered" 
                           controls preload="auto" width="640" height="360"

                           data-setup="{'controls': true, 'autoplay': false, 'preload': 'auto', 'techOrder': ['html5','flash']}">

                        <source src="/~/media/extranet/test-video/web referral 11.mp4" type="video/mp4" />
                        <p class="vjs-no-js">
                            To view this video please enable JavaScript.
                        </p>
                    </video>   

MikeLeVasseur avatar Nov 23 '15 18:11 MikeLeVasseur

I am getting this same exact behavior after upgrading from 4.12 to 5.2.4 (via CDN). Had a user just report this issue.

iOS on iPhone uses the native iOS 9.1 video viewer (opens full screen whenever clicking on the video). On iPad iOS 9.1, it instead tries to play the video in a videojs player (like it does on Android and Desktop browsers) but gets a loading spinner indefinitely.

nightsurge avatar Nov 30 '15 16:11 nightsurge

Check your console. Did you get a "TypeError: Unable to delete property."? https://github.com/videojs/video.js/issues/2825

doublex avatar Dec 05 '15 16:12 doublex

I just updated the website to use VideoJS 5.7.1 and tried on IOS 9.2.1 on the iPad and it's still failing. I'll try checking the console out like you suggested and see if there are any errors.

MikeLeVasseur avatar Feb 26 '16 16:02 MikeLeVasseur

I just created a very simple html test page and used VideoJS in it with one of my videos.

In this test VideoJS 5.7.1 and IOS 9.2.1 on the iPad worked great. Happy to see that work as that rules out the iPad and VideoJS. Now I just need to figure out what I'm doing that's so special.

MikeLeVasseur avatar Feb 26 '16 17:02 MikeLeVasseur

@MikeLeVasseur For me it was Modernizr. Had the same problem. Only a spinner when play was clicked. Tomorrow I will find out which of the tests in Modernizr is the problem itself.

albi avatar Mar 15 '16 16:03 albi

@MikeLeVasseur had run some tests. It is not Modernizr. I've added the script from this site http://docs.videojs.com/docs/guides/api.html to wait until the player is loaded. I use this for appending some HTML to the player. If I remove this script everything is working on my iPad (iOS 9.2.1 with latest videojs). Even if I just call the script and do not append HTML, the player is broken. My reduced testcase to be found here http://alexanderalbrecht.de/test/ (look at the code with the script at the bottom).

albi avatar Mar 16 '16 08:03 albi

@albi I haven't had a chance to circle back on this issue on my end. I can say that were not using Modernizr on our website.

MikeLeVasseur avatar Mar 16 '16 13:03 MikeLeVasseur

@MikeLeVasseur Yep, it seems to be another issue -› https://github.com/videojs/video.js/issues/3184

albi avatar Mar 16 '16 13:03 albi

I was able to get it fixed on my site by omitting the data-setup="{}" from the video tag and then manually calling the videojs("myVideoId") after including the video.js js files.

jemoreno avatar Mar 16 '16 13:03 jemoreno

This is interesting @jemoreno . I removed what you suggested and in my case it was:

data-setup="{'controls': true, 'autoplay': false, 'preload': 'auto', 'techOrder': ['html5','flash']}"

and added this:

videojs("my-video").ready(function () {
    var myPlayer = this;
    //myPlayer.play();
});

Now it works on the iPad.

MikeLeVasseur avatar Mar 16 '16 13:03 MikeLeVasseur

@MikeLeVasseur Single quotes like you have in your data setup are invalid JSON, so that might be at least part of the issue.

This would be valid: data-setup='{"controls": true, "autoplay": false, "preload": "auto", "techOrder": ["html5","flash"]}'

mmcc avatar Mar 16 '16 18:03 mmcc

Thanks @jemoreno . I had the same problem and I applied the exact fix you recommended, and it fixed the problem immediately.

fechever avatar Jun 03 '16 03:06 fechever