logo
THEOplayer
ABR
Ads
Caching
Content protection
Analytics
Casting
Media and Text Tracks
Miscellaneous
Verizon Media
Source
BaseSourceSourceSourceConfigurationSourceDescriptionSourceIntegrationIdSourcesTypedSource
Events
HESP
SSAI
Network
Presentation
Player
UI
VR

THEOplayer > SourceDescription

SourceDescription interface

Inherits from SourceConfiguration . See parent page for inherited properties and methods.

Describes the configuration of a player's source.

Signature:

export interface SourceDescription extends SourceConfiguration 

Properties

Property

Type

Description

sources (optional)

Sources

One or more media resources for playback.

Property Details

sources

One or more media resources for playback.

Signature:

sources?: Sources;

Remarks


- Multiple media sources should be used to increase platform compatibility. See examples below for important use cases.
- The player will try each source in the provided order.

Example 1

In this example, the player will first try to play the DASH source. This might fail if the browser does not support the Widevine or PlayReady CDM, for example on Safari. In that case, the player will try to play the HLS source instead.

[{
  src: 'dash-source-with-drm.mpd'
  contentProtection: {
    widevine: {
      licenseAcquisitionURL: 'https://license.company.com/wv'
    },
    playready: {
      licenseAcquisitionURL: 'https://license.company.com/pr'
    }
  }
},{
  src: 'hls-source-with-drm.m3u8',
  contentProtection: {
    fairplay: {
      certificateURL: 'https://license.company.com/fp'
    }
  }
}]

Example 2

In this example, the player will first try to play the DASH source. This might fail if the browser does not support the Media Source Extensions API. In that case, the player will try to play the MP4 source instead, though without features such as adaptive bitrate switching.

[{
  src: 'source.mpd'
},{
  src: 'source.mp4'
}]
github
Make sure to follow us on GitHub!
THEO-logo-white
twitter
facebook
linkedin
Copyright © 2020. All Rights Reserved.
Leuven
New York
Singapore
Barcelona