Skip to content

Conversation

@strfn
Copy link

@strfn strfn commented May 2, 2017

No description provided.

@tsheaff
Copy link

tsheaff commented May 2, 2017

What problem does this solve? Shouldn't you know if the URLs you're passing in are local or remote on the initializer. Or perhaps I'm missing something.

@strfn
Copy link
Author

strfn commented May 3, 2017

This is so the player streams the media from the local filesystem instead of the network if the file is available.

@tsheaff
Copy link

tsheaff commented May 3, 2017

@strfn Yeah it's an option. But it feels like it's not the job of this library. It's a streaming library. If you aren't streaming, several of the properties and methods may not act as you expect. For example, is timeBuffered gonna return 1 in this case, or 0, or something else? And I don't think persistentStreamPlayerDidLoadAsset will ever be called.

This also slows things down slightly on the main thread for the typical case of streaming remotely (fileExistsAtPath needs to go to disk).

You can just do this file check outside the PersistentStreamPlayer if you want, and use AVPlayerItem directly in that case, because the interface to PersistentStreamPlayer was not designed or tested for playing local audio.

Let me know if I'm wrong about this or if you have tested this more thoroughly. I can sympathize with wanting to use the same library in the disk AND network case. At minimum there should be a new BOOL property on the header that indicates if it's reading from disk not network.

Jessica Wu and others added 4 commits May 11, 2017 17:48
implemented NSURLConnection delegate method to handle the case when f…
* added a delegate method for authentication challenge

* only write to file when it's 200

* make sure the local saved content is playable, if not get the file from server again.

* making sure the method in the delegate is implemented before calling.
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

Successfully merging this pull request may close these issues.

3 participants