Show Menu
TOPICS×

Subscribe to custom ad tags

Browser TVSDK prepares TimedMetadata objects for subscribed tags each time these objects are encountered in the Media Presentation Description (MPD) file.
You must subscribe to the tags before playback starts. To subscribe to tags, set a vector that contains the custom tag names to the subscribedTags property. If you also need to change the ad tags used by the default opportunity generator, set a vector that contains the custom ad tag names to the adTags property.
To subscribe to custom tags:
  1. Create a new media player item configuration.
    var mediaPlayerItemConfig = new AdobePSDK.MediPlayerItemConfig();
    
    
  2. Create an empty string-vector.
    var subscribeTags = [];
    
    
  3. Add the custom tag names to this vector.
    If you are dealing with HLS streams, remember to include the # prefix.
    subscribeTags.push("urn:mpeg:dash:event:2012"); 
    subscribeTags.push("urn:com:adobe:dpi:simple:2015"); 
    
    
    
  4. Assign the updated vector to the mediaPlayerItemConfig.subscribeTags property.
    mediaPlayerItemConfig.subscribeTags = subscribeTags;
    
    
  5. Create an empty string-vector.
    var adTags= [];
    
    
  6. Add the custom ad tag name to this vector.
    adTags.push("urn:com:adobe:dpi:simple:2015");
    
    
  7. Assign the updated vector to the mediaPlayerItemConfig.adTags property.
    mediaPlayerItemConfig.adTags = adTags;
    
    
  8. Use the media player item configuration when loading the media stream.
    player.replaceCurrentResource(mediaResource,mediaPlayerItemConfig);