We have four major goals in the next hour:
It's important to understand the relationship between the four major divisions of Media Manager
The cool factor of Media Manager is that you don't have to think about codecs, file formats, and browser support.
When you upload your asset, be prepared to fill in a few fields for it
A program needs some fields, just like an asset:
Folder | Where you store it |
---|---|
Title | Title of your program |
Description | Description of the program |
Keywords | Metadata for the program |
Available from | When is the program available?* |
Available until | When is the program no longer available?* |
Maximum Views | Number of times the program should be viewed?*** |
Audio Player | Plays your Audio |
---|---|
YouTube Connector | Connects Media manager to a YouTube Account |
Download | Lets you download an asset |
HTML Gallery | Creates a Gallery |
HTML Image | Shows an image |
Flash Player | Shows some Flash |
HTML5 Player | Does the awesomeness |
Mobile Player | Puts a low quality video for mobile phones |
Theme: | we can actually specify a directory for the CSS |
---|---|
Styling: | the buffer color, image, the control bar, image sprites, and all the buttonsCheck the docs |
Layering: | Layers of individual elements |
Layout: | Height, width, and the position. |
Fonts: | you can designate font family, font size, font weight, text shadows and text transforms |
Color: | colors for the backgrounds, the text, and hover colors. |
Logo: | You can set a logo in the video, as a watermark |
Theme: | Publish your CSS to a CDN or some public directory.
Clients who want CSS to go through a dev-qa-prod process may get cranky over this. |
---|---|
Styling: | Most designers aren't prepared for the customization options that are offered.
Be prepared to answer lots of questions. |
Layering: | A danger zone.
If HTML5 falls back to Flash (like in an IE browser), the <object>element supercedes all other z-indexing. |
Layout: | You must provide a height and width using only an integer.
px, %, and em are not accepted You can change the unit of measurement with JavaScript— so long as you used the JavaScript approach. |
Fonts: | Designate any fonts that you want— even fonts that are included with typekit. |
Color: | You must provide color in hexadecimal. RGB, RGBA, and HSLA are not accepted. |
You upload an asset and make a program with it, so that you can distribute it with an outlet
The distribution is the only thing that gets viewed by the end user.
The iframe and Ajax approach will both use the URL in the distribution window.
The JavaScript approach involves copying and pasting the code.
Use this if:
<iframe src="http://nationwide.dist.sdlmedia.com/Distributions/ ?o=DCF7FD8E-E793-4690-B280-9E5493C60B51"> </iframe>
Media Manager provides a JavaScript snippet that an end-user can use, a bit like YouTube.
Use this if:
<script type="text/javascript" language="javascript" src="http://nationwide.dist.sdlmedia.com/Distributions/ embed/?o=DCF7FD8E-E793-4690-B280-9E5493C60B51"> </script>
<div class="container"> <div class="wrap"> <script type="text/javascript" language="javascript" src="http://nationwide.dist.sdlmedia.com/Distributions/embed/?o=1F2C97BE-DE64-467C-A6D1-3A5DCFE38215"></script> </div> </div>
.container { width: 16em; } .wrap { position:relative; overflow: hidden; display: block; height: 0; padding-bottom: 56.25%; border: 2px solid black; background: gray; }
Ajax is the undocumented approach. It involves writing some jQuery that calls the video.
Use this if:
<head>
$.getScript('http://nationwide.dist.sdlmedia.com/Distributions/ ?o=DCF7FD8E-E793-4690-B280-9E5493C60B51')
There's a second approach which allows you to set the target of the element
$.getScript('http://nationwide.dist.sdlmedia.com/Distributions/ ?o=DCF7FD8E-E793-4690-B280-9E5493C60B51&trgt=someAwesomeDiv')
Managing a Media Manager video in Tridion is fairly straightforward.
Schema Name | Media Manager | ||
---|---|---|---|
XML Name | Description | Field Type | Details |
header | Video Title | Text | Plain Text |
description | Video Description | Text | Rich Text (3 lines) |
embedType | Method of Embedding | Text | list:
|
url | Media Manager URL | Text | Plain Text |
@helper videoEmbedUrl(string url){ return url.Replace("Distributions/","Distributions/embed/"); } <figure class="video video--@(Fields.embedType)"> @if(Fields.header != null){ <h1 class="video__header"> @Fields.header </h1> } <div class="video__player player"> @if(Fields.embedType != "iframe"){ <iframe class="player__iframe" src="@Fields.url"> </iframe> } else { <script type="text/javascript" src="@videoEmbedUrl(Fields.url)"></script> } </div> @if(Fields.description != null){ <figcaption class="video__description"> @Fields.description </figcaption> } </figure>
A lot of the tricks around Media Manager revolve around tweaking the outlet, playing with the jQuery events, and digging around in the console.
Any jQuery that you write needs to happen inside of the MMPLAYERREADY
event.
Create your own Media Manager namespace, and initiate it inside of MMPLAYERREADY
$(document).on('MMPLAYERREADY', function (e) { mediaManagerMagic.init(); });
var mediaManagerMagic; mediaManagerMagic = { init: function () { var _this = mediaManagerMagic; _this.bindUiEvents(); _this.functions.conjunctionFunction(); }, data: {}, helpers: {} bindUiEvents: function () {}, functions: {} };
You have a handful of jQuery events that propogate up into the container. You can listen to those events and respond accordingly.
Event | Description |
---|---|
player-ready
|
Tells you when the player is fully loaded and ready.
This can fire multiple times on a page |
show-layer-endstate
|
Tells you when the video has finished playing
Useful if you need to do something when the video is over |
show-layer-hover
|
When the mouse is hovering over the video |
fullscreen-enter
|
When the video is in fullscreen |
fullscreen-exit
|
When the video leaves fullscreen |
hide-layer
|
Tells you that a mouse has stopped moving over the player |
Any jQuery that you write needs to happen inside of the MMPLAYERREADY
event.
Create your own Media Manager namespace, and initiate it inside of MMPLAYERREADY
$(document).on('MMPLAYERREADY', function (e) { $(player).on("show-layer-endstate", function (e) { setTimeout(helpers.resetVideo(),100); }); });
$(document).on('MMPLAYERREADY', function (e) { $(player).on("player-ready", function (e) { helpers.playVideo() }); });
If you need to be able to switch between an iframed or an Ajaxed approach, use a jQuery plugin!
Before you build a plugin, use what's out there, and make sure that it works for the content author— not just you!
Be sure that your plugins will work with SDL's version of jQuery
<!--insert shameless self promotion-->
Media Manager actually uses a third party API for putting videos on a page. If you want to understand the core of media manager, this is it.
Check out http://www.projekktor.com/ for details on how videos actually get put on the page. It's a pretty complex JavaScript library.
Nationwide actually makes use of some functionality in the Projekktor API to do some super serious hackery:
//Reset the video and play again restartPlayer: function () { var player = projekktors[0]; //target the video directly, since it's in an array player.reset(); player.setPlay(); }, //fullscreen shenanigans openFullscreen: function () { var player = projekktors[0]; player.setFullscreen(); $player.removeClass("js-fullscreen"); }, closeFullscreen: function() { var player = projekktors[0]; //use the jQuery method, because it's easier in this case $player.trigger("close-fullscreen"); $player.removeClass("js-fullscreen"); }, //Play at a specific point in the video playPosition: function (n) { var player = projekktors[0]; player.setPlayhead(n); return; }, //create a play function that can accept a position as an argument playVideo: function (n) { var _this = nwdotcom.mediaManagerHandler, $player = $(_this.data.player); if (n) { _this.helpers.playPosition(n); } $player.trigger("play"); }, pauseVideo: function () { var _this = nwdotcom.mediaManagerHandler, $player = (_this.data.player); $player.trigger("pause"); }, stopVideo: function () { var player = projekktors[0]; player.setStop(); }, //reset the video resetVideo: function () { var player = projekktors[0]; player.reset(); }, restartVideo: function () { var _this = nwdotcom.mediaManagerHandler, $player = $(_this.data.player); $player.trigger("restart-asset") }, //detroy the player exitVideo: function () { var _this = nwdotcom.mediaManagerHandler, $player = $(_this.data.player); $player.trigger("exit"); _this.data.userIntent.watch = false; }, setVolume: function (vol) { var player = projekktors[0]; player.setVolume(vol); }, },
Learn how to trick-out Media Manager
<!--Insert sincere gratitude -->