Azure Media Player
Options
Menu

Azure Media Services logo

Azure Media Player

Azure Media Player is a web video player built to playback media content from Microsoft Azure Media Services on a wide variety of browsers and devices. Azure Media Player utilizes industry standards, such as HTML5, Media Source Extensions (MSE) and Encrypted Media Extensions (EME) to provide an enriched adaptive streaming experience. When these standards are not available on a device or in a browser, Azure Media Player uses Flash and Silverlight as fallback technology. Regardless of the playback technology used, developers will have a unified JavaScript interface to access APIs. This allows for content served by Azure Media Services to be played across a wide-range of devices and browsers without any extra effort.

Microsoft Azure Media Services allows for content to be served up with DASH, Smooth Streaming and HLS streaming formats to playback content. Azure Media Player takes into account these various formats and automatically plays the best link based on the platform/browser capabilities. Microsoft Azure Media Services also allows for dynamic encryption of assets with common encryption (PlayReady or Widevine) or AES-128 bit envelope encryption. Azure Media Player allows for decryption of PlayReady and AES-128 bit encrypted content when appropriately configured. See the Protected Content section for how to configure this.

To request new features, provide ideas or feedback, please submit to UserVoice for Azure Media Player. If you have and specific issues, questions or find any bugs, drop us a line at ampinfo@microsoft.com.

Sign up to never miss a release and to stay up to date with the latest that Azure Media Player has to offer.

Please note that Azure Media Player only supports media streams from Azure Media Services.

Release Notes

Below is a list of known issues associated with this release. Also, a list of tested and unsupported features is provided below to help during development.

Feature List

Known Issue List

Changelog

TypeScript Definitions (d.ts)

Quick start

Azure Media Player is easy to set up. It only takes a few moments to get basic playback of media content from your Azure Media Services account. This section shows you the basic steps without going into details. Sections that follow give you specifics on how to set up and configure Azure Media Player. Simply add the following includes to your document's <head>:

<link href="//amp.azure.net/libs/amp/latest/skins/amp-default/azuremediaplayer.min.css" rel="stylesheet">
<script src= "//amp.azure.net/libs/amp/latest/azuremediaplayer.min.js"></script>

IMPORTANT: You should NOT use the latest version in production, as this is subject to change on demand. Replace latest with a version of Azure Media Player; for example replace latest with 1.0.0. Azure Media Player versions can be queried from here.

Next, simply use the <video> element as you normally would, but with an additional data-setup attribute containing any options. These options can include any Azure Media Services option in a valid JSON object.

<video id="vid1" class="azuremediaplayer amp-default-skin" autoplay controls width="640" height="400" poster="poster.jpg" data-setup='{"nativeControlsForTouch": false}'>
    <source src="http://amssamples.streaming.mediaservices.windows.net/91492735-c523-432b-ba01-faba6c2206a2/AzureMediaServicesPromo.ism/manifest" type="application/vnd.ms-sstr+xml" />
    <p class="amp-no-js">
        To view this video please enable JavaScript, and consider upgrading to a web browser that supports HTML5 video
    </p>
</video>

If you don't want to use auto-setup, you can leave off the data-setup attribute and initialize a video element manually.

var myPlayer = amp('vid1', { /* Options */
        "nativeControlsForTouch": false,
        autoplay: false,
        controls: true,
        width: "640",
        height: "400",
        poster: ""
    }, function() {
          console.log('Good to go!');
           // add an event listener
          this.addEventListener('ended', function() {
            console.log('Finished!');
        }
      }
);
myPlayer.src([{ 
    src: "http://amssamples.streaming.mediaservices.windows.net/91492735-c523-432b-ba01-faba6c2206a2/AzureMediaServicesPromo.ism/manifest", 
    type: "application/vnd.ms-sstr+xml"
}]);

License

Azure Media Player is licensed and subject to the terms outlined in the Microsoft Software License Terms for Azure Media Player. Please see license file for full terms. Please see the Privacy Statement for more information.

Copyright 2015 Microsoft Corporation.


Full Setup of Azure Media Player

Azure Media Player is easy to set up. It only takes a few moments to get basic playback of media content right from your Azure Media Services account. Samples are also provided in the samples directory of the release.

Step 1: Include the Javascript and CSS files in the head of your page.

With Azure Media Player, you can access the scripts from the CDN hosted version. It's often recommended now to put JavaScript before the end body tag <body> instead of the <head>, but Azure Media Player includes an 'HTML5 Shiv', which needs to be in the head for older IE versions to respect the video tag as a valid element.

NOTE: If you're already using an HTML5 shiv like Modernizr you can include the Azure Media Player JavaScript anywhere, however make sure your version of Modernizr includes the shiv for video.

CDN Version

<link href="//amp.azure.net/libs/amp/latest/skins/amp-default/azuremediaplayer.min.css" rel="stylesheet">
<script src= "//amp.azure.net/libs/amp/latest/azuremediaplayer.min.js"></script>

IMPORTANT: You should NOT use the latest version in production, as this is subject to change on demand. Replace latest with a version of Azure Media Player; for example replace latest with 1.0.0. Azure Media Player versions can be queried from here.

Note: Since the 1.2.0 release, it is no longer required to include the location to the fallback techs (it will automatically pick up the location from the relative path of the azuremediaplayer.min.js file). You can modify the location of the fallback techs by adding the following script in the <head> after the above scripts.

Note: Due to the nature of Flash and Silverlight plugins, the swf and xap files should be hosted on a domain without any sensitive information or data - this is automatically taken care of for you with the Azure CDN hosted version.

<script>
  amp.options.flashSS.swf = "//amp.azure.net/libs/amp/latest/techs/StrobeMediaPlayback.2.0.swf"
  amp.options.silverlightSS.xap = "//amp.azure.net/libs/amp/latest/techs/SmoothStreamingPlayer.xap"
</script>

Step 2: Add an HTML5 video tag to your page.

With Azure Media Player you can use an HTML5 video tag to embed a video. Azure Media Player will then read the tag and make it work in all browsers, not just ones that support HTML5 video. Beyond the basic markup, Azure Media Player needs a few extra pieces.

  1. The <data-setup> attribute on the <video> tells Azure Media Player to automatically set up the video when the page is ready, and read any options (in JSON format) from the attribute.
  2. The id attribute: Should be used and unique for every video on the same page.
  3. The class attribute contains two classes:
    • azuremediaplayer applies styles that are required for Azure Media Player UI functionality
    • amp-default-skin applies the default skin to the HTML5 controls
  4. The <source> includes two required attributes
    • src attribute can include a *.ism/manifest file from Azure Media Services is added, Azure Media Player automatically adds the URLs for DASH, SMOOTH and HLS to the player
    • type attribute is the required MIME type of the stream. The MIME type associated with ".ism/manifest" is "application/vnd.ms-sstr+xml"
  5. The optional <data-setup> attribute on the <source> tells Azure Media Player if there are any unique delivery policies for the stream from Azure Media Services, including, but not limited to, encryption type (AES or PlayReady, Widevine, or FairPlay) and token.

Include/exclude attributes, settings, sources, and tracks exactly as you would for HTML5 video.

<video id="vid1" class="azuremediaplayer amp-default-skin" autoplay controls width="640" height="400" poster="poster.jpg" data-setup='{"techOrder": ["azureHtml5JS", "flashSS", "html5FairPlayHLS","silverlightSS", "html5"], "nativeControlsForTouch": false}'>
    <source src="http://amssamples.streaming.mediaservices.windows.net/91492735-c523-432b-ba01-faba6c2206a2/AzureMediaServicesPromo.ism/manifest" type="application/vnd.ms-sstr+xml" />
    <p class="amp-no-js">
        To view this video please enable JavaScript, and consider upgrading to a web browser that supports HTML5 video
    </p>
</video>

By default, the big play button is located in the upper left hand corner so it doesn't cover up the interesting parts of the poster. If you'd prefer to center the big play button, you can add an additional amp-big-play-centered class to your <video> element.

Alternative Setup for Dynamically Loaded HTML

If your web page or application loads the video tag dynamically (ajax, appendChild, etc.), so that it may not exist when the page loads, you'll want to manually set up the player instead of relying on the data-setup attribute. To do this, first remove the data-setup attribute from the tag so there's no confusion around when the player is initialized. Next, run the following javascript some time after the Azure Media Player javascript has loaded, and after the video tag has been loaded into the DOM.

var myPlayer = amp('vid1', { /* Options */
        techOrder: ["azureHtml5JS", "flashSS", "html5FairPlayHLS","silverlightSS", "html5"],
        "nativeControlsForTouch": false,
        autoplay: false,
        controls: true,
        width: "640",
        height: "400",
        poster: ""
    }, function() {
          console.log('Good to go!');
           // add an event listener
          this.addEventListener('ended', function() {
            console.log('Finished!');
        }
      }
);
myPlayer.src([{ 
    src: "http://samplescdn.origin.mediaservices.windows.net/e0e820ec-f6a2-4ea2-afe3-1eed4e06ab2c/AzureMediaServices_Overview.ism/manifest", 
    type: "application/vnd.ms-sstr+xml"
}]);

The first argument in the amp function is the ID of your video tag. Replace it with your own.

The second argument is an options object. It allows you to set additional options like you can with the data-setup attribute.

The third argument is a 'ready' callback. Once Azure Media Player has initialized it will call this function. In the ready callback, 'this' object refers to the player instance.

Instead of using an element ID, you can also pass a reference to the element itself.

amp(document.getElementById('example_video_1'), {/*Options*/}, function() {
    //This is functionally the same as the previous example.
});
myPlayer.src([{ src: "//example/path/to/myVideo.ism/manifest", type: "application/vnd.ms-sstr+xml"]);

Protected Content

Azure Media Player currently supports AES-128 bit envelope encrypted content and common encrypted content (through PlayReady and Widevine) or encrypted content via FairPlay. In order to playback protected content correctly, you must tell Azure Media Player the protectionInfo. This information exists per source and can be added directly on the <source> tag via the data-setup. You can also add the protectionInfo directly as a parameter if setting the source dynamically.

protectionInfo accepts a JSON object and includes:

  • type: AES or PlayReady or Widevine or FairPlay
  • certificateUrl: this should be a direct link to your hosted FairPlay cert, IMPORTANT: this object is only needed for FairPlay DRM.
  • authenticationToken: this is an option field to add an unencoded authentication token

    Note: The default techOrder has been changed to accommodate the new tech- html5FairPlayHLS specifically to playback FairPlay content natively on browsers that support it (Safari on OSX 8+). If you have FairPlay content to playback AND you've changed the default techOrder to a custom one in your application, you will need to add this new tech into your techOrder object. We recommend you include it before silverlightSS so your content doesn't playback via PlayReady.

Ex:

<video id="vid1" class="azuremediaplayer amp-default-skin">
    <source 
        src="//example/path/to/myVideo.ism/manifest" 
        type="application/vnd.ms-sstr+xml" 
        data-setup='{"protectionInfo": [{"type": "AES", "authenticationToken": "Bearer=urn%3amicrosoft%3aazure%3amediaservices%3acontentkeyidentifier=8130520b-c116-45a9-824e-4a0082f3cb3c&Audience=urn%3atest&ExpiresOn=1450207516&Issuer=http%3a%2f%2ftestacs.com%2f&HMACSHA256=eV7HDgZ9msp9H9bnEPGN91sBdU7XsZ9OyB6VgFhKBAU%3d"}]}' 
    />
</video>

or

var myPlayer = amp("vid1", /* Options */);
myPlayer.src([{ 
    src: "//example/path/to/myVideo.ism/manifest", 
    type: "application/vnd.ms-sstr+xml", 
    protectionInfo: [{ 
        type: "PlayReady", 
        authenticationToken: "Bearer=urn%3amicrosoft%3aazure%3amediaservices%3acontentkeyidentifier=d5646e95-63ee-4fbe-ba4e-295c8d9502e0&Audience=urn%3atest&ExpiresOn=1450222961&Issuer=http%3a%2f%2ftestacs.com%2f&HMACSHA256=4Jop3kNJdzVI8L5IZLgFtPdImyE%2fHTRil0x%2bEikSdPs%3d" 
    }] }, ]
);

or, with multiple DRM

var myPlayer = amp("vid1", /* Options */);
myPlayer.src([{ 
    src: "//example/path/to/myVideo.ism/manifest", 
    type: "application/vnd.ms-sstr+xml", 
    protectionInfo: [{ 
            type: "PlayReady", 
            authenticationToken: "Bearer=urn%3amicrosoft%3aazure%3amediaservices%3acontentkeyidentifier=d5646e95-63ee-4fbe-ba4e-295c8d9502e0&Audience=urn%3atest&ExpiresOn=1450222961&Issuer=http%3a%2f%2ftestacs.com%2f&HMACSHA256=4Jop3kNJdzVI8L5IZLgFtPdImyE%2fHTRil0x%2bEikSdPs%3d" 
        },
        { 
            type: "Widevine", 
            authenticationToken: "Bearer=urn%3amicrosoft%3aazure%3amediaservices%3acontentkeyidentifier=d5646e95-63ee-4fbe-ba4e-295c8d9502e0&Audience=urn%3atest&ExpiresOn=1450222961&Issuer=http%3a%2f%2ftestacs.com%2f&HMACSHA256=4Jop3kNJdzVI8L5IZLgFtPdImyE%2fHTRil0x%2bEikSdPs%3d" 
        },
        {
               type: "FairPlay",
              certificateUrl: "//example/path/to/myFairplay.der",
               authenticationToken: "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1cm46bWljcm9zb2Z0OmF6dXJlOm1lZGlhc2VydmljZXM6Y29udGVudGtleWlkZW50aWZpZXIiOiIyMTI0M2Q2OC00Yjc4LTRlNzUtYTU5MS1jZWMzMDI0NDNhYWMiLCJpc3MiOiJodHRwOi8vY29udG9zbyIsImF1ZCI6InVybjp0ZXN0IiwiZXhwIjoxNDc0NTkyNDYzLCJuYmYiOjE0NzQ1ODg1NjN9.mE7UxgNhkieMMqtM_IiYQj-FK1KKIzB6lAptw4Mi67A"
    }] } ]
);

Note: Not all browsers/platforms are capable of playing back protected content. See the Playback Technology section for more information on what is supported.

IMPORTANT The token passed into the player is meant for secured content and only used for authenticated users. It is assumed that the application is using SSL or some other form of security measure. Also, the end user is assummed to be trusted to not misuse the token; if that is not the case, please involve your security experts.

URL Rewriter

By default, Azure Media Player will rewrite a given URL from Azure Media Services to provide streams for SMOOTH, DASH, HLS v3 and HLS v4. For example, if the source is given as follows, Azure Media Player will ensure that it attempts to play all of the above protocols:

<video id="vid1" class="azuremediaplayer amp-default-skin">
    <source src="//example/path/to/myVideo.ism/manifest" type="application/vnd.ms-sstr+xml" />
</video>

However, if you wish to not use the URL rewriter, you can do so by adding the disableUrlRewriter property to the parameter. This means all the information that are passed in to the sources, are directly passed to the player without modification. Here is an example of adding two sources to the player, on DASH and one SMOOTH Streaming.

<video id="vid1" class="azuremediaplayer amp-default-skin">
    <source src="//example/path/to/myVideo.ism/manifest(format=mpd-time-csf)" type="application/dash+xml" data-setup='{"disableUrlRewriter": true}'/>
    <source src="//example/path/to/myVideo.ism/manifest" type="application/vnd.ms-sstr+xml" data-setup='{"disableUrlRewriter": true}'/>
</video>

or

myPlayer.src([
    { src: "//example/path/to/myVideo.ism/manifest(format=mpd-time-csf)", type: "application/dash+xml", disableUrlRewriter: true }, 
    { src: "//example/path/to/myVideo.ism/manifest", type: "application/vnd.ms-sstr+xml", disableUrlRewriter: true }
]);

Also, if you want, you can specify the specific streaming formats you would like Azure Media Player to rewrite to using the streamingFormats parameter. Options include DASH, SMOOTH, HLSv3, HLSv4, HLS. The difference between HLS and HLSv3 & v4 is that the HLS format supports playback of FairPlay content. v3 and v4 do not support FairPlay. This is particularly useful if you do not have a delivery policy for a particular protocol available. Here is an example of when a DASH protocol is not enabled with your asset.

<video id="vid1" class="azuremediaplayer amp-default-skin">
    <source src="//example/path/to/myVideo.ism/manifest" type="application/vnd.ms-sstr+xml" data-setup='{"streamingFormats": ["SMOOTH", "HLS","HLS-V3", "HLS-V4"] }'/>
</video>

or

myPlayer.src([
    { src: "//example/path/to/myVideo.ism/manifest", type: "application/vnd.ms-sstr+xml", streamingFormats: ["SMOOTH", "HLS","HLS-V3", "HLS-V4"]}, 
]);

The above two can be used in combination with each other for multiple circumstances based on your particular asset.

Note: Widevine protection information only persists on the DASH protocol.


Options

Setting Options

The Azure Media Player embed code is simply an HTML5 video tag, so for many of the options you can use the standard tag attributes to set the options.

<video controls autoplay ...>

Alternatively, you can use the data-setup attribute to provide options in the JSON format. This is also how you would set options that aren't standard to the video tag.

<video data-setup='{ "controls": true, "autoplay": false }'...>

Finally, if you're not using the data-setup attribute to trigger the player setup, you can pass in an object with the player options as the second argument in the javascript setup function.

amp("vid1", { "controls": true, "autoplay": false });

Note: Options in the constructor are only set on the first initialization before the source is set. If you wish to modify the options on the same initialized Azure Media Player element, you must update the options before changing the source. You can update the options in JavaScript by using myPlayer.options({/*updated options*/});. Note that only changed options will be affected, all other previously set options will persist.

Individual Options

Note: Video Tag Attributes can only be true or false (boolean), you simply include the attribute (no equals sign) to turn it on, or exclude it to turn it off. For example, to turn controls on:

WRONG<video controls="true" ...>

RIGHT<video controls ...>

The biggest issue people run into is trying to set these values to false using false as the value (e.g. controls="false") which actually does the opposite and sets the value to true because the attribute is still included.

controls

The controls option sets whether or not the player has controls that the user can interact with. Without controls the only way to start the video playing is with the autoplay attribute or through the API.

<video controls ...> or { "controls": true }

autoplay

If autoplay is true, the video will start playing as soon as page is loaded (without any interaction from the user).

This option is not supported by mobile devices such as Windows Phone, Apple iOS and Android. Mobile devices block the autoplay functionality to prevent over usage of consumer's monthly data plans (often expensive). A user touch/click is required to start the video in this case. <video autoplay ...>or { "autoplay": true }

poster

The poster attribute sets the image that displays before the video begins playing. This is often a frame of the video or a custom title screen. As soon as the user clicks play the image will go away. <video poster="myPoster.jpg" ...> or { "poster": "myPoster.jpg" }

width

The width attribute sets the display width of the video. <video width="640" ...> or { "width": 640 }

height

The height attribute sets the display height of the video. <video height="480" ...> or { "height": 480 }

plugins

The plugins JSON determines which plugins get loaded with that instance of AMP lets you configure any options that plugin may have. <video... data-setup='{plugins: { "contentTitle": {"name": "Azure Medi Services Overview"}}}'...>
For more information on plugin development and usage, see plugins

other options

Other options can be set on the <video> tag by using the data-setup parameter which takes a JSON. <video ... data-setup='{"nativeControlsForTouch": false}'>

nativeControlsForTouch

This is explicitly set to false. By setting to false, it will allow the Azure Media Player skin to be rendered the same across platforms. Furthermore, contrary to the name, touch will still be enabled.


API

The Azure Media Player API allows you to interact with the video through JavaScript, whether the browser is playing the video through HTML5 video, Flash, Silverlight or any other supported playback technologies.

Referencing the Player

To use the API functions, you need access to the player object. Luckily this is easy to get. You just need to make sure your video tag has an ID. The example embed code has an ID of vid1. If you have multiple videos on one page, make sure every video tag has a unique ID.

var myPlayer = amp('vid1');

Note: If the player hasn't been initialized yet via the data-setup attribute or another method, this will also initialize the player.

Wait Until the Player is Ready

The time it takes Azure Media Player to set up the video and API will vary depending on the playback technology being used (HTML5 will often be much faster to load than Flash or Silverlight). For that reason, the player's 'ready' function should be used to trigger any code that requires the player's API.

amp("vid_1").ready(function(){
  var myPlayer = this;

  // EXAMPLE: Start playing the video.
  myPlayer.play();
});

OR var myPlayer = amp("vid_1", myOptions, function(){ //this is the ready function and will only execute after the player is loaded });

API Methods

Now that you have access to a ready player, you can control the video, get values, or respond to video events. The Azure Media Player API function names attempt to follow the HTML5 media API. The main difference is that getter/setter functions are used for video properties.

// setting a property on a bare HTML5 video element
myVideoElement.currentTime = 120;

// setting a property with Azure Media Player
myPlayer.currentTime(120);

Registering for Events

Events should be registered for directly after initializing the player for the first time to ensure all events are appropriately reported to the application. This should be done outside of the ready event.

var myPlayer = amp("vid_1", myOptions, function(){
    //this is the ready function and will only execute after the player is loaded
});
myPlayer.addEventListener(amp.eventName.error, _ampEventHandler);
//add other event listeners 

Error Codes

When playback can not start or has stopped, an error event will be fired and error() function will return a code and an optional message, which is to help the app developer get more details. error().message is not the message displayed to the user. The message displayed to the user is based on error().code bits 27-20, see table below.

var myPlayer = amp('vid1');
myPlayer.addEventListener('error', function() {
    var errorDetails = myPlayer.error();
    var code = errorDetails.code;
    var message = errorDetails.message;
}

Error Codes, Bits [31-28] (4 bits)

Describes what area the error is from.

  • 0 - Unknown
  • 1 - AMP
  • 2 - AzureHtml5JS
  • 3 - FlashSS
  • 4 - SilverlightSS
  • 5 - Html5

Error Codes, Bits [27-0] (28 bits)

Describes details of the error, bits 27-20 provide a high level, bits 19-0 provide s more detail if available

amp.errorCode.[name] Codes, Bits [27-0] (28 bits) Description
MEDIA_ERR_ABORTED errors range (0x0100000 - 0x01FFFFF)
abortedErrUnknown 0x0100000 Generic abort error
abortedErrNotImplemented 0x0100001 Abort error, not implemented
abortedErrHttpMixedContentBlocked 0x0100002 Abort error, mixed content blocked - generally occurs when loading an http:// stream from an https:// page
MEDIA_ERR_NETWORK errors start value (0x0200000 - 0x02FFFFF)
networkErrUnknown 0x0200000 Generic network error
networkErrHttpResponseBegin 0x0200190 Http error response start value
networkErrHttpBadUrlFormat 0x0200190 Http 400 error response
networkErrHttpUserAuthRequired 0x0200191 Http 401 error response
networkErrHttpUserForbidden 0x0200193 Http 403 error response
networkErrHttpUrlNotFound 0x0200194 Http 404 error response
networkErrHttpNotAllowed 0x0200195 Http 405 error response
networkErrHttpGone 0x020019A Http 410 error response
networkErrHttpPreconditionFailed 0x020019C Http 412 error response
networkErrHttpInternalServerFailure 0x02001F4 Http 500 error response
networkErrHttpBadGateway 0x02001F6 Http 502 error response
networkErrHttpServiceUnavailable 0x02001F7 Http 503 error response
networkErrHttpGatewayTimeout 0x02001F8 Http 504 error response
networkErrHttpResponseEnd 0x0200257 Http error response end value
networkErrTimeout 0x0200258 Network timeout error
MEDIA_ERR_DECODE errors (0x0300000 - 0x03FFFFF)
decodeErrUnknown 0x0300000 Generic decode error
MEDIA_ERR_SRC_NOT_SUPPORTED errors (0x0400000 - 0x04FFFFF)
srcErrUnknown 0x0400000 Generic source not supported error
srcErrParsePresentation 0x0400001 Presentation parse error
srcErrParseSegment 0x0400002 Segment parse error
srcErrUnsupportedPresentation 0x0400003 Presentation not supported
srcErrInvalidSegment 0x0400004 Invalid segment
MEDIA_ERR_ENCRYPTED errors start value(0x0500000 - 0x05FFFFF)
encryptErrUnknown 0x0500000 Generic encrypted error
encryptErrDecrypterNotFound 0x0500001 Decryptor not found
encryptErrDecrypterInit 0x0500002 Decryptor initialization error
encryptErrDecrypterNotSupported 0x0500003 Decryptor not supported
encryptErrKeyAcquire 0x0500004 Key acquire failed
encryptErrDecryption 0x0500005 Decryption of segment failed
encryptErrLicenseAcquire 0x0500006 License acquire failed
SRC_PLAYER_MISMATCH errors start value(0x0600000 - 0x06FFFFF)
srcPlayerMismatchUnknown 0x0600000 Generic no matching tech player to play the source
srcPlayerMismatchFlashNotInstalled 0x0600001 Flash plugin is not installed, if installed the source may play. Note: If 0x00600003, both Flash and Silverlight are not installed, if specified in the techOrder.
srcPlayerMismatchSilverlightNotInstalled 0x0600002 Silverlight plugin is not installed, if installed the source may play. Note: If 0x00600003, both Flash and Silverlight are not installed, if specified in the techOrder.
0x00600003 Both Flash and Silverlight are not installed, if specified in the techOrder.
Unknown errors (0x0FF00000)
errUnknown 0xFF00000 Unknown errors

User Error Messages

User message displayed is based on error code's bits 27-20.

  • MEDIA_ERR_ABORTED (1) -'You aborted the video playback'
  • MEDIA_ERR_NETWORK (2) - 'A network error caused the video download to fail part-way.'
  • MEDIA_ERR_DECODE (3) - 'The video playback was aborted due to a corruption problem or because the video used features your browser did not support.'
  • MEDIA_ERR_SRC_NOT_SUPPORTED (4)-'The video could not be loaded, either because the server or network failed or because the format is not supported.'
  • MEDIA_ERR_ENCRYPTED (5) - 'The video is encrypted and we do not have the keys to decrypt it.'
  • SRC_PLAYER_MISMATCH (6) - 'No compatible source was found for this video.'
  • MEDIA_ERR_UNKNOWN (0xFF) - 'An unknown error occurred'

Examples

0x10600001

No tech player that can play the requested sources, but if Flash plugin in is installed, it is likely that a source could be played. 'No compatible source was found for this video.' is displayed to the end user.

0x20200194

AzureHtml5JS failed to playback from a http 404 response. 'A network error caused the video download to fail part-way.' is displayed to the end user.

Categorizing errors

if(myPlayer.error().code & amp.errorCode.abortedErrStart) {
    // MEDIA_ERR_ABORTED errors
}
else if(myPlayer.error().code & amp.errorCode.networkErrStart) {
    // MEDIA_ERR_NETWORK errors
}
else if(myPlayer.error().code & amp.errorCode.decodeErrStart) {
    // MEDIA_ERR_DECODE errors
}
else if(myPlayer.error().code & amp.errorCode.srcErrStart) {
    // MEDIA_ERR_SRC_NOT_SUPPORTED errors
}
else if(myPlayer.error().code & amp.errorCode.encryptErrStart) {
    // MEDIA_ERR_ENCRYPTED errors
}
else if(myPlayer.error().code & amp.errorCode.srcPlayerMismatchStart) {
    // SRC_PLAYER_MISMATCH errors
}
else {
    // unknown errors
}

Catching a specific error

An example to catch just 404 errors would be as follows:

if(myPlayer.error().code & amp.errorCode.networkErrHttpUrlNotFound) {
    // all http 404 errors 
}

Plugins

A plugin is JavaScript written to extend or enhance the player. You can write plugins that change AMP's appearance, its functionality or even have it interface with other services. You can do this in two easy steps:

Step 1

Write your JavaScript in a function like so:

(function () {
    amp.plugin('yourPluginName', function (options) {
    var myPlayer = this;
       myPlayer.addEventListener(amp.eventName.ready, function () {
    console.log("player is ready!");
        });
    });
}).call(this); 

You can write your code directly in your HTML page within <script> tags or in an external JavaScript file. If you do the latter, be sure to include the JavaScript file in the <head> of your HTML page after the AMP script. Example:

  <!--*****START OF Azure Media Player Scripts*****-->
   <script src="//amp.azure.net/libs/amp/latest/azuremediaplayer.min.js"></script>
<link href="//amp.azure.net/libs/amp/latest/skins/amp-default/azuremediaplayer.min.css" rel="stylesheet">
<!--*****END OF Azure Media Player Scripts*****-->
<!--Add Plugins-->
<script src="yourPluginName.js"></script>

Step 2

Initialize the plugin with JavaScript in one of two ways:

Method 1:

var myOptions = {
    autoplay: true,
    controls: true,
    width: "640",
    height: "400",
    poster: "",
    plugins: {
        yourPluginName: {
            [your plugin options]: [example options]
       }
    }
};     
var myPlayer = amp([videotag id], myOptions);

Method 2:

var video = amp([videotag id]);
video.yourPluginName({[your plugins option]: [example option]});

Plugin options are not required, including them just allows the developers using your plugin to configure its behavior without having to change the source code.

For more information on creating a plugin take a look at our tutorial

Note Plugin code dynamically changes items in the DOM during the lifetime of the viewer's player experience, it never makes permanent changes to the player's source code. This is where an understanding of your browser's developer tools comes in handy. For example, if you'd like to change the appearance of an element in the player you can find its HTML element by its class name and then add or change attributes from there. Here's a great resource on changing HTML attributes.

Integrated Plugins

There are currently two plugins baked into AMP: the time-tip and hotkeys. These plugins were originally developed to be modular plugins for the player but are now included into the player source code.

The plugin gallery has several plugins that the community has already contributed for features like time-line markers, zoom, analytics and more. The page provides accesses to the plugins and instructions on how to set it up as well as a demo that shows the plugin in action. If you create a cool plugin that you think should be included in our gallery then feel free to submit it so we can check it out.


Localization

Multiple language support allows for users of non-English locales to natively interact with the player. Azure Media Player will instantiate with a global dictionary of languages, which will localize the error messages based on the page language. A developer can also create a player instance with a forced set language. The default language is English (en).

Note this feature is still going through some testing and as such is subject to bugs.

<video id="vid1" class="azuremediaplayer amp-default-skin" data-setup='{"language":"es"}'>...</video>

Azure Media Player currently supports the following languages with their corresponding language codes:

Language Code Language Code Language Code
English {default} en Croatian hr Romanian ro
Arabic ar Hungarian hu Slovak sk
Bulgarian bg Indonesian id Slovene sl
Catalan ca Icelandic is Serbian - Cyrillic sr-cyrl-cs
Czech cs Italian it Serbian - Latin sr-latn-rs
Danish da Japanese ja Russian ru
German de Kazakh kk Swedish sv
Greek el Korean ko Thai th
Spanish es Lithuanian lt Tagalog tl
Estonian et Latvian lv Turkish tr
Basque eu Malaysian ms Ukrainian uk
Farsi fa Norwegian - Bokmål nb Urdu ur
Finnish fi Dutch nl Vietnamese vi
French fr Norwegian- Nynorsk nn Chinese - simplified zh-hans
Galician gl Polish pl Chinese - traditional zh-hant
Hebrew he Portuguese - Brazil pt-br
Hindi hu Portuguese - Portugal pt-pt

Note: if you do not want any localization to occur you must force the language to English


Accessibility

Azure Media Player works with screen reader capabilities such as Windows Narrator and Apple OSX/iOS VoiceOver. Alternative tags are available for the UI buttons, and the screen reader is capable of reading these alternative tags when the user navigates to them. Additional configurations can be set at the Operating System level.

Captions and Subtitles

At this time, Azure Media Player currently supports captions for only On Demand events with WebVTT format. TTML format is currently unsupported. Live captioning is currently unsupported. Captions and subtitles allow the player to cater to and empower a broader audience, including people with hearing disabilities or those who want to read along in a different language. Captions also increase video engagement, improve comprehension, and make it possible to view the video in sound sensitive environments, like a workplace.

High Contrast Mode

The default UI in Azure Media Player is compliant with most device/browser high contrast view modes. Configurations can be set at the Operating System level.

Mobility Options

Tabbing Focus

Tabbing focus, provided by general HTML standards, is available in Azure Media Player. In order to enable tab focusing, you must add tabindex=0 (or another value if you understand how tab ordering is affected in HTML) to the HTML <video> like so: <video ... tabindex=0>...</video>. On some platforms, the focus for the controls may only be present if the controls are visible and if the platform supports these capabilities.

Once tabbing focus is enabled, the end user can effectively navigate and control the video player without depending on their mouse. Each context menu or controllable element can be navigated to by hitting the tab button and selected with enter or spacebar. Hitting the enter or spacebar on a context menu will expand it so the end user can continue tabbing through to select a menu item. Once you have context of the item you wish to select, hit enter or spacebar again to complete the selection.

Hot Keys

Azure Media Player supports controlling through keyboard hot key. In a web browser, the only way to control the underlying video element is by having focus on the player. Once there is focus on the player, hot key can control the player functionality. The table below describes the various hot keys and their associated behavior:

Hot key Behavior
F/f Player will enter/exit FullScreen mode
M/m Player volume will mute/unmute
Up and Down Arrow Player volume will increase/decrease
Left and Right Arrow Video progress will increase /decrease
0,1,2,3,4,5,6,7,8,9 Video progress will be changed to 0%- 90% depending on the key pressed
Click Action Video will play/pause

Playback Technology ("Tech")

Playback Technology refers to the specific browser or plugin technology used to play the video or audio.

  • azureHtml5JS: utilizes MSE and EME standards in conjunction with the video element for plugin-less based playback of DASH content with support for AES-128 bit envelope encrypted content or DRM common encrypted content (via PlayReady and Widevine when the browser support it) from Azure Media Services
  • flashSS: utilizes flash player technology to playback Smooth content with support for AES-128 bit envelope decryption from Azure Media Services - requires Flash version of 11.4 or higher
  • html5FairPlayHLS: utilizes Safari specific in browser based playback technology via HLS with the video element. This tech is requires to playback FairPlay protected content from Azure Media Services and was added to the techOrder as of 10/19/16
  • silverlightSS: utilizes silverlight technology to playback Smooth content with support for PlayReady protected content from Azure Media Services.
  • html5: utilizes in browser based playback technology with the video element. When on an Apple iOS or Android device, this tech allows playback of HLS streams with some basic support for AES-128 bit envelope encryption or DRM content (via FairPlay when the browser supports it).

Tech Order

In order to ensure that your asset is playable on a wide variety of devices, the following tech order is recommended and is the default if : techOrder: ["azureHtml5JS", "flashSS", "html5FairPlayHLS","silverlightSS", "html5"] and can be set directly on the <video> or programatically in the options:

<video data-setup='{"techOrder": ["azureHtml5JS", "flashSS", "html5FairPlayHLS, "silverlightSS", "html5"]}

or

amp("vid1", {
      techOrder: ["azureHtml5JS", "flashSS", "html5FairPlayHLS, "silverlightSS", "html5"]
});

Compatibility Matrix

Given the recommended tech order with streaming content from Azure Media Services, the following compatibility playback matrix is expected

Browser OSExpected Tech(Clear) Expected Tech(AES) Expected Tech (DRM)
Edge
IE 11
Windows 10
Windows 8.1
Windows Phone 101
azureHtml5JS azureHtml5JS azureHtml5JS (PlayReady)
IE 11
IE 9-101
Windows 7
Windows Vista1
flashSS flashSS silverlightSS (PlayReady)
IE 11 Windows Phone 8.1 azureHtml5JS azureHtml5JS not supported
Edge Xbox One1 (Nov 2015 update) azureHtml5JS azureHtml5JS not supported
Chrome 37+ Windows 10
Windows 8.1
Mac OS X Yosemite1
azureHtml5JS azureHtml5JS azureHtml5JS (Widevine)
Firefox 47+ Windows 10
Windows 8.1
Mac OS X Yosemite+1
azureHtml5JS azureHtml5JS azureHtml5JS (Widevine)
Firefox 42-46 Windows 10
Windows 8.1
Mac OS X Yosemite+1
azureHtml5JS azureHtml5JS silverlightSS (PlayReady)
Firefox 35-41 Windows 10
Windows 8.1
flashSS flashSS silverlightSS (PlayReady)
Safari iOS 6+ html5 html5 (no token)3 not supported
Safari 8+ OS X Yosemite+ azureHtml5JS azureHtml5JS html5FairPlayHLS(FairPlay)
Safari 6 OS X Mountain Lion1 flashSS flashSS silverlightSS (PlayReady)
Chrome 37+Android 4.4.4+2 azureHtml5JS azureHtml5JS azureHtml5JS (Widevine)
Chrome 37+ Android 4.02 html5 html5 (no token)3 not supported
Firefox 42 Android 5.0+2 azureHtml5JS azureHtml5JS not supported
IE 8 Windows not supported not supported not supported
Supported
Issues
Unsupported

1 Configuration not supported or tested; listed as reference for completion.

2 Successful playback on Android devices requires a combination of device capabilities, graphics support, codec rendering, OS support and more. Since Android is an open source platform which allows phone manufacturers to change the Vanilla Android OS provided by Google, this cause some fragmentation in the Android space, and some devices may not be supported because of lack of features. Also, some Android devices do not have support for all codecs.

3 In the cases where there is no support for token, a proxy can be used to add this functionality. Check out this blog to learn more about this solution.

Note: If the expected tech chosen requires a plugin be installed, like Flash, and that is not installed on the user's machine, AMP will continue to check the capabilities of the next tech, in conjunction with source types and protection info, in the tech list. For example, if attempting to view an unprotected on-demand stream in Safari 8 on OS X Yosemite, and both Flash and Silverlight are not installed, AMP will select the native Html5 tech for playback.

Note: New browser technologies are emerging daily, and as such could affect this matrix.

Index

Modules

Modules

amp

amp: amp

API of Azure Media Player (amp), use azuremediaplayer.d.ts if caller is using TypeScript.

Index

Call signatures

  • (id: any, options?: Options, ready?: Function): Object
  • The main function for users to create a player instance

    The amp function can be used to initialize or retrieve a player.

    Example:
     var myPlayer = amp('my_video_id');
                                                            

    Parameters

    • id: any

      Video element or video element ID string

    • options?: Options optional

      Optional options object for config/settings

    • ready?: Function optional

      Optional ready handler

    Returns Object

    Player instance

Modules

options

options: amp.options

SilverlightSS tech options

Index

Modules

azureHtml5JS

azureHtml5JS: azureHtml5JS

AzureHtml5JS tech options

Index

Variables

Variables

maxSkipSegments

maxSkipSegments: number

Number of segments to skip in case of http errors

flashSS

flashSS: flashSS

FlashSS tech options.

Index

Variables

Variables

plugin

plugin: string

Url to the AdaptiveStreaming plugin for OSMF.

swf

swf: string

Url to Strobe media player

silverlightSS

silverlightSS: silverlightSS

SilverlightSS tech options

Index

Variables

Variables

xap

xap: string

Url to the silverlight player

Interfaces

AudioStream

AudioStream: AudioStream

bitrate

bitrate: number

bitrate of audio stream

codec

codec: string

codec of audio stream

enabled

enabled: boolean

Whether this stream is enabled

language

language: string

Language of audio stream, specified in RFC 5646

name

name: string

name of audio stream

AudioStreamList

AudioStreamList: AudioStreamList

enabledIndices

enabledIndices: Array<number>

Audio stream that is currently enabled, currently only 1 stream can be enabled at a single time. Returns array of indices

streams

streams: AudioStream[]

Array of available audio streams

addEventListener

  • addEventListener(streamEventName: string, handler: Function)
  • Method to add a listener to an event

    Parameters

    • streamEventName: string

      string of event name, available events are defined in StreamEventName class

    • handler: Function

      handler that is called when event occurs

removeEventListener

  • removeEventListener(streamEventName: string, handler: Function)
  • Method to remove a listener from an event

    Parameters

    • streamEventName: string

      string of event name, available events are defined in StreamEventName class

    • handler: Function

      handler that should be removed

switchIndex

  • switchIndex(streamIndex: number)
  • Switch the audiostream currently playing (current implementation is exclusive)

    Parameters

    • streamIndex: number

      the index of the stream to switch to

BufferData

BufferData: BufferData

bufferLevel

bufferLevel: number

Buffer level in seconds

downloadCompleted

downloadCompleted: MediaDownloadCompleted

Returns the most recent download completed, evt: "downloadcompleted"

downloadFailed

downloadFailed: MediaDownloadFailed

Returns the most recent download failed, evt: "downloadfailed"

downloadRequested

downloadRequested: MediaDownload

Returns the most recent download requested, evt: "downloadrequested"

optional perceivedBandwidth

perceivedBandwidth?: number

Bandwidth used to make heuristic decision, available with amp.Player.videoBufferData only, in bps

addEventListener

  • addEventListener(eventName: string, handler: Function)
  • Method to add a listener to an event

    Parameters

    • eventName: string

      string of event name, available events are defined in BufferDataEventName class

    • handler: Function

      handler that is called when event occurs

removeEventListener

  • removeEventListener(eventName: string, handler: Function)
  • Method to remove a listener from an event

    Parameters

    • eventName: string

      string of event name, available events are defined in BufferDataEventName class

    • handler: Function

      handler that should be removed

MediaDownload

MediaDownload: MediaDownload

bitrate

bitrate: number

Returns the bitrate for this download, in bps

mediaTime

mediaTime: number

Returns the media time for this download in seconds, null, if initialization download

url

url: string

Returns the url for this download

MediaDownloadCompleted

MediaDownloadCompleted: MediaDownloadCompleted

measuredBandwidth

measuredBandwidth: number

Returns the measured bandwidth for this download, in bps

mediaDownload

mediaDownload: MediaDownload

Returns the media download information

totalBytes

totalBytes: number

Returns the total bytes for this download

totalDownloadMs

totalDownloadMs: number

Returns the total time to download, in ms

MediaDownloadFailed

MediaDownloadFailed: MediaDownloadFailed

code

code: number

Error code of the failure

mediaDownload

mediaDownload: MediaDownload

Returns the media download information

optional message

message?: string

Optional information on failure

MediaError

MediaError: MediaError

Custom MediaError to report why playback failed

code

code: number

Error codes (see [[amp.ErrorCode]]) Bits [31-28] - Tech Id

Unknown          = 0
                                                                            AMP              = 1
                                                                            AzureHtml5JS     = 2
                                                                            FlashSS          = 3
                                                                            SilverlightSS    = 4
                                                                            Html5            = 5
                                                                            .Html5FairPlayHLS = 6
                                                                            

Bits [27-20] - High level code

'MEDIA_ERR_CUSTOM'               = 0
                                                                            'MEDIA_ERR_ABORTED'              = 1
                                                                            'MEDIA_ERR_NETWORK'              = 2
                                                                            'MEDIA_ERR_DECODE'               = 3
                                                                            'MEDIA_ERR_SRC_NOT_SUPPORTED'    = 4
                                                                            'MEDIA_ERR_ENCRYPTED'            = 5
                                                                            'SRC_PLAYER_MISMATCH'            = 6
                                                                            'MEDIA_ERR_UNKNOWN'              = 0xFF
                                                                            

Bits [19-0] - More details of the error. See amp.errorCode.

message

message: string

Optional error with more details

Player

Player: Player

The Player instance for amp, for the caller to interact with.

AudioTracksMenu

AudioTracksMenu: AudioTracksMenu

Interface for the AudioTracksMenu of amp Controls for multi-audio scenarios. Ex: audioTracksMenu: { enabled: true, useManifestForLabel: false }

optional enabled

enabled?: boolean

Set if audiotracks menu should be displayed on the default skin. Default is true. Note if there is only 1 audiostream no audio selection menu will be shown.

optional useManifestForLabel

useManifestForLabel?: boolean

Set to turn off automatic label generation and use label from manifest. Default is false. When false, label shows language, bitrate and codec information if available and distinct When fields aren't available, stream will be called "Track {i}" When true, the label will use the audiostream name specified in the manifest

HotKeys

HotKeys: HotKeys

Interface for hot keys settings

optional enableFullscreen

enableFullscreen?: boolean

Flag to control whether switching to fullscreen is allowed

optional enableJogStyle

enableJogStyle?: boolean

Flag to control whether seeking forth/back by 1 sec with up/down arrows is allowed

optional enableMute

enableMute?: boolean

Flag to control whether muting is allowed

optional enableNumbers

enableNumbers?: boolean

Flag to control whether seeking to a percentage of a video by pressing number keys is allowed

optional seekStep

seekStep?: number

Seek step in seconds

optional volumeStep

volumeStep?: number

Volume change step

LogoConfig

LogoConfig: LogoConfig

Interface for the Logo of amp

optional enabled

enabled?: boolean

Set if logo is displayed. Default is true.

Options

Options: Options

Interface for the options of amp when it is created.

optional autoplay

autoplay?: boolean

Set the autoplay for the next playback.

optional controls

controls?: boolean

Set whether the controls should be displayed. Default is false.

optional customPlayerSettings

customPlayerSettings?: any

custom Player settings. this is a JSON object. Ex: options.customPlayerSettings = { "customHeuristicSettings": { "windowSizeHeuristics": false } }

optional heuristicProfile

heuristicProfile?: string

Heuristics profile Name

optional hotKeys

hotKeys?: HotKeys

Hot keys to control playback (volume, current time, toggle full screen)

optional logo

logo?: LogoConfig

Custom Player logo. Ex: logo: { enabled: true }

optional poster

poster?: string

Sets the image that displays before the video begins playing. Defaults to no poster displayed.

optional sdn

sdn?: SDN

Current SDN plugin

optional skinConfig

skinConfig?: SkinConfig

Skin configuration of amp

optional sourceList

sourceList?: Source[]

List of sources. SDN plugins can modify source URLs using this field. SDN plugin can modify source URLs only after it catches amp.eventName.sourceset event triggered by AMP.

optional techOrder

techOrder?: Array<string>

Tech order for the player to decide on which tech to use.

optional traceConfig

traceConfig?: TraceConfig

Set the configuration for the Tracing of amp

ProtectionInfo

ProtectionInfo: ProtectionInfo

Interface for protection information of the Source

optional authenticationToken

authenticationToken?: string

Authentication Token for the player.

optional certificateUrl

certificateUrl?: string

Certificate URL for Fairplay.

type

type: string

Protection type string. Use amp.protectionType for the list of protection types. ex: amp.protectionType.AES

SDN

SDN: SDN

Interface for SDN (Software-Defined Networking)

name

name: string

SkinConfig

SkinConfig: SkinConfig

Interface for the SkinConfig of amp

optional audioTracksMenu

audioTracksMenu?: AudioTracksMenu

Source

Source: Source

Source object to hold the source information in Options and amp.Player.src.

optional disableUrlRewriter

disableUrlRewriter?: boolean

Disable UrlRewiter and use the given sources. Default is false, to perform the url rewriting.

optional protectionInfo

protectionInfo?: ProtectionInfo[]

Array of ProtectionInfo for the source

src

src: string

Source Url

optional streamingFormats

streamingFormats?: Array<string>

Streaming formats for the UrlRewiter to expand the sources from Azure Media Services (ex: "SMOOTH", "DASH", "HLS-V3" and "HLS-V4"). Default is all the streaming formats supported by Azure Media Services.

type

type: string

Mime type (ex: "application/dash+xml", "video/mp4", "application/dash+xml", "application/vnd.apple.mpegurl").

TraceConfig

TraceConfig: TraceConfig

Interface for the Trace Configuration of amp

optional TraceTargets

TraceTargets?: TraceTarget[]

list of all the targets and its configuration for the Traces.

maxLogLevel

maxLogLevel: number

Set the trace level to log. Default value is 0. values: none = 0, error = 1, warning = 2, verbose = 3

TraceTarget

TraceTarget: TraceTarget

Target location and the configuration for the Traces.

optional maxMemoryTraceCount

maxMemoryTraceCount?: number

Max number of Traces. Only available for Memory Trace Target.

target

target: string

Target location for the Logs. Available targets are "console" or "memory"

Track

Track: Track

Track object to hold the text track information in amp.Player.src

kind

kind: string

Type or category of the timed text track. kind

label

label: string

Label attribute to create a user readable title for the track. label

src

src: string

The address or Url of the media resource. src

optional srclang

srclang?: string

The language of the text track data. srclang

HeuristicProfile

HeuristicProfile: HeuristicProfile

Heuristic profiles for amp

static HighQuality

HighQuality: string

Profile that tries to play highest quality possible. It builds the buffer to limit potential buffering. It does not take the width and height of the player into account when switching bitrates. For live streams this profile has a backoff from the live edge to avoid potential buffering.

static Hybrid

Hybrid: string

Profile that tries to balance quality and speed. It builds the buffer more than QuickStart but less than HighQuality. It takes the width and height of the player into account when switching bitrates. For live streams this profile tries to stay close to the live edge. This is the default profile.

static QuickStart

QuickStart: string

Profile that starts the playback as fast as possible. It also takes the width and height of the player into account when switching bitrates. For live streams this profile tries to stay close to the live edge.

addEventListener

  • addEventListener(eventName: string, handler: Function): Player
  • Add an event listener to this Player's element.

    Example:
        myPlayer.addEventListener('eventType', myFunc);
                                                                                

    Parameters

    • eventName: string

      The event type string. Use amp.eventName for the list of event types. ex: amp.eventName.playing

    • handler: Function

      Event handler.

    Returns Player

    The amp.Player calling this function.

audioBufferData

  • Gets the audio buffer information

    Returns BufferData

    ], undefined if not available

autoplay

  • autoplay(value: boolean): Player
  • autoplay(): boolean
  • Set/Get whether or not to autoplay on amp.Player.src.

    Parameters

    • value: boolean

      Whether to autoplay or not.

    Returns Player

    The amp.Player calling this function when setting, true/false when getting.

  • Returns boolean

buffered

  • buffered(): TimeRanges
  • Get a TimeRanges object with the times of the source that have been downloaded.

    Examples:
     var bufferedTimeRange = myPlayer.buffered();
                                                                                

    Number of different ranges of time have been buffered. Usually 1.

     var numberOfRanges = bufferedTimeRange.length;
                                                                                

    Time in seconds when the first range starts. Usually 0.

     var firstRangeStart = bufferedTimeRange.start(0);
                                                                                

    Time in seconds when the first range ends

     var firstRangeEnd = bufferedTimeRange.end(0);
                                                                                

    Length in seconds of the first time range var firstRangeLength = firstRangeEnd - firstRangeStart;

    Returns TimeRanges

    TimeRanges object following JS spec.

controls

  • controls(value: boolean): Player
  • controls(): boolean
  • Set/Get whether or not the controls are showing.

    Parameters

    • value: boolean

      Set controls to showing or not.

    Returns Player

    The amp.Player calling this function when setting, true/false when getting.

  • Returns boolean

currentAbsoluteTime

  • currentAbsoluteTime(): number
  • Gets the current absolute time, in seconds.

    Returns number

    absolute time in seconds, undefined if not available

currentAudioStreamList

  • Gets the current audio streams list.

    Returns AudioStreamList

    ], undefined if not available

currentDownloadBitrate

  • currentDownloadBitrate(): number
  • Gets the download bitrate.

    Returns number

    bitrate in bps, undefined if not available

currentHeuristicProfile

  • currentHeuristicProfile(value: string): Player
  • currentHeuristicProfile(): string
  • Set/Get the current HeuristicProfile

    Parameters

    • value: string

    Returns Player

  • Returns string

currentMediaTime

  • currentMediaTime(): number
  • Gets the current media time, in seconds.

    Returns number

    media time in seconds, undefined if not available

currentPlayableWindow

  • For live presentations, get the playable window start time (current absolute time - dvr window length) and end time in seconds. For VOD, returns undefined.

    Example: If the playable window is 2 hours and the stream has been going for 3 hours, the returned time range would be 01:00:00 - 03:00:00

    Returns TimeRange

    Playable window start and end in seconds

currentPlaybackBitrate

  • currentPlaybackBitrate(): number
  • Gets the playback bitrate.

    Returns number

    bitrate in bps, undefined if not available

currentPlayerSettingValue

  • currentPlayerSettingValue(key: string): any
  • Get the current Player settings for the given key

    Parameters

    • key: string

    Returns any

currentProtectionInfo

  • Get the protectionInfo for the current source.

    Returns ProtectionInfo

    Protection information of the current source.

currentSrc

  • currentSrc(): string
  • Get the fully qualified URL of the current source value e.g. http://mysite.com/video.mp4. Can be used in conjuction with amp.Player.currentType to assist in rebuilding the current source object.

    Returns string

    Current source.

currentTechName

  • currentTechName(): string
  • Get the current name of the chosen tech.

    Returns string

    Name of tech(in Pascal case).

currentTime

  • currentTime(seconds: number): Player
  • currentTime(): number
  • Set the current time.

    Example of setting:
    myPlayer.currentTime(120); // 2 minutes into the video
                                                                                
    Example of getting:
    var whereYouAt = myPlayer.currentTime();
                                                                                

    Parameters

    • seconds: number

      Time to seek to, in seconds.

    Returns Player

    The amp.Player calling this function when setting, time in seconds when getting.

  • Returns number

currentType

  • currentType(): string
  • Get the current source type e.g. video/mp4. This can allow you rebuild the current source object so that you could load the same source and tech later.

    Returns string

    MIME type of the current source.

currentVideoStreamList

  • Gets the current video streams list.

    Returns VideoStreamList

    ], undefined if not available

dispose

  • dispose()
  • Destroys the amp.Player and does any necessary cleanup.

    Example:
    myPlayer.dispose();
                                                                                

    This is especially helpful if you are dynamically adding and removing videos to/from the DOM. The orignial videoTag created by the app is also deleted as part of this dispose.

duration

  • duration(): number
  • Get the length in time of the source. For live, it is the playable window.

    Example:
    var lengthOfSource = myPlayer.duration();
                                                                                

    NOTE: The source must have started loading before the duration can be known, and in the case of Flash, may not be known until the video starts playing.

    Returns number

    Duration of the source, in seconds.

ended

  • ended(): boolean
  • Get whether or not the player is in the "ended" state.

    Returns boolean

    True if the player is in the ended state, false if not.

enterFullscreen

  • Increase the size of the video to full screen.

    Example:
    myPlayer.enterFullscreen();
                                                                                

    In some browsers, full screen is not supported natively, so it enters "full window mode", where the video fills the browser window. In browsers and devices that support native full screen, sometimes the browser's default controls will be shown, and not the amp custom skin. This includes most mobile devices (iOS, Android) and older versions of Safari.

    Returns Player

    The amp.Player calling this function.

error

  • Get the current error.

    Returns MediaError

    Media error

exitFullscreen

  • Get the video to its normal size after having been in full screen mode.

    Example:
    myPlayer.exitFullscreen();
                                                                                

    Returns Player

    The amp.Player calling this function.

fromPresentationTime

  • fromPresentationTime(time: number): number
  • Used in live playback calculations. Given an absolute time, returns the associated time from the current playable window. If the given absolute time falls outside of the current playable window, returns the difference between the playable window edge and the given absolute time.

    Example: If the playable window is 2 hours and the stream has been going for 3 hours, if you pass the absolute time of 01:00:00 (1 hour), the returned playable window time would be 00:00:00.

    Parameters

    • time: number

    Returns number

    the player time in seconds

getAmpVersion

  • getAmpVersion(): string
  • Get the version of AMP player in the format

    ...

    Returns string

    Released AMP player version string.

getMemoryLog

  • getMemoryLog(flush: boolean): string
  • Get the Log traces from the player, if memoryLog is enabled.

    Parameters

    • flush: boolean

      flush memoryLog after returning the log.

    Returns string

    Log trace string from the player.

height

  • height(): Object
  • height(value: Object): Player
  • Set/Get height of the component (CSS values).

    Setting the video tag dimension values works with values in pixels, % or 'auto'.

    Returns Object

    The amp.Player calling this function when setting, pixels when getting.

  • Parameters

    • value: Object

    Returns Player

isFullscreen

  • isFullscreen(): boolean
  • Check if the player is in fullscreen mode.

    Example:
    var isFullscreen = myPlayer.isFullscreen();
                                                                                

    Returns boolean

    True if fullscreen, false if not.

isLive

  • isLive(): boolean
  • Get whether or not the presentation is live.

    Returns boolean

    true if the presentation is live, false if not.

manifestPlayableWindowLength

  • manifestPlayableWindowLength(): number
  • Get the playable window length in seconds from the manifest

    Returns number

    Playable window length in seconds from the manifest or undefined if not present in the tech

muted

  • muted(value: boolean): Player
  • muted(): boolean
  • Set/Get muted state.

    Example of setting:
    myPlayer.muted(true); // mute the volume
                                                                                

    Parameters

    • value: boolean

      True to mute, false to unmute.

    Returns Player

    The amp.Player calling this function when setting, current mute state when getting.

  • Returns boolean

options

  • Gets/Sets the player level options to add new options or override the given options if has already been set.

    Parameters

    • options: Options

      Object of new option values

    Returns Options

    New object of this.options_ and options merged

  • Returns Options

pause

  • Pauses the video playback.

    myPlayer.pause();
                                                                                

    Returns Player

    The amp.Player calling this function.

paused

  • paused(): boolean
  • Get whether or not the player is in the "paused" state.

    var isPaused = myPlayer.paused();
                                                                                

    Returns boolean

    True if the player is in the paused state, false if not.

play

  • Starts media playback.

    myPlayer.play();
                                                                                

    Returns Player

    The amp.Player calling this function.

playerElement

  • playerElement(): HTMLVideoElement
  • Get the el_ of AMP player

    Returns HTMLVideoElement

    the el_ from the underlying player.

poster

  • poster(src: string): Player
  • poster(): string
  • Set/Get the poster image source url.

    Example of setting:
    myPlayer.poster('http://example.com/myImage.jpg');
                                                                                
    Example of getting:
    var currentPoster = myPlayer.poster();
                                                                                

    Parameters

    • src: string

      Poster image source URL when setting.

    Returns Player

    The amp.Player calling this function when setting, posterURL when getting.

  • Returns string

ready

  • ready(handler: Function): Player
  • Bind a listener to the Player's ready state.

    Different from event listeners in that if the ready event has already happened it will trigger the function immediately.

    Parameters

    • handler: Function

      Ready handler

    Returns Player

    The amp.Player calling this function.

removeEventListener

  • removeEventListener(eventName: string, handler?: Function): Player
  • Remove an event listener from this Player's element.

    Example:
    myPlayer.removeEventListener('eventType', myFunc);
                                                                                

    If myFunc is excluded, all listeners for the event type will be removed. If eventType is excluded, all listeners will be removed from the component.

    Parameters

    • eventName: string

      The event type string. Use amp.eventName for the list of event types. ex: amp.eventName.playing

    • handler?: Function optional

      Event handler.

    Returns Player

    The amp.Player calling this function.

seeking

  • seeking(): boolean
  • Get whether or not the player is in the "seeking" state.

    Returns boolean

    True if the player is in the seeking state, false if not.

segmentBoundaries

  • segmentBoundaries(): Array<number>
  • Get an array of the calculated segment boundary start times in seconds.

    Returns Array<number>

    Calculated segment boundaries

setXmlHttpRequestFactory

  • Set a factory to allow custom XMLHttpRequest creation logic.

    Parameters

src

  • Sets a single source to play. Use this method if you know the type of the source and only have one source.

    myPlayer.src({ type: "video/mp4", src: "http://www.example.com/path/to/video.mp4" },

    ~~~
                                                                                [{ kind: "captions" src: "http://example.com/path/to/track.vtt" srclang: "fr" label: "French"}]);
                                                                                

    ~~~

    parm

    optional parameter, array of the text tracks to used with the given source.

    Parameters

    • newSource: Source

      Source object

    • tracks?: Track[] optional

    Returns Player

    The amp.Player calling this function.

  • Sets multiple versions of the source to play so that it can be played using techs across browsers.

    myPlayer.src([
                                                                                
    { type: "application/dash+xml", src: "http://www.example.com/path/to/video.ism(format=mpd-csf-time)" },
                                                                                
    { type: "application/dash+xml", src: "http://www.example.com/path/to/video.ism(format=mpd-time-csf)", protectionInfo: [{type: "AES", authenticationToken:"token"}] },
                                                                                
    { type: "application/dash+xml", src: "http://www.example.com/path/to/video.ism(format=mpd-time-csf)", disableUrlRewriter: true },
                                                                                
    { type: "application/dash+xml", src: "http://www.example.com/path/to/video.ism(format=mpd-time-csf)", streamingFormats: ["SMOOTH", "DASH"] },
                                                                                
    { type: "video/ogg", src: "http://www.example.com/path/to/video.ogv" }],
                                                                                
    [{ kind: "captions" src: "http://example.com/path/to/track.vtt" srclang: "fr" label: "French"}]
                                                                                

    ~~ ); ~~~

    parm

    optional parameter, array of the text tracks to used with the given source.

    Parameters

    • newSources: Source[]

      Array of sources

    • textTracks?: Track[] optional

    Returns Player

    The amp.Player calling this function.

toPresentationTime

  • toPresentationTime(time: number): number
  • Used in live playback calculations. Given a time from the current playable window, returns the associated absolute time.

    Example: If the playable window is 2 hours and the stream has been going for 3 hours, if you pass the playable window time of 00:00:00, the returned absolute time would be 01:00:00 (1 hour).

    Parameters

    • time: number

    Returns number

    the presentation time in seconds

videoBufferData

  • Gets the video buffer information

    Returns BufferData

    ], undefined if not available

videoHeight

  • videoHeight(): number
  • Get the videoHeight of the player.

    Returns number

    Video height of the player.

videoWidth

  • videoWidth(): number
  • Get the videoWidth of the player.

    Returns number

    Video width of the player.

volume

  • volume(percentAsDecimal: number): Player
  • volume(): number
  • Set/Get volume of the source.

    Example:
    myPlayer.volume(0.5); // Set volume to half
                                                                                

    0 is off (muted), 1.0 is all the way up, 0.5 is half way.

    Parameters

    • percentAsDecimal: number

      New volume as a decimal (0 to 1.0).

    Returns Player

    The amp.Player calling this function when setting, current volume when getting.

  • Returns number

width

  • width(): Object
  • width(value: Object): Player
  • Set/Get width of the component (CSS values).

    Setting the video tag dimension values works with values in pixels, % or 'auto'.

    Returns Object

    The amp.Player calling this function when setting, pixels when getting.

  • Parameters

    • value: Object

    Returns Player

TimeRange

TimeRange: TimeRange

Interface describing a time range

endInSec

endInSec: number

startInSec

startInSec: number

VideoStream

VideoStream: VideoStream

Video stream properties and functions

codec

codec: string

codec of video stream

name

name: string

Name of video stream

tracks

tracks: VideoTrack[]

Array of video tracks

addEventListener

  • addEventListener(streamEventName: string, handler: Function)
  • Method to add a listener to an event

    Parameters

    • streamEventName: string

      string of event name, available events are defined in amp.streamEventName

    • handler: Function

      handler that is called when event occurs

removeEventListener

  • removeEventListener(streamEventName: string, handler: Function)
  • Method to remove a listener from an event

    Parameters

    • streamEventName: string

      string of event name, available events are defined in amp.streamEventName

    • handler: Function

      handler that should be removed

selectTrackByIndex

  • selectTrackByIndex(index: number)
  • Select single track playback by tracks index. When selection has been honored, "changed" event will fire.

    Parameters

    • index: number

      Index from tracks. If -1, enable auto switching heuristics.

VideoStreamList

VideoStreamList: VideoStreamList

Video stream list, returned from amp.Player.currentVideoStreamList

selectedIndex

selectedIndex: number

Video stream that is currently selected, for multi video streams, only 1 stream can be selected

streams

streams: VideoStream[]

Array of available video streams

VideoTrack

VideoTrack: VideoTrack

Video track properties and functions

bitrate

bitrate: number

Returns the bitrate of the track in bits per second

optional height

height?: number

Returns the height of the track

selectable

selectable: boolean

Returns whether the track is currently selectable for download

optional width

width?: number

Returns the width of the track

XMLHttpRequestFactory

XMLHttpRequestFactory: XMLHttpRequestFactory

Interface describing factory method for creation of XmlHttpRequestWrapper.

XMLHttpRequestWrapper

XMLHttpRequestWrapper: XMLHttpRequestWrapper

Interface describing a HttpRequest.

see

XMLHttpRequest

msCaching

msCaching: string

onabort

onabort: Function

onabort function signature

  • (ev: Event): any
  • Parameters

    • ev: Event

    Returns any

onerror

onerror: Function

onerror function signature

  • (ev: Event): any
  • Parameters

    • ev: Event

    Returns any

onload

onload: Function

onload function signature

  • (ev: Event): any
  • Parameters

    • ev: Event

    Returns any

onloadend

onloadend: Function

onloadend function signature

  • (ev: ProgressEvent): any
  • Parameters

    • ev: ProgressEvent

    Returns any

onloadstart

onloadstart: Function

onloadstart function signature

  • (ev: Event): any
  • Parameters

    • ev: Event

    Returns any

onprogress

onprogress: Function

onprogress function signature

  • (ev: ProgressEvent): any
  • Parameters

    • ev: ProgressEvent

    Returns any

onreadystatechange

onreadystatechange: Function

onreadystatechange function signature

  • (ev: ProgressEvent): any
  • Parameters

    • ev: ProgressEvent

    Returns any

ontimeout

ontimeout: Function

ontimeout function signature

  • (ev: ProgressEvent): any
  • Parameters

    • ev: ProgressEvent

    Returns any

readyState

readyState: number

response

response: any

responseType

responseType: string

status

status: number

statusText

statusText: string

timeout

timeout: number

abort

  • abort()

getResponseHeader

  • getResponseHeader(header: string): string
  • Parameters

    • header: string

    Returns string

open

  • open(method: string, url: string, async?: boolean, user?: string, password?: string)
  • Parameters

    • method: string
    • url: string
    • async?: boolean optional
    • user?: string optional
    • password?: string optional

send

  • send(data?: any): any
  • Parameters

    • data?: any optional

    Returns any

setRequestHeader

  • setRequestHeader(header: string, value: string)
  • Parameters

    • header: string
    • value: string

Classes

bufferDataEventName

bufferDataEventName: bufferDataEventName

static downloadcompleted

downloadcompleted: string

Download of media has been completed from amp.Player.videoBufferData or amp.Player.audioBufferData

static downloadfailed

downloadfailed: string

Download of media has failed from amp.Player.videoBufferData or amp.Player.audioBufferData

static downloadrequested

downloadrequested: string

Download of media has been requested from amp.Player.videoBufferData or amp.Player.audioBufferData

errorCode

errorCode: errorCode

Error codes for amp.MediaError.code for bits 27-0.

static abortedErrEnd

abortedErrEnd: number

MEDIA_ERR_ABORTED errors end value (0x001FFFFF).

static abortedErrHttpMixedContentBlocked

abortedErrHttpMixedContentBlocked: number

The page is loaded over HTTPS, but the source is set to serve over HTTP. The content must be served over HTTPS when the page is loaded over HTTPS (0x00100002).

static abortedErrNotImplemented

abortedErrNotImplemented: number

Abort error, not implemented (0x00100001).

static abortedErrStart

abortedErrStart: number

MEDIA_ERR_ABORTED errors start value (0x00100000).

static abortedErrUnknown

abortedErrUnknown: number

Generic abort error (0x00100000).

static decodeErrEnd

decodeErrEnd: number

MEDIA_ERR_DECODE errors end value (0x003FFFFF).

static decodeErrStart

decodeErrStart: number

MEDIA_ERR_DECODE errors start value (0x00300000).

static decodeErrUnknown

decodeErrUnknown: number

Generic decode error (0x00300000).

static encryptErrCertAcquire

encryptErrCertAcquire: number

Certificate fetch failed (0x00500007).

static encryptErrDecrypterInit

encryptErrDecrypterInit: number

Decryptor initialization error (0x00500002).

static encryptErrDecrypterNotFound

encryptErrDecrypterNotFound: number

Decryptor not found (0x00500001).

static encryptErrDecrypterNotSupported

encryptErrDecrypterNotSupported: number

Decryptor not supported (0x00500003).

static encryptErrDecryption

encryptErrDecryption: number

Decryption of segment failed (0x00500005).

static encryptErrEnd

encryptErrEnd: number

MEDIA_ERR_ENCRYPTED errors end value (0x005FFFFF).

static encryptErrKeyAcquire

encryptErrKeyAcquire: number

Key acquire failed (0x00500004).

static encryptErrLicenseAcquire

encryptErrLicenseAcquire: number

License acquire failed (0x00500006).

static encryptErrStart

encryptErrStart: number

MEDIA_ERR_ENCRYPTED errors start value (0x00500000).

static encryptErrUnknown

encryptErrUnknown: number

Generic encrypted error (0x00500000).

static errUnknown

errUnknown: number

Unknown errors (0x0FF00000).

static networkErrEnd

networkErrEnd: number

MEDIA_ERR_NETWORK errors end value (0x002FFFFF).

static networkErrHttpBadGateway

networkErrHttpBadGateway: number

Http 502 error response (0x002001F6).

static networkErrHttpBadUrlFormat

networkErrHttpBadUrlFormat: number

Http 400 error response (0x00200190).

static networkErrHttpGatewayTimeout

networkErrHttpGatewayTimeout: number

Http 504 error response (0x002001F8).

static networkErrHttpGone

networkErrHttpGone: number

Http 410 error response (0x0020019A).

static networkErrHttpInternalServerFailure

networkErrHttpInternalServerFailure: number

Http 500 error response (0x002001F4).

static networkErrHttpNotAllowed

networkErrHttpNotAllowed: number

Http 405 error response (0x00200195).

static networkErrHttpPreconditionFailed

networkErrHttpPreconditionFailed: number

Http 412 error response (0x0020019C).

static networkErrHttpResponseBegin

networkErrHttpResponseBegin: number

Http error response start value (0x00200190).

static networkErrHttpResponseEnd

networkErrHttpResponseEnd: number

Http error response end value (0x00200257).

static networkErrHttpServiceUnavailable

networkErrHttpServiceUnavailable: number

Http 503 error response (0x002001F7).

static networkErrHttpUrlNotFound

networkErrHttpUrlNotFound: number

Http 404 error response (0x00200194).

static networkErrHttpUserAuthRequired

networkErrHttpUserAuthRequired: number

Http 401 error response (0x00200191).

static networkErrHttpUserForbidden

networkErrHttpUserForbidden: number

Http 403 error response (0x00200193).

static networkErrStart

networkErrStart: number

MEDIA_ERR_NETWORK errors start value (0x00200000).

static networkErrTimeout

networkErrTimeout: number

Network timeout error (0x00200258).

static networkErrUnknown

networkErrUnknown: number

Generic network error (0x00200000).

static srcErrEnd

srcErrEnd: number

MEDIA_ERR_SRC_NOT_SUPPORTED errors end value (0x004FFFFF).

static srcErrInvalidSegment

srcErrInvalidSegment: number

Invalid segment (0x00400004).

static srcErrParsePresentation

srcErrParsePresentation: number

Presentation parse error (0x00400001).

static srcErrParseSegment

srcErrParseSegment: number

Segment parse error (0x00400002).

static srcErrStart

srcErrStart: number

MEDIA_ERR_SRC_NOT_SUPPORTED errors start value (0x00400000).

static srcErrUnknown

srcErrUnknown: number

Generic source not supported error (0x00400000).

static srcErrUnsupportedPresentation

srcErrUnsupportedPresentation: number

Presentation not supported (0x00400003).

static srcPlayerMismatchEnd

srcPlayerMismatchEnd: number

SRC_PLAYER_MISMATCH errors end value (0x006FFFFF).

static srcPlayerMismatchFlashNotInstalled

srcPlayerMismatchFlashNotInstalled: number

Flash plugin is not installed, if installed the source may play (0x00600001). Note: If 0x00600003, both Flash and Silverlight are not installed.

static srcPlayerMismatchSilverlightNotInstalled

srcPlayerMismatchSilverlightNotInstalled: number

Silverlight plugin is not installed, if installed the source may play (0x00600002). Note: If 0x00600003, both Flash and Silverlight are not installed.

static srcPlayerMismatchStart

srcPlayerMismatchStart: number

SRC_PLAYER_MISMATCH errors start value (0x00600000).

static srcPlayerMismatchUnknown

srcPlayerMismatchUnknown: number

Generic source and tech player error (0x00600000).

eventName

eventName: eventName

Event types from amp

static canplaythrough

canplaythrough: string

Buffer has met pre-roll level. Note: There are some variation across techs. On Html5 tech, this event is only raised for the first set source, if source is set again on the same player, this event will not occur again.

static disposing

disposing: string

amp.Player.dispose was called.

static downloadbitratechanged

downloadbitratechanged: string

amp.Player.currentDownloadBitrate property has changed.

static durationchange

durationchange: string

amp.Player.duration property has changed.

static ended

ended: string

amp.Player.ended property has changed.

static error

error: string

Error occurred, playback will stop, check amp.Player.error property.

static fullscreenchange

fullscreenchange: string

amp.Player.isFullscreen property has changed.

static loadeddata

loadeddata: string

Media data has been rendered for the first time.

static loadedmetadata

loadedmetadata: string

static loadstart

loadstart: string

Playback is looking for media data.

static pause

pause: string

Playback has paused, check amp.Player.paused property.

static play

play: string

Play function has begun.

static playbackbitratechanged

playbackbitratechanged: string

amp.Player.currentPlaybackBitrate property has changed.

static playing

playing: string

Play function has completed, check amp.Player.paused property.

static seeked

seeked: string

Seek has complete, check amp.Player.seeking property.

static seeking

seeking: string

Seek has begun.

static sourceset

sourceset: string

App has set the source. SDN plugins should wait for this event before modifying amp.Player.Options.sourceList.

static timeupdate

timeupdate: string

amp.Player.currentTime property has changed.

static volumechange

volumechange: string

amp.Player.volume property has changed.

static waiting

waiting: string

Playback has been paused to build a low buffer.

protectionType

protectionType: protectionType

Protection types for amp

static AES

AES: string

Source is AES envelope encrypted.

static PlayReady

PlayReady: string

Source is PlayReady encrypted.

static Widevine

Widevine: string

Source is Widevine encrypted.

streamEventName

streamEventName: streamEventName

Stream Event types from amp.Player.currentVideoStreamList

static trackselected

trackselected: string

Track has been selected in amp.Player.currentVideoStreamList

streamListEventName

streamListEventName: streamListEventName

Stream Event types from amp.Player.currentAudioStreamList

static streamindexinvalid

streamindexinvalid: string

Index chosen did not exist in the list of audio streams in amp.Player.currentAudioStreamList

static streamselected

streamselected: string

Stream has been selected in amp.Player.currentAudioStreamList

static streamselectnotsupported

streamselectnotsupported: string

Currently, stream selection is only supported when single stream is enabled in amp.Player.currentAudioStreamList

Functions

plugin

  • plugin(name: string, init: Object)
  • Function to register plugins

    Parameters

    • name: string
    • init: Object