# Synchronizing events with live HLS in Safari on ipad

**URL:** <https://community.wowza.com/t/synchronizing-events-with-live-hls-in-safari-on-ipad/34719>\
**Category:** Wowza Streaming Engine\
**Created:** [May 2, 2011, 7:43am UTC](https://community.wowza.com/t/synchronizing-events-with-live-hls-in-safari-on-ipad/34719 "2011-05-02T07:43:35Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jay\_Charles](https://avatars.discourse-cdn.com/v4/letter/j/c89c15/32.png) [@Jay\_Charles](https://community.wowza.com/u/Jay_Charles)\
**Post date:** [May 2, 2011, 7:43am UTC](https://community.wowza.com/t/synchronizing-events-with-live-hls-in-safari-on-ipad/34719/1 "2011-05-02T07:43:35Z")

</div>

I’d like to be able to sync events to a live streams in Safari on ipad. For example, I’d like to be able to display real time closed captions that are being piped in to my Wowza app. For flash clients this is easy, but I’m not finding a clear way to do it for ipad.

From what I’ve found so far, there is no javascript analog to the native app timedMetaData event, so it seems that I can’t do it with id3 tags. So, my thinking is that I’ll need to go the route of an HTTProvider that pulls the caption data out of the app instance, and then long poll the HTTProvider on an interval from the client side.

The trouble I run into there is the varied delay any given HLS client might be experiencing. Is there a way for me to gauge what the delay is for a given client? Even better, is there a javascript event in safari that I haven’t found?

In the end, I can tolerate a few seconds of skew in the sync (I could live with 5-10 seconds)… I just need to find a way of managing it consistently.

Thanks,

Jay

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [May 3, 2011, 12:44am UTC](https://community.wowza.com/t/synchronizing-events-with-live-hls-in-safari-on-ipad/34719/2 "2011-05-03T00:44:16Z")

</div>

Jay,

It is possible with ID3 tags, however two problems, we don’t have a working server-side example, or client-side example of how to handle it. Not sure about your work around. You could easily fetch data about a stream with HTTProvider, but not sure how you would do cuepoints that way.

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [May 3, 2011, 2:44pm UTC](https://community.wowza.com/t/synchronizing-events-with-live-hls-in-safari-on-ipad/34719/3 "2011-05-03T14:44:05Z")

</div>

I have looked around at how to handle data from ID3 tags in iDevices, and as far as I can tell objective c is required (javascript option would be nice), but I could not find a working example. So this is non-starter at present. I know that is frustrating, I am, but I think the ball is in Apple’s court at the moment to demonstrate how this should be done in their device. Then it will make sense for us to move forward with Cupertino cuepoint integration and examples. Please let us know if _you_ learn anything useful.

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [May 3, 2011, 5:03pm UTC](https://community.wowza.com/t/synchronizing-events-with-live-hls-in-safari-on-ipad/34719/4 "2011-05-03T17:03:01Z")

</div>

You might want to take a look at and subscribe to this thread also:

> [@ID3 Tags server side](http://community.wowza.com/t/-/36424):
>
> Hello, I have a rtmp encoder to publish live stream and I’m trying to inject meta-data on server side and send stream to iOS and Android. i configured my server like this [toturial](https://www.wowza.com/docs/how-to-set-up-live-streaming-using-an-rtmp-based-encoder%28RTMP-or-RTSP-RTP-based-encoder%29) is it possible to use your id3 tags lib to send meta-data and the stream to all players? flash, ios, android? Best regards, Luís

Richard

---

<div class="post-metadata">

**Author:** ![Jay\_Charles](https://avatars.discourse-cdn.com/v4/letter/j/c89c15/32.png) [@Jay\_Charles](https://community.wowza.com/u/Jay_Charles)\
**Post date:** [May 3, 2011, 7:48am UTC](https://community.wowza.com/t/synchronizing-events-with-live-hls-in-safari-on-ipad/34719/5 "2011-05-03T07:48:20Z")

</div>

Thanks Richard,

On the HTTProvider side, I already have a working model whereby the HTTProvider invokes methods in my application module. My module keeps a hashmap of event info objects, each with a timestamp or id. The HTTProvider invokes a method on the app module with a starting id or timestamp as an argument, and the function in the module iterates backwards through the hashmap to find events that are newer than the timestamp or id passed to the function, and returns a new hashmap with the needed data. That part works just fine, so I can reply on the HTTProvider to get messages to iOS clients if need be.

That said, using HTTProvider results in the client getting the new messages based on the long poll interval, and gives me no way to compensate for HLS delay time when trying to sync events to the live stream.

I also have a module that adds ID3V2FrameTextInformation objects to the id3FramesHeader as needed (which seems to be working), but what I can’t seem to find is a way to get those id3 tags out of quicktime via a javascript event in safari. From what I’ve read in the apple docs, you can do this in a native app by listening for a timedMetaData event, but in the case of safari using a tag, I don’t see anything documented, and there doesn’t appear to be any timedMetaData events being fired off to javascript. If I can find a way clear to this, I can forgo the long poll process, and just send the required string data in the id3 tag (which would be synchronized to the stream… no?)

---

<div class="post-metadata">

**Author:** ![Jay\_Charles](https://avatars.discourse-cdn.com/v4/letter/j/c89c15/32.png) [@Jay\_Charles](https://community.wowza.com/u/Jay_Charles)\
**Post date:** [May 3, 2011, 11:32am UTC](https://community.wowza.com/t/synchronizing-events-with-live-hls-in-safari-on-ipad/34719/6 "2011-05-03T11:32:35Z")

</div>

Thanks Richard.

Yeah… support for anything other than “hey look at this video” in iOS is woefully lacking. Even being able to calculate the delay between what the client is seeing and the video arriving at the server would have sufficed, but alas, no love there. Perhaps Apple will get past 2001 technology before too long.
