The smart embed allows you to simply embed your Media on your own sites. You can set a couple options and the embed will then embed the Media onto your pages.

<script src="https://{CLIENT_SHORTNAME}.getmediamanager.com/js/mm.embed.v1.min.js"></script>

The above would embed a Media Manager video with a width of 640px and a height of 360px. We also tell it which Media Manager Template to use. You are also required to pass your accounts shortname and finally we need to pass the Video ID.

<script type="text/javascript">
mediamanager.width(640);
mediamanager.height(360);
mediamanager.template("{TEMPLATE_ID}");
mediamanager.client("{CLIENT_SHORT_NAME}");
mediamanager.video("{VIDEO_ID}");
mediamanager.embed();
</script>

TEMPLATES

Because your account can have multiple templates and your videos could be published to many different ones. Then its a good idea to set what template you wish to use as the view for your embed. You don't have to pass a template as it will automatically use a default template (most likely embed template).

mediamanager.template("{TEMPLATE_ID}");

ANALYTICS TAGS

You can pass analytics tags to the Smart embed by using the  meta option. 

mediamanager.meta.videoid =1564;

Analytics tags allow you to define your own data when it comes to recording Analytics. For instance in the above code we have created our own Analytics Tag of  videoid .This allowed us to define our own ID for the video. So when we look at the Analytics, we can query the data based on this videoid. This can also be a great way to track users if your site has its own user system along with ids.

RESPONSIVE

The Media Manager smart embed also allows you to make an embed responsive.

mediamanager.responsive(true,"16:9");

You can provide it with an aspect ratio which will tell the embed how to resize the video. By default 16:9 is assumed. You MUST also set the width and heights to be 100% so the embed can be responsive.

NOTE: WHEN USING PERCENTAGES, THEY MUST BE INSIDE QUOTATIONS OTHERWISE YOU WILL GET JAVASCRIPT ERRORS.

mediamanager.width("100%");
mediamanager.height("100%");

AUTOPLAY

You can turn off autoplay by setting the autoplay option to false.

mediamanager.autoplay(false);

MUTE

You can mute the player by default by setting the mute option to true.

mediamanager.mute(true);

EVENTS

Media Manager Player has a number of different events that you can listen to. It makes it easier for you by allowing you to set the events directly on the mediamanager object. A data object will be passed to the function. Depending on the type of event the object can be different.

mediamanager.onPlay = function(data){
  //code to run when media plays
};
onPlay Triggered when media plays
onComplete Triggered when media completes (reaches the end)
onPause Triggered when media is paused

You can also trigger events to pause or play the player using the mediamanager object.

mediamanager.pause(); //PAUSE PLAYER
mediamanager.play(); //PLAY PLAYER

ADVERTS

Media Manager allows you to use advert services.

The following are currently supported:

  • Liverail
mediamanager.ads("TYPE", {});

The first parameter is the ad type. This is one of the types as listed above. The second parameter is an Object containing data that will be passed to the ad service.

LIVERAIL

You can use Liverail by setting the type as "liverail" and the second parameter as an object containing all the tags Liverail requires.

mediamanager.ads("liverail", {
 'LR_PUBLISHER_ID': 'PUBLISHER_ID',
 'LR_ADMAP': 'AD_MAP',
 'LR_VIDEO_ID': 'VIDEO ID',
 'LR_TITLE': 'VIDEO TITLE',
 'LR_TAGS': 'TAGS'
});