Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

onMeta not firing


We are continuously appending to an HLS playlist to create a seamless video experience. I need to know when the current video that has been appended to the playlist is about to end so I can fire custom JS events.

We tried using onTime() but when playing a continuous live stream it only seems to fire when using HTML5, not Flash fallback.

We then had the idea of embedding timed metadata near the end of the video and using the onMeta to watch for it, unfortunately the event will not fire. I tried with a video I segmented using mediafilesegmenter with custom ID3 metadata and it didn't work, so I assumed I did something wrong. Then I found a sample stream on developer.apple.com that said it had timed metadata every 5 seconds. Here:

https://devimages.apple.com.edgekey.net/streaming/examples/bipbop_16x9/bipbop_16x9_variant.m3u8

The JS code I'm using is simple:

jwplayer().onMeta(function(e) { console.log(e) });

onMeta() is NOT firing every 5 seconds...so my questions are:

Am I using onMeta() incorrectly?
Is there a way to add timed metadata that onMeta() WILL respond to?
Is there a better way of knowing when a current clip within a continuous stream will end, such as getting information about what TS segment JWPlayer is currently playing?

Thanks for your help!

8 Community Answers

Ethan Feldman

JW Player Support Agent  
0 rated :

Where are you running this stream in the player on your site?

aaron.lahey

User  
0 rated :

I've mainly been testing using jwplayer.com/wizard and directly linking to the stream provided by Apple.

For the stream I created, I made a simple HTML page with the video player and loaded the m3u8 manually at the console. It plays the videos just fine, it just does not fire onMeta like I think it should.

Ethan Feldman

JW Player Support Agent  
0 rated :

Can I see a link to the page you created then?

aaron.lahey

User  
0 rated :

No unfortunately. But like I said, the majority of my testing has been with the jwplayer wizard and loading my own m3u8. You can load this stream...

https://devimages.apple.com.edgekey.net/streaming/examples/bipbop_16x9/bipbop_16x9_variant.m3u8

...and notice that onMeta() does not fire.

aaron.lahey

User  
0 rated :

The real question is: What metadata does onMeta() fire on and how do I add it to a video at a certain point in time?

Ethan Feldman

JW Player Support Agent  
0 rated :

Here is a working example – http://support.jwplayer.com/customer/portal/articles/1459607-example-using-onmeta-

aaron.lahey

User  
0 rated :

Ok, that appears to work.

I took that stream and loaded it into jwplayer.com/wizard. Using Flash fallback in Chrome it worked and fired the events like it was supposed to. However, using HTML5 in Safari it did NOT fire any onMeta events except for one at the start of the video.

This would be consistent with the behavior I was experiencing...due to cross domain issues I was only able to test my own (and Apple's) streams using HTML5 in Safari.

Is this a bug or expected behavior?

Ethan Feldman

JW Player Support Agent  
0 rated :

Expected behavior. Safari in HTML5 mode won’t fire off all those events.

This question has received the maximum number of answers.