AMP - Configuration

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

Maintainer: Marco Castiglioni

This document is part of Adaptive Media Player Web User Guide

Overview

AMP does require configuration, and this can be done in the html itself with a JSON structure (see config overrides var in Fig. 1 “Simple.html” or in the samples distributed with the player). AMP does have default values in amp.js, but your configuration will override those values when the AMP is created, see the following line:

 

Basic Setup

var config = {

autoplay : [true|false],

volumepanel : {

direction : "vertical"

  },

  media : {

  title : "your title",

  poster : "path_to_the_poster_image",

  duration : 108,

  source : [{

  src : "path_to_the_manifest.f4m",

  type : "video/f4m"

  }, {

  src : "path_to_the_master.m3u8",

  type : "application/x-mpegURL"

  },{

  src : "path_to_the_master.m3u8",

  type : "video/mp4"

}]

  }

  };

 

amp = akamai.amp.AMP.create("akamai-media-player", config);

 

In this line, “config” var is passed from the very beginning of the execution of the AMP, so this structure is mandatory.

You can play with the different options AMP provides at the “Support Player” page, locally or in our site:

Local Host:

http://YOURHOST/YOURDIRECTORY/support/

Or in Akamai AMP pages

AMP - Support 

 

The AMP Support page has many options to test your needs in a quick manner, for example you can test Captions, Analytics, and others. A full description of the tool can be found ahead in this document.

Alternative Config Source

Optionally, configuration may be placed in a JSON file entirely separated from the html. In this case, feel free to send us an email to give you guidance on how to achieve it.

Basics

Feature: Playback: Startup Media Item

The initial content stream can be can be set in the media section, in the configuration, to be precise in media->source->src. Below you can see an example, and you can find more examples in the files delivered to you with the AMP.

 

IMPORTANT: See also API section for amp.feed.setURL() or amp.setMedia() setting subsequent content in the same player instance.

Sample: samples/index.html

Feature: Playback: Autoplay

If autoplay is true, the content will start automatically upon player start and upon setting of new media into the player. If autoplay is false, the poster (static image specified in the configuration) is displayed with an optional play button overlay.

 

Config var autoplay value
'autoplay":true/false,

 

Sample: samples/index.html

Note: For mobile devices, a user click is needed for the first item, but subsequent playback will autoplay and honor this setting.

Note: See also amp.setAutoplay() and amp.getAutoplay() for dynamic changes to this setting.

Feature: Playback: Flash Playback Params (various)

The following Flash-specific settings are available in amp/amp.js or amp.premier/amp.premier.js

  1. mbr_starting_index: Force a starting index for multibitrate content. Bitrates start at index 0 from lowest to highest. For HDN1 content, if this is not specified, the highest bitrate under 500kbps will be selected for start. For HDS content, if this is not specified, either cookie memory from last playback or highest bitrate under 1000kbps will be selected for starting rendition. (Per Akamai HDCore library rules).
  2. inpage_bitrate_index_limit: This setting allows admin to specify the highest rendition to be rendered in the page when the player is NOT in full screen. This helps not waster resources and bandwidth on playing a 720p rendition inside a smaller ember but allow highest renditions during full screen mode. Assume MBR index starts at 0.
  3. hds_live_low_latency:  Invoke a reduced latency mode for live HDS streaming.
  4. dvr_enabled: For live streams, this is a player-side override to hide DVR access for end users. This also allows flexibility of having DVR enabled on the Akamai network but not shown to users in the player. Otherwise, AMP will do it’s best to show DVR per setting settings.


amp.premier/js/amp.js

flash: {    …..    …..    },

   vars: {

      mbr_starting_index: 2,

      use_last_known_bitrate: false,

      use_netsession_client: false,

      netsession_install_prompt_frequency_secs: -1,

      ad_server_timeout: 20,

      ad_control_enabled: true,

      dvr_enabled: 1,

      branding_preload: "none",

      hds_live_low_latency: true,

      fullscreen_enabled: true,

      show_feature_bar: false,

      suppress_events: "mediaPlayerViewInitialized",

      caption_language: "en-us",

      hds_fragment_retry_data_gap_threshold: 20,

      auto_replay: false

}

Feature: UI: Full Screen Button

If this node is present and enabled, Full Screen button will show.Also, “native” node allows overriding of native full screen in HTML5 mode.

Config var fullscreen section

fullscreen: {

mode: "external"

}


Sample: samples/fullscreen-external.html

Feature: UI: Control Bar & Modes

With this node present, the control bar will show.The following mode options are available:

  • auto: auto show and dismiss the control bar (for Flash with hover, or HTML5 with tap) (This is default)
  • persistent: keep control bar always available
  • none: remove control bar altogether

 

Config var controls section

controls : {

mode : "auto"

}

 

NOTE: See also API section for amp.controls.setMode() for setting dynamically at any time.

Samples: /samples/controls-native.html and samples/controls.html

Feature: UI: Share Button

If this node is present, the Share button will show in the control bar.

In some customer control bar implementations, specific additional share buttons may be available.

Config var share section

share: {

enabled: true

},

media:{

   embed:{}

    link:"URL"

}

Share html mode:

Sample: samples/share.html

Feature: UI: Logo

Config var branding section

branding : {

logo : "../resources/images/akamai_logo1.png"

}

Sample: samples/branding.html

Feature: Internal: Flash

The <flash> section includes various flash-specific settings and is required. In many cases, except where otherwise noted, no changed are needed here.

 

This document is part of Adaptive Media Player Web User Guide

Attachments

    Outcomes