admin管理员组

文章数量:1323023

When using Apple Live Streaming in Safari, is there any way to detect the current bitrate with Javascript? Alternatively, can I detect which element of the .m3u8 is being played?

I've looked at the HTMLMediaElement Class Reference, but found no clues there. The src property always references the .m3u8 file, so that doesn't help.

When using Apple Live Streaming in Safari, is there any way to detect the current bitrate with Javascript? Alternatively, can I detect which element of the .m3u8 is being played?

I've looked at the HTMLMediaElement Class Reference, but found no clues there. The src property always references the .m3u8 file, so that doesn't help.

Share Improve this question asked Oct 15, 2012 at 11:52 Paul DixonPaul Dixon 301k54 gold badges314 silver badges349 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 8

It looks like the WHATWG is trying to address that very concern. See their document about HTML5 video metrics here: http://wiki.whatwg/wiki/Video_Metrics

Using the Safari web developer tools, you can see that Webkit has implemented the following properties on the HTMLVideoElement:

  • webkitAudioDecodedByteCount
  • webkitDecodedFrameCount
  • webkitDroppedFrameCount
  • webkitVideoDecodedByteCount

There isn't much documentation out there about these, but I found some sample code that might be helpful.

I'd be very interested to hear if these properties worked for you. Please post your feedback if you gain any insight.

本文标签: javascriptDetect current bitrate of HTTP Live Streaming in SafariStack Overflow