Languages

Menu
Sites
Language
video buffering on background using avplay or videojs

I know that avplay/videoJS/shakaPlayer players use buffering internally and can download a video in fragments to play it.

My issue is, I have multiple mp4 videos, some of them are fmp4 with multiple blocks but others no. For some videos with only one block, buffering time is too long and user experience is bad. these are examples: 

 

video1: http://secure-ds.serving-sys.com/BurstingRes/Site-74320/Type-16/8df572fa-4764-46c1-be95-342833cedcac.mp4 (4mb and 30sec aprox.)

video2: https://playtime.tubemogul.com/ad_promoted_videos/c6058f7d-dbd5-4d08-8dcf-16f82b0a97d2.mp4 (16mb and 30sec aprox.)

 

Problem is with video2. If you try to open video2 (cleaning cache) it requires, at least in my case, 50sec aprox to be completed (downloading) and the result is multiple breakpoints when playing.

 

I tested two things:

 

-Keep two video tags: using simple html tag / videoJS / shaka player. I found in other post that it is not possible watch 2 videos, at least using videoJS. Instead, suggetion is to use avplay, but i do not have idea how to keep two videos at same time with avplay (I HOPE TO RECEIVE SOME SUGGESTIONS WITH IT)

 

-Manual buffering: I've read this post https://developer.tizen.org/forums/web-application-development/tv-multiple-tags-on-one-page-not-working, where explain how to download a video in fragments, but it is not possible in my case. Sample requires that mp4 file to be fmp4 and uses an extra mpd file (like a manifest)

 

-Download in background: I found two options: using services and workers. With services, samples show how the main application send input to the service but not say if the service can send a response to the main app (I HOPE COMMENTS HERE TOO). With workers, even there is a tizen api to download files, it is not possible to use in the worker itself and then the last option is to use some method like fetch to reach it. Workers approach works but with some problems, i can to keep a video playing in the main thread and a worker downloading other video in background, but problems are two: Case 1 (if video start to play first): the time required to download the video (worker) increase to much and even when the video playing finished, the worker task time does not get better, that is, the download speed continues to be very slow. Case 2: (worker start to download first): the player is buggy and even when the worker complete its task, the first video never starts to play.

Edited by: Pavel Mendoza on 11 Nov, 2019