main: get MIME type for play page to determine which player to load
play.html needs to know the MIME type of the media that it should play so that it can load the correct player.
One approach we could take is to add a Mime field to the pagedata struct (main.go). Then add a call to the data store in the playHandler function (video.go) so we can populate this field.
Comments (6)
-
reporter -
reporter @Alan Noble @Saxon Milton @Scott Barnard I’m leaning towards the second option since it will save requesting data from the store again only to get the Mime type. What are your thoughts?
-
The player already takes an out query param. Can that not used used/extended?
-
reporter Yes I think that parameter can be used. So the search page will produce links that have eg. … out=x-motion-jpeg … then the player page can read that parameter and switch it to m3u before passing it onto the players.
-
reporter -
assigned issue to
-
assigned issue to
-
reporter - changed status to resolved
Resolved in PR #47
- Log in to comment
Another way we could do this is to add another value to the query when requesting the play page, ie. type=H264 or type=x-motion-jpeg to load the respective player. This would remove the need to get data from the datastore again just to check the mime type.