Video.js: Native HLS broken on android chrome 78

Created on 26 Oct 2019  ·  18Comments  ·  Source: videojs/video.js

Description

On android with the lastest chrome (78) hls stream freezes. Strangly if there is any event on the page (eg: scrolling, css animation), the video plays properly during the animation. Audio plays without an issue. Was working with chrome 76. Example: https://videojs.com/advanced/#sintel

Steps to reproduce

Explain in detail the exact steps necessary to reproduce the issue.

  1. open chrome 78 on android
  2. open https://videojs.com/advanced/#sintel

Results

Expected

Stream plays properly.

Actual

Stream has huge lags or freezes completely. When scrolling down the stream plays properly, but only during scrolling.

Error output

No errors.

Additional Information

Please include any additional information necessary here. Including the following:

versions

videojs

what version of videojs does this occur with?
we use 7.6.0, not sure what version the linked example runs

browsers

what browser are affected?
mobile chrome 78

OSes

android

plugins

not sure

Most helpful comment

That's horrible. If you use the overrideNative option to play HLS with MSE rather than Android's native support. it plays normally: https://output.jsbin.com/haluqezehu

{
  html5: {
    hls: {
      overrideNative: !videojs.browser.IS_SAFARI
    }
  }
}

It's about time that was a default option but I think we've been waiting on a major version bump to change that.

All 18 comments

👋 Thanks for opening your first issue here! 👋

If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.
To help make it easier for us to investigate your issue, please follow the contributing guidelines.

Also tested successfully on Chrome 77 but seeing this issue on Chrome 78. Oddly if I scroll up and down and keep the video in frame, the video plays normally.

That's horrible. If you use the overrideNative option to play HLS with MSE rather than Android's native support. it plays normally: https://output.jsbin.com/haluqezehu

{
  html5: {
    hls: {
      overrideNative: !videojs.browser.IS_SAFARI
    }
  }
}

It's about time that was a default option but I think we've been waiting on a major version bump to change that.

Can confirm. Setting overrideNative: true for android devices, will get rid of freeze/lag.

Can confirm I'm having the same issues. Does overrideNative work within the data-setup tag? I tried, but it didn't fix the problem for me.

It does but the catch is that if you're supplying the source in a src attribute or <source> element and the browser has already loaded the source, it's used as-is so won't be reloaded with MSE. Use a <video-js> element instead of <video> tho avoid that.

Thank you, didn't know about the video-js yet.

I tried to change it, but no result yet in Chrome Android. Am I doing something wrong? This is my tag now:

<video-js id="Webcam" class="vjs-16-9 vjs-default-skin vjs-big-play-centered" controls preload="none" poster="poster.jpg" data-setup='{"overrideNative":true,"controlBar":{"liveDisplay":true,"volumePanel":false,"currentTimeDisplay":false,"timeDivider":false,"durationDisplay":false,"remainingTimeDisplay":false,"progressControl":false, "audioTrackButton":false, "captionButton":false, "subtitlesButton":false, "descriptionsButton":false}}'><source src="stream.m3u8" type='application/x-mpegurl' /></video-js>

overrideNative shouldn't be a top level option.

data-setup='{"html5": {"hls": {"overrideNative":true}}, "controlBar": …
// Create video.js player
this.player = videojs( 'player', {
  html5: {
    hls: {
      overrideNative: !videojs.browser.IS_SAFARI,
    },
  },
});

worked as well (though I'm not sure why the safari option is needed, or if it is needed).

I can confirm the problem and also the solution. Just want to add that it is not just only Chrome problem, but also Firefox showing the same behavior. Other browsers seems to work fine.

Cant reproduce now. On Chrome 78.0.3904.96, Android 9

In chrome version 78 (mobile ) , when I used data-setup='{}' then this gives issue otherwise it worked well.

I can still reproduce the issue, worked on this problem from time to time the last two month but need your help to go deeper. All my LiVE stream problems started when I switched from HTTP to HTTPS LiVE stream.
See below fault findings so far and give me your thoughts since I am not sure if this is only Android/Chrome related and/or VideoJS in a mix. Plyr.js and hls.js works well as default.

HLS (.m3u8) LiVE stream test no VOD.
VideoJS v7.6.x

Android devices:
Samsung Tab 4 (Android v5.0.2) (Chrome v78.0.3904.108)
Sony Xperia Z3 (Android v6.0.1) (Chrome v78.0.3904.96)
Huawei honor 8 (Android v7.0) (Chrome v78.0.3904.96)
Samsung Galaxy A8 (Android v9.0) (Chrome v78.0.3904.108)

Ipad device:
iOS 13.1.2 (Chrome v78.0.3904.84)

PC device:
Windows 10 Pro v1903 (Chrome v78.0.3904.108)

Summary of fault finding tests
HTTPS stream link
Windows 10 Pro web browser Chrome and Edge = Works good.
Macbook Pro web browser Safari = Works good.
Ipad web browser Safari = Works good.
Ipad web browser Chrome = Works good.
Samsung Tab 4 Android = Stream freeze repeatedly.
Sony Xperia Z3 = Works good.
Huawei honor 8 = Works good.
Samsung Galaxy A8 = Stream freeze repeatedly.

HTTPS stream link + overrideNative: !videojs.browser.IS_SAFARI
Samsung Tab 4 Android = Works good.
Samsung Galaxy A8 = Works good.
Ipad Chrome = Stream freeze extremely repeatedly, turns off after a while (worked well in v75).
Ipad Safari = Works good.

HTTP stream link
All good, no freezing so far on any of above mention devices.

VideoJS config
`

`

Yeah, the solution is to use overrideNative. Glad that Chrome is fixing the issue on their end. Please track https://github.com/videojs/http-streaming/issues/505 for when we change this default.

@DispatchCommit the !IS_SAFARI check is useful because Safari has good HLS support, and we prefer using the native implementation when possible.

How about the still existing issue...
HTTPS stream link + overrideNative: !videojs.browser.IS_SAFARI
Ipad Chrome = Stream freeze extremely repeatedly, turns off after a while (worked well in v75)
Is this a 100% Chrome issue?

This is a separate issue because it isn't android chrome. However, it does sound like it's best not to enable overrideNative on iOS devices.

For anybody who runs into this issue. Code for exception should be
html: { hls: { overrideNative: !videojs.browser.IS_ANY_SAFARI } }
IS_SAFARI flag mentioned above would make vidoejs override native on mobile. IS_ANY_SAFARI would make this exception work on iPad, iPhone and desktop as author of original snippet intended.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cshah123 picture cshah123  ·  4Comments

onigetoc picture onigetoc  ·  4Comments

aagiulian picture aagiulian  ·  3Comments

kocoten1992 picture kocoten1992  ·  4Comments

dingyaguang117 picture dingyaguang117  ·  4Comments