Media Functions

ttv.media Functions

Function or PropertyDescriptionFunction TypeReturns
ttv.media.inFolder(folderID)A promise which will return a list of media URLs as specified by Folder IDPromisearray
ttv.media.withTags([tag, ...])A promise which will return a list of media URLs as specified by the array of one or more tags. Accepts array of strings (tags).Promisearray
ttv.media.byId(mediaID)A promise which will return the media's URL as specified by the media IDPromisestring

Code Samples

window.onloadTelemetryTV = function (ttv) {
  ttv.media.inFolder('abc123abc123abc123').then((mediaInFolder) => {
    console.log('Media in Folder:', mediaInFolder);
  });

  // Support multiple tags like `['foo', 'bar']`
  ttv.media.withTags(['foo']).then(mediaList => {
    console.log('Media with tag "foo":', mediaList);
  })
  
  ttv.media.byId('xyz890xyz890xyz890').then(url => {
    console.log('Media by ID:', url);
  })
};