Closed tooolbox closed 6 years ago
You know...it's possible that this could be implemented with segments, at least to a degree. It seems like you can define segments, and the player fires a notification when it enters a segment...would have to figure out scrubbing, but seems like a start.
We haven't discussed or decided yet whether the concept of interstitial content should natively be supported by our library, as we currently do for blocked media regions.
But since segments provide a way to add a logical structure to a media, you should be able to use them to implement the behavior you need.
Any suggestions on the best way to go about this, architecturally?
I would attempt defining segments matching your interstitials, then respond appropriately within them. In your case I would probably register a periodic time observer (addPeriodicTimeObserverForInterval:queue:usingBlock:
), which would check whether a segment is currently played (currentSegment
), and disable controls appropriately.
Would you be interested in this as a contribution to your library?
We could of course be interested in having this functionality built-in, and we are open to contributions as well.
Would I need to write it in Objective-C to contribute it to your library?
Yes, for technical reasons we distribute our libraries only in Objective-C at the moment.
This feature is not planned at the moment. Segments can be used instead.
Issue overview
AVPlayerViewController offers a feature for interstitial content, whereby you can mark certain time ranges in your content. A delegate object will then be notified when the player hits those ranges, and this can be used to halt scrubbing and/or disable player controls. This feature is covered here in the documentation, and is currently only available for tvOS.
You guys have something called "segments", which I don't fully understand and haven't seen in any other players, and you can "block" them and so forth. At first I thought this might be your own terminology or solution for the subject of interstitials, but after reviewing the methods it doesn't seem related.
Couple questions and points:
<-- most important question ^_^