videojs / video.js

Video.js - open source HTML5 video player
https://videojs.com
Other
38.05k stars 7.45k forks source link

Videojs Subtitle Loading Issue on TV when subtitles are more than 10 languages #8278

Open prakash-bbsr opened 1 year ago

prakash-bbsr commented 1 year ago

Description

We are using the videojs v7.11.7. We are facing issue when subtitle more than 10 , the videojs player is taking more than 20 seconds to load. We have tried the below approaches:- 1) Load default subtitle first. 2) In player.on('playing', async (event) => {} add other subtitle using player.addRemoteTextTrack(). 3) In this approaches player loaded but while playing, the player stocks for a couple of seconds. After loaded subtitle then starts playing. We have tried another approaches : Load subtitle without providing the subtitle src except the default text-track but subtitles are not shoing on player. I have already set the below :-

 var player = videojs('my_video_1',{
        controls: true,
        preload: "auto",
        textTrackSettings: false,      
        html5: {
                    nativeTextTracks: false,
                    preloadTextTracks:false,
                }               
    });     

Reduced test case

https://codepen.io/gkatsev/pen/GwZegv?editors=1000

Steps to reproduce

  1. The player loading performance is depending on the number of subtitles.
  2. When subtitle more than 10 then it takes more than 16 seconds to load.
  3. Web browser end not finding such type of problem.
  4. Subtitle files are from the third-party CDN

Errors

Taking mare than 16 seconds to play on Samsung TV. The player loading time depends on the number of subtitle.

What version of Video.js are you using?

v7.11.7.

Video.js plugins used.

https://unpkg.com/@videojs/http-streaming@2.16.2/dist/videojs-http-streaming.js

What browser(s) including version(s) does this occur with?

Samsung TV

What OS(es) and version(s) does this occur with?

Samsung Tv

welcome[bot] commented 1 year ago

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

prakash-bbsr commented 1 year ago

Hi Support, I am waiting for your response.Could you please reply for your finding.

gkatsev commented 1 year ago

With preloadTextTrack: false, I can confirm that no subtitles are loaded, when they are in the HTML. I didn't check whether it works via addRemoteTextTrack. https://codepen.io/gkatsev/pen/oNaJMmj?editors=1000

prakash-bbsr commented 1 year ago

Hi Gary Katsevman, Thanks for your reply. Let me check and get back to you.

prakash-bbsr commented 1 year ago

Hi Gary Katsevman, Could you please find my response below? 1) when we use the video js (https://unpkg.com/video.js@6.13.0/dist/video.js) it is not working in webalso . Internally loads all subtitle then play. The player behaves like a halt. Videojs version 7.10 and above is working fine. 2) When we are passing tracks as an array to videos setup instead of Html element then it is work on a web browser with the (https://unpkg.com/video.js@6.13.0/dist/video.js) i.e var player = videojs('my_video',{ controls: true, preload: "auto", // textTrackSettings: false, tracks: VTT, //Vtt is an array of object html5: { nativeTextTracks: false, preloadTextTracks: false } });

NOTE:- For Samsung TV Html Track is working without loading all tracks but when we pass subtitles to tracks properties then load all subtitles once. Could you please suggest what is the best for supporting Samsung TV? Currently, We are using videjs 6.13 for compatibility with Samsung TV.

prakash-bbsr commented 1 year ago

Hi Gary Katsevman, We found another behaviour. When we pass nativeTextTracks: false, All tracks are loading for the Samsung Tv case. html5: { nativeTextTracks: false } Is there any issue in the (https://unpkg.com/video.js@6.13.0/dist/video.js) ?

gkatsev commented 1 year ago

Unfortunately, this option is only available in versions 7.7.0 (with a fix for default tracks in 7.11.6) and newer.

prakash-bbsr commented 1 year ago

Hi Gary Katsevman, Thanks for your quick reply.