Class PlayerEmsgHandler

  • All Implemented Interfaces:

    public final class PlayerEmsgHandler
    extends Object
    implements Handler.Callback
    Deprecated. is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.
    Handles all emsg messages from all media tracks for the player.

    This class will only respond to emsg messages which have schemeIdUri "urn:mpeg:dash:event:2012", and value "1"/"2"/"3". When it encounters one of these messages, it will handle the message according to Section DASH -IF IOP Version 4.1:

    • If both presentation time delta and event duration are zero, it means the media presentation has ended.
    • Else, it will parse the message data from the emsg message to find the publishTime of the expired manifest, and mark manifest with publishTime smaller than that values to be expired.
    In both cases, the DASH media source will be notified, and a manifest reload should be triggered.
    • Constructor Detail

      • PlayerEmsgHandler

        public PlayerEmsgHandler​(DashManifest manifest,
                                 PlayerEmsgHandler.PlayerEmsgCallback playerEmsgCallback,
                                 Allocator allocator)
        manifest - The initial manifest.
        playerEmsgCallback - The callback that this event handler can invoke when handling emsg messages that generate DASH media source events.
        allocator - An Allocator from which allocations can be obtained.
    • Method Detail

      • updateManifest

        public void updateManifest​(DashManifest newManifest)
        Updates the DashManifest that this handler works on.
        newManifest - The updated manifest.
      • release

        public void release()
        Release this emsg handler. It should not be reused after this call.