-
Notifications
You must be signed in to change notification settings - Fork 58
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
Feature request: Type conversion from M3u8::Playlist to M3u8::PlaylistItem #26
Comments
HI @waterjump, I'm a little confused by your request. A
Let me know if I've overlooked something in your request, which wouldn't surprise me. :-) |
Hi Seth, Thanks for your quick response. After typing out several hundred words detailing my issue, I realized that the tags found in a media playlist are not congruent to the tags about a media playlist in the context of a master playlist, so it doesn't make sense to transmute between the two types like I thought it would. Basically, I rubber-ducked it and saved you a lot of reading I hope. Closing |
Hi @waterjump, I see what you were trying to do now. As you already realized it's outside the scope of this project since this library doesn't actually do anything with the MPEG-TS segments referenced in a media playlist and you would need to know the media information (codecs, bitrate, etc) to generate the attributes for a variant/master playlist. However, there are some other tools that can help you with just that. You might want to take a look at Here's all of them: https://developer.apple.com/library/archive/documentation/NetworkingInternet/Conceptual/StreamingMediaGuide/UsingHTTPLiveStreaming/UsingHTTPLiveStreaming.html |
Recently I had a use case where I was looking to convert a
M3u8::Playlist
toM3u8::PlaylistItem
. I was a bit surprised it's not supported by this gem, and that PlaylistItem instances need to be built from an options hash. This doesn't seem like a rare use case, especially when working with a master playlists, parsing media playlists they contain, working with them, and building a new master playlist as a result.Here's a short example use case I'm imagining:
My temporary workaround for this is to dump all of a Playlist's instance variables into a hash (excluding
items
, etc.) and building a new PlaylistItem from that. If there's a more intuitive way to do this that I'm missing, please let me know.A secondary solution could be to implement a
Playlist#to_options
method that returns an options hash that allows for easy creation of a PlaylistItem:If you are on board with the feature request, I'll be happy to write the specs and open a PR.
Thanks!
The text was updated successfully, but these errors were encountered: