-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for cuechange events in HLS playback #2476
Conversation
@ismena Can you check if everything is correct? Thanks! |
Can you explain the use case for me a little? |
This change simplifies SS logic, just as it has done for DASH regions. On the other hand I have seen that there was an issue that asked to launch an event when there was a change of cues, I have been reviewing our internal logic and we also used it to obtain certain metadata from other streams. |
This is different from the CUEPOINTS_CHANGED event, right? What are the cues in this case? |
Yes, it’s different. The method is https://developers.google.com/interactive-media-ads/docs/sdks/html5/dai/reference/js/StreamManager#onTimedMetadata |
Oh, I see. What format is the hls metadata in? Ideally we'd want to convert hls and dash metadata to the same internal format and then to the ad manager that should be agnostic of whether it came from hls or dash. Can we come up with a common format for the timed region and whatever format hls' stuff is in? |
For HLS is key/value, but in DASH is another world. Each our providers has a specific format in the region. |
Ok, in that case let's proceed with this solution for now to unblock you, I'll see if we can find a common denominator later. |
Yes, but until next week it is not possible. |
That's fine. Let me run the build bot to see if there are any build issues now. I have some testing stuff for ads in code review now, I'll try to get it checked in by next week and hopefully it will make it easier for you to write a test for this next week. |
Ok, I'll wait for that to go up to merge the changes and write the test. Thanks! |
All tests passed! |
Alright, the initial test suit has been checked in: test/ads/ad_manager_unit.js. Feel free to add your test there, if it fits. |
I was wrong :( I found a spec for this https://github.com/WICG/datacue/blob/master/explainer.md and applies to DASH and HLS. I think that It's better not to merge this PR and create in a future a valid solution to both. |
@avelad Ideally, I'd put this on hold and work on a common solution, but if you need this in 2.6, I'll work with you. |
Sorry, I updated the comment. I think that I can work in the full specification of HLS and partially in DASH in 3-4 weeks. It’s not necessary in 2.6. If you have any recommendation about the design, any idea is welcome. |
Another option is remove the part of expose the new event and kept the SS logic, what do you think? |
I'm not sure I understand the suggestion in the last comment. Why don't you start with a short design proposal(s) once you're ready to look into it? I'll also see if I can look at it in the next few weeks. If I swing it, I'll have some design thoughts for you before you start, otherwise, we'll work on it together once you get to it. |
Ok, I will work on a design proposal. Until Tuesday I will not be able to start working, it is Easter holidays, but we will be confined at home also due to the covid-19 :) |
@avelad Have a great stay-at-home holiday :) |
I think this would be the API proposal: /**
ValueObject = { Enum for type property:
For native playback we can get the info from cuechange event |
Metadata example of mux.js @ismena this is necessary for DAI (SS) when you are using HLS-TS in Chrome for example. Have you take into account? |
@avelad |
@@ -2125,6 +2146,14 @@ shaka.Player = class extends shaka.util.FakeEventTarget { | |||
track.mode = 'hidden'; | |||
this.eventManager_.listen(track, 'cuechange', () => { | |||
for (const cue of track.activeCues) { | |||
const eventName = shaka.Player.EventName.Metadata; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW, is this whole method only applicable to Safari or is it gonna work for all the browsers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now only Safari, but it will work in all browsers, mux.js exposes the ID3 metadata but it is still not handled in the app.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha. Is it related to this PR or is that separate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That PR is the base, but you still have to process the data and expose it to the SS and launch the metadata event. I had planned to work on this soon, but I have two more urgent PR for this week according to our needs.
Looks good, running the buildbot now. |
All tests passed! |
Thanks, merged! |
Resolves #1917