Class ImaStreamRequest


  • public final class ImaStreamRequest
    extends Object
    IMA request implementation allowing to issue IMA stream requests with server side ads insertion

    After ImaPlugin is registered and enabled the request can be issued as following:

    
      // Starting playback with a Bundle
      Bundle bundle = new Bundle();
      bundle.putParcelable(SdkConsts.INTENT_ADVERTS_DATA, new ImaStreamRequest("ContentSourceId", "VideoId", "ApiKey").toAdRequest())
    
      // Starting playback with PlayerConfig
      PlayerConfig config = new PlayerConfig.Builder("content_url")
        .adRequest(new ImaStreamRequest("ContentSourceId", "VideoId", "ApiKey").toAdRequest())
        .contentType(SdkConsts.CONTENT_TYPE_DASH)
             .get();
    
     
    Since:
    4.2.19
    • Field Detail

      • contentSourceId

        @Nullable
        public final String contentSourceId
        Content source ID for VOD server side ad insertion streams. Set to null for live streams
      • videoId

        @Nullable
        public final String videoId
        Video ID for VOD server side ad insertion streams. Set to null for live streams
      • apiKey

        @Nullable
        public final String apiKey
        API key for the ad server
      • assetKey

        @Nullable
        public final String assetKey
        Asset key for server side ad insertion streams. Set to null for VOD streams
      • fallbackUrl

        @Nullable
        public final String fallbackUrl
        Fallback Url to be used when stream Url can not be retrieved from the ad server
      • adSnapback

        public final boolean adSnapback
        Set to true to force play the closest skipped ad when seeking the content.
    • Constructor Detail

      • ImaStreamRequest

        public ImaStreamRequest​(@Nullable
                                String contentSourceId,
                                @Nullable
                                String videoId,
                                @Nullable
                                String apiKey)
        Create IMA stream request for VOD streams
        Parameters:
        contentSourceId - Content source Id
        videoId - Video Id
        apiKey - API key
      • ImaStreamRequest

        public ImaStreamRequest​(@Nullable
                                String contentSourceId,
                                @Nullable
                                String videoId,
                                @Nullable
                                String apiKey,
                                @Nullable
                                String fallbackUrl,
                                boolean adSnapback)
        Create IMA stream request for VOD streams
        Parameters:
        contentSourceId - Content source Id
        videoId - Video Id
        apiKey - API key
        fallbackUrl - Fallback Url
        adSnapback - Enable or disable ads snap back
      • ImaStreamRequest

        public ImaStreamRequest​(@Nullable
                                String assetKey,
                                @Nullable
                                String apiKey)
        Create IMA stream request for live streams
        Parameters:
        assetKey - Asset key
        apiKey - API key
      • ImaStreamRequest

        public ImaStreamRequest​(@Nullable
                                String assetKey,
                                @Nullable
                                String apiKey,
                                @Nullable
                                String fallbackUrl,
                                boolean adSnapback)
        Create IMA stream request for live streams
        Parameters:
        assetKey - Asset key
        apiKey - API key
        fallbackUrl - Fallback Url
        adSnapback - Enable or disable ads snap back