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

byterangesupported. #2

Open
mvaerum opened this issue Sep 6, 2017 · 4 comments
Open

byterangesupported. #2

mvaerum opened this issue Sep 6, 2017 · 4 comments

Comments

@mvaerum
Copy link

mvaerum commented Sep 6, 2017

Hi @jaredsinclair
Thank you very much for this example as well as your blogpost.
It has been very helpful for me to implement a delegate similar to the one from your sodes example.
However, i do have a problem: The data request ALWAYS ask for the entire length of the file.
Even if the file is several gigabytes long (e.g. 2gb) , and I return that length in then content info request (as well as setting isByteRangeSupported=true). The subsequent call to a data request will be from 0 to 2gb, and if I seek with avplayer then data request will be e.g. 1mb to 2gb that is always to the end of the file. The requestsAllDataToEndOfResource property of dataRequest is always true.
Do you have any idea what I could be doing wrong? I doesn't seem right that I should implement buffering in the delegate...
Cheers,
Morten

@keepsimple1
Copy link

@mvaerum I'm having the same issue and found your post here. Did you happen to find out the reason for this issue?

@jaredsinclair
Copy link
Owner

@mvaerum Make sure you're also implementing the cancelling of requests. In my experience with MP3s, it always asks for the full file first, then almost immediately cancels that request and instead asks for chunks of the file. Your mileage may vary. One thing I haven't tried but which might be interesting is to supply only a portion of the requested data and then prematurely call the "done" method (the exact method escapes me) to report that you're done supplying data. I'm curious how AVFoundation would react to that.

@rahulgoelsharechat
Copy link

Could you guys please send some working blogpost for this.

@arkonxu
Copy link

arkonxu commented Feb 14, 2024

Did you guys finally solved this? I'm facing the same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants