Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

one track auto play loop - streaming forever instead of once #1459

Closed
yairtal opened this issue Jun 5, 2018 · 8 comments
Closed

one track auto play loop - streaming forever instead of once #1459

yairtal opened this issue Jun 5, 2018 · 8 comments
Assignees
Labels
status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Milestone

Comments

@yairtal
Copy link

yairtal commented Jun 5, 2018

Have you read the FAQ and checked for duplicate open issues?:
Yes
What version of Shaka Player are you using?:
2.3.7
Can you reproduce the issue with our latest release version?:
Yes
Can you reproduce the issue with the latest code from master?:
Yes
Are you using the demo app or your own custom app?:
My own custom app
If custom app, can you reproduce the issue using our demo app?:
No, no auto play looping demo
What browser and OS are you using?:
chrome - ubuntu
What are the manifest and license server URIs?:

Not relevant imho, if it is - i'll provide it.

What did you do?
I am streaming and looping one video track, I'd like it to be downloaded fully only once, while the first loop is playing, and than to play the rest of the loops from storage.
How can this be accomplished?

What did you expect to happen?
That if I use bufferingGoal = bufferBehind configuration, the video will be downloaded just once.

What actually happened?
The video is redownloaded and restreamed with every loop.

Thank you for your help and patience!

@chrisfillmore
Copy link
Contributor

@yairtal I'm curious about your use case. What is the video you are playing? Who is the audience? Also, what is your infrastructure? Where does this video come from?

@TheModMaker
Copy link
Contributor

It seems like what you want is to store the video offline and then play that. You can use our offline storage code to store the manifest offline then play the resulting offline manifest.

Another option would be to set the bufferBehind and bufferingGoal values to the length of the video; but this will only work for short videos. If your video is an hour long, it is impossible for us to store the video in memory, so you'll have to store it offline.

player.configure({streaming: {bufferBehind: 600, bufferingGoal: 600}});

@chrisfillmore
Copy link
Contributor

The reason I ask about your use case is if you have relatively short, static, clear content, you could deliver video as a plain mp4 and the video element's loop attribute would do what you want.

@yairtal
Copy link
Author

yairtal commented Jun 5, 2018

I've tried the offline option, it will only download the lowest quality possible, no matter what's my bandwidth. Any way to configure that? Have it check the bandwidth before the download starts?

I've also tried to set bufferBehind and bufferingGoal values to the length of the video, the result was still a streaming download on every loop, it doesn't just download once.

I have a 73 secs long marketing video that is in 4K quality, it's auto played and looped.

@TheModMaker
Copy link
Contributor

Could you post a link to a page that reproduces your problem? I can loop a video by doing the following:

  1. Navigate to demo page (https://shaka-player-demo.appspot.com/demo/).
  2. Open DevTools and type debugConfig = {streaming: {bufferBehind: 600, bufferingGoal: 600}}.
  3. Click Load with the Angel One (multicodec, multilingual) asset selected.
  4. Right click the video, select Loop.

The video will play and loop without downloading the content ever again. You should be able to loop the video by setting the video's native loop value either in html with <video loop> or in JavaScript with video.loop = true. If you call player.load() again, we will download the content again.

If you do want to use offline, then the trackSelectionCallback configuration value is what chooses which tracks to download. It takes an array of all the tracks and should return an array of the tracks you want to store offline.

@yairtal
Copy link
Author

yairtal commented Jun 6, 2018

https://arctop.co

My video duration is 00:01:12.15 and my configuration is:

player.configure({
        streaming: {
          bufferBehind: 72.15,
          bufferingGoal: 72.15,
        },
      });

I've made sure I am not loading the video more than once.
html is set for loop with <video loop>

yet, it's downloading the entire video on each loop.

@TheModMaker
Copy link
Contributor

It looks like there is a small gap at the beginning of your content in the video stream. We jump the gap automatically; but when we seek to the beginning, we think it is an unbuffered seek, so we clear the buffer. We shouldn't be doing that.

As a work-around, you could manually set the seek range start, which will cause us to seek to that time when we loop and keep the buffer full. player.configure({playRangeStart: 0.01})

@TheModMaker TheModMaker added type: bug Something isn't working correctly and removed needs triage labels Jun 6, 2018
@TheModMaker TheModMaker added this to the v2.5 milestone Jun 6, 2018
@yairtal
Copy link
Author

yairtal commented Jun 7, 2018

Thank you for your fast reply and work-around

joeyparrish pushed a commit that referenced this issue Aug 6, 2018
When the video is looping and there's a small gap between the playhead
and buffer start, we should jump the gap instead of clear the buffer and
download it again later.

Change-Id: Ieead1462ac8c1cfcc957c391a61890396b870d40
Closes: #1459.
@shaka-project shaka-project locked and limited conversation to collaborators Sep 21, 2018
rounce pushed a commit to rounce/shaka-player that referenced this issue Jul 8, 2019
When the video is looping and there's a small gap between the playhead
and buffer start, we should jump the gap instead of clear the buffer and
download it again later.

Change-Id: Ieead1462ac8c1cfcc957c391a61890396b870d40
Closes: shaka-project#1459.
@shaka-bot shaka-bot added the status: archived Archived and locked; will not be updated label Apr 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Projects
None yet
Development

No branches or pull requests

5 participants