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

Native HLS broken on android chrome 78

Open masterada opened this issue 7 years ago • 18 comments

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

masterada avatar Oct 26 '19 20:10 masterada

👋 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.

welcome[bot] avatar Oct 26 '19 20:10 welcome[bot]

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.

aaronsoulliere avatar Oct 27 '19 00:10 aaronsoulliere

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.

mister-ben avatar Oct 27 '19 07:10 mister-ben

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

latger avatar Oct 27 '19 08:10 latger

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.

Tralapo avatar Nov 01 '19 06:11 Tralapo

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.

mister-ben avatar Nov 01 '19 07:11 mister-ben

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>

Tralapo avatar Nov 01 '19 09:11 Tralapo

overrideNative shouldn't be a top level option.

data-setup='{"html5": {"hls": {"overrideNative":true}}, "controlBar": …

bcbclifford avatar Nov 03 '19 09:11 bcbclifford

// 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).

DispatchCommit avatar Nov 04 '19 09:11 DispatchCommit

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.

ccornybig2 avatar Nov 08 '19 20:11 ccornybig2

Cant reproduce now. On Chrome 78.0.3904.96, Android 9

Kogoruhn avatar Nov 14 '19 05:11 Kogoruhn

They fixed it already, fortunately: https://bugs.chromium.org/p/chromium/issues/detail?id=1022417

herrernst avatar Nov 14 '19 08:11 herrernst

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

programmeratl avatar Nov 14 '19 15:11 programmeratl

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 `

`

DJ-PD avatar Nov 21 '19 19:11 DJ-PD

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.

gkatsev avatar Nov 21 '19 22:11 gkatsev

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?

DJ-PD avatar Nov 22 '19 14:11 DJ-PD

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.

gkatsev avatar Nov 22 '19 16:11 gkatsev

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.

wkoncki avatar Mar 04 '20 10:03 wkoncki