I know it's probably not the right place to raise this question, but I have a live event coming up and I guess since all the streaming masters are here, this is the quickest place I can get an answer.
My goal is to get the PDT or any other metadata from a live stream manifest on a device without support for MSE.
My current setup on desktop browsers: I use Hls.js, and listen to "Hls.Events.FRAG_CHANGED" event, from the event I can get the "rawProgramDateTime" or the "pdt" of a fragment.
Because IOS natively support hls streaming, and does not support MSE, I can't use Hls.js and all of the stream logic becomes obfuscated to me.
Is there any way I can't do this on IOS?
@dokydok AFAIK safari won鈥檛 expose this data.
What you can do is add timed metadata as ID3 tags and read it through the texttrack API.
You will need to add this data somehow in your encoder.
Thanks, but I don't have access to the encoder, is there any other way to do this?
@dokydok I suppose you could manually download the manifests and parse out the EXT-X-DATETIME tag yourself. But you'd have to manage the download timer. The spec says you should attempt a download on an interval based on the segment length. Here's our implementation: https://github.com/video-dev/hls.js/blob/master/src/controller/level-controller.js#L357-L374
That is what I'm doing now, this raises 2 questions:
BTW, thanks for the help and for not kicking me to Stackoverflow.. :)
how do I know which segment am I currently playing (n, n-1, n-2...)?
I can't say off the top of my head, but I'd imagine it'd be very difficult to get 1 second accuracy. Safari won't tell you what segment it's downloading, and you can't always assume things are running in sequential order.
Tricky given the limited native video API. It's a moving target with live. You won't know how the current time or buffer map to whatever the internal playlist state may be.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Hi dokydok, I am exactly in your situation. Did you find a way to read ID3 data in safari on IOS device. Any pointer will help.
Most helpful comment
Hi dokydok, I am exactly in your situation. Did you find a way to read ID3 data in safari on IOS device. Any pointer will help.