async PlayoutOptions({objectId, versionHash, protocols=["dash", "hls"], drms=[], hlsjsProfile=true}) {
    protocols = protocols.map(p => p.toLowerCase());
    drms = drms.map(d => d.toLowerCase());

    if(!objectId) {
      objectId = this.utils.DecodeVersionHash(versionHash).objectId;
    }

    const libraryId = await this.ContentObjectLibraryId({objectId});

    if(!versionHash) {
      versionHash = (await this.ContentObjectVersions({libraryId, objectId, noAuth: true})).versions[0].hash;
    }

    let path = UrlJoin("q", versionHash, "rep", "playout", "default", "options.json");

    const audienceData = this.AudienceData({objectId, versionHash, protocols, drms});

    const playoutOptions = Object.values(
      await ResponseToJson(
        this.HttpClient.Request({
          headers: await this.authClient.AuthorizationHeader({
            objectId,
            channelAuth: true,
            audienceData
          }),
          method: "GET",
          path: path
        })
      )
    );

    let playoutMap = {};
    for(let i = 0; i < playoutOptions.length; i++) {
      const option = playoutOptions[i];
      const protocol = option.properties.protocol;
      const drm = option.properties.drm;
      const licenseServers = option.properties.license_servers;

      // Exclude any options that do not satisfy the specified protocols and/or DRMs
      const protocolMatch = protocols.includes(protocol);
      const drmMatch = drms.includes(drm) || (drms.length === 0 && !drm);
      if(!protocolMatch || !drmMatch) {
        continue;
      }

      if(!playoutMap[protocol]) {
        playoutMap[protocol] = {
          playoutUrl: await this.Rep({
            libraryId,
            objectId,
            versionHash,
            rep: UrlJoin("playout", "default", option.uri),
            channelAuth: true,
            queryParams: hlsjsProfile && protocol === "hls" ? { player_profile: "hls-js" } : {}
          }),
        };
      }

      if(drm) {
        playoutMap[protocol].drms = {
          ...(playoutMap[protocol].drms || {}),
          [drm]: {
            licenseServers
          }
        };
      }
    }

    return playoutMap;
  }
/**
   * Retrieve playout options for the specified content that satisfy the given protocol and DRM requirements
   *
   * If only objectId is specified, latest version will be played. To retrieve playout options for
   * a specific version of the content, provide the versionHash parameter (in which case objectId is unnecessary)
   *
   * @methodGroup Media
   * @namedParams
   * @param {string=} objectId - Id of the content
   * @param {string=} versionHash - Version hash of the content
   * @param {Array<string>} protocols - Acceptable playout protocols
   * @param {Array<string>} drms - Acceptable DRM formats
   */
Retrieve playout options for the specified content that satisfy the given protocol and DRM requirements
If only objectId is specified, latest version will be played. To retrieve playout options for
a specific version of the content, provide the versionHash parameter (in which case objectId is unnecessary)


Retrieve playout options for the specified content that satisfy the given protocol and DRM requirements If only objectId is specified latest version will be played . To retrieve playout options for a specific version of the content provide the versionHash parameter ( in which case objectId is unnecessary )
async PlayoutOptions({objectId, versionHash, protocols=["dash", "hls"], drms=[], hlsjsProfile=true}) {
    protocols = protocols.map(p => p.toLowerCase());
    drms = drms.map(d => d.toLowerCase());
    if(!objectId) {
      objectId = this.utils.DecodeVersionHash(versionHash).objectId;
    }
    const libraryId = await this.ContentObjectLibraryId({objectId});
    if(!versionHash) {
      versionHash = (await this.ContentObjectVersions({libraryId, objectId, noAuth: true})).versions[0].hash;
    }
    let path = UrlJoin("q", versionHash, "rep", "playout", "default", "options.json");
    const audienceData = this.AudienceData({objectId, versionHash, protocols, drms});
    const playoutOptions = Object.values(
      await ResponseToJson(
        this.HttpClient.Request({
          headers: await this.authClient.AuthorizationHeader({
            objectId,
            channelAuth: true,
            audienceData
          }),
          method: "GET",
          path: path
        })
      )
    );
    let playoutMap = {};
    for(let i = 0; i < playoutOptions.length; i++) {
      const option = playoutOptions[i];
      const protocol = option.properties.protocol;
      const drm = option.properties.drm;
      const licenseServers = option.properties.license_servers;
      const protocolMatch = protocols.includes(protocol);
      const drmMatch = drms.includes(drm) || (drms.length === 0 && !drm);
      if(!protocolMatch || !drmMatch) {
        continue;
      }
      if(!playoutMap[protocol]) {
        playoutMap[protocol] = {
          playoutUrl: await this.Rep({
            libraryId,
            objectId,
            versionHash,
            rep: UrlJoin("playout", "default", option.uri),
            channelAuth: true,
            queryParams: hlsjsProfile && protocol === "hls" ? { player_profile: "hls-js" } : {}
          }),
        };
      }
      if(drm) {
        playoutMap[protocol].drms = {
          ...(playoutMap[protocol].drms || {}),
          [drm]: {
            licenseServers
          }
        };
      }
    }
    return playoutMap;
  }
async PlayoutOptions ( { objectId , versionHash , protocols = [ "dash" , "hls" ] , drms = [ ] , hlsjsProfile = true } ) { protocols = protocols . map ( p => p . toLowerCase ( ) ) ; drms = drms . map ( d => d . toLowerCase ( ) ) ; if ( ! objectId ) { objectId = this . utils . DecodeVersionHash ( versionHash ) . objectId ; } const libraryId = await this . ContentObjectLibraryId ( { objectId } ) ; if ( ! versionHash ) { versionHash = ( await this . ContentObjectVersions ( { libraryId , objectId , noAuth : true } ) ) . versions [ 0 ] . hash ; } let path = UrlJoin ( "q" , versionHash , "rep" , "playout" , "default" , "options.json" ) ; const audienceData = this . AudienceData ( { objectId , versionHash , protocols , drms } ) ; const playoutOptions = Object . values ( await ResponseToJson ( this . HttpClient . Request ( { headers : await this . authClient . AuthorizationHeader ( { objectId , channelAuth : true , audienceData } ) , method : "GET" , path : path } ) ) ) ; let playoutMap = { } ; for ( let i = 0 ; i < playoutOptions . length ; i ++ ) { const option = playoutOptions [ i ] ; const protocol = option . properties . protocol ; const drm = option . properties . drm ; const licenseServers = option . properties . license_servers ; const protocolMatch = protocols . includes ( protocol ) ; const drmMatch = drms . includes ( drm ) || ( drms . length === 0 && ! drm ) ; if ( ! protocolMatch || ! drmMatch ) { continue ; } if ( ! playoutMap [ protocol ] ) { playoutMap [ protocol ] = { playoutUrl : await this . Rep ( { libraryId , objectId , versionHash , rep : UrlJoin ( "playout" , "default" , option . uri ) , channelAuth : true , queryParams : hlsjsProfile && protocol === "hls" ? { player_profile : "hls-js" } : { } } ) , } ; } if ( drm ) { playoutMap [ protocol ] . drms = { ... ( playoutMap [ protocol ] . drms || { } ) , [ drm ] : { licenseServers } } ; } } return playoutMap ; }
Retrieve playout options for the specified content that satisfy the given protocol and DRM requirements
 If only objectId is specified, latest version will be played.
Retrieve playout options for the specified content that satisfy the given protocol and DRM requirements If only objectId is specified latest version will be played .
// Exclude any options that do not satisfy the specified protocols and/or DRMs