Extracting metadata from Icecast stream using Exoplayer

后端 未结 5 1870
旧时难觅i
旧时难觅i 2021-01-07 02:31

Since switching from Mediaplayer to a simple implementation Exoplayer I have noticed much improved load times but I\'m wondering if there is any built in functionality such

5条回答
  •  长发绾君心
    2021-01-07 03:16

    This will depend on a few factors (like stream format), but the short answer is no. Most browsers don't expose this. There is an out-of-band metadata approach though.

    If the Icecast server from which you are getting this stream is running version 2.4.1 or newer, then you can query the metadata from its JSON API though. Basically by querying http://icecast.example.org/status.json or if you want info for only one specific stream: http://icecast.example.org/status.json?mount=/stream.ogg

    This can be worked into older versions of Icecast, but then the API output needs to be cached by the webserver hosting the webpage/player or with CORS ACAO support.

提交回复
热议问题