AMP - Player Mode & Stream selection

Document created by Herberth Alvarado Champion on Apr 8, 2016Last modified by Herberth Alvarado Champion on Apr 7, 2017
Version 17Show Document
  • View in full screen mode

Maintainer: Herberth Alvarado

This document is part of Adaptive Media Player Web User Guide

 

With Akamai AMP is possible to force how streams are played using the "mode" option.

 

To override the automatic mode selection, please use the following option in the config override:

  • mode: “auto” to allow it to select according to browser capabilities
    • Flash as first option
  • mode: "flash" to force flash.
  • mode: “html” to force HTML5 mode.
  • mode: "html-auto" available since version 38, it forces HTML5 mode if browser supports MSE (Media Source Extensions - Wikipedia, the free encyclopedia  ) in order to allow HLS playback, if not it will try the other modes.
    • HTML5 as first option

    • Default option

 

Sample:

<script type="text/javascript">
   var amp;

   function loadHandler(event) {
   var config = {
         autoplay : false,
         media : {
         title : "MPEG DASH Sample",
         poster : '../resources/images/space_alone.jpg',
         src : "http://dash.edgesuite.net/.............../manifest.mpd",
         type : "application/dash+xml"
      },
      mode : "html"
   };

 

   amp = akamai.amp.AMP.create("akamai-media-player", config);
   }
</script>

Or add amp-mode=<value> in the query string.

Once the player selects a mode, it will try to play the streams listed in the source and the 1st stream that it can will be played. This can be overridden by defining rules.

 

HTML mode sample: AMP Premier - Samples - MPEG DASH 

 

Notes:

We haven’t defaulted our HLS plugin to be “on” always, so to have a best HTML5-first mode with HLS playback across browsers, enable the HLS plugin. You can find how to do it in this sample: AMP Premier - Samples - HLS 

 

With both options enabled you will get HTML5 first (Flash will only show up on IE8,9,10 and FF 41 and below) and HLS playback. You can have HDS then HLS and HTML5 mode will pick it’s first compatible format from top to bottom, skipping HDS when not in Flash.

 

 

Two strong reminders:

  1. You need to add an MP4 as the third element in your JSON as fallback, just in case.
  2. Please consider using pre-packaging from our Transcoding rather than dynamic to minimize delays.

 

 

 

This document is part of Adaptive Media Player Web User Guide

1 person found this helpful

Attachments

    Outcomes