MediaPlayer:Macros
Contents |
Getting Started
There are several macros internally define that let you instantiate a media player. There are several details that you need to pay attention to and we will go over them below. There are 2 types of macros. If a macro ends in PlayerUrl, then it means it is intended that the macro returns a link that is used to pop open another browser window. If the macro ends in PlayerEmbed, then it is indented that the video be embedded in the current browser page.
getPlayerUrl
This is the most basic player macro and also the most common. It will instantiate a media player in the mp (default) skin and allow playback for both logged in and logged out viewers.
Parameters
- obj
- this is the content item. Normally this will be MS.activeContent.
- index
- this is an offset into the video. This offset is a normalized offset between 0 and 1000. This means that index=500 would be half way through the video. This is ignored for live events.
Example Usage
<?cs call:getPlayerUrl(MS.activeContent, #0) ?>
getUserPlayerUrl
This is an authenticated only version of getPlayerUrl. This enables the pay-per-minute/pay-per-credit functionality. This will only work if you are logged in as a site user and have minutes or credits available to use if the content object is non-free media or it is a live event with its access set to public.
Parameters
- obj
- this is the content item. Normally this will be MS.activeContent.
- index
- this is an offset into the video. This offset is a normalized offset between 0 and 1000. This means that index=500 would be half way through the video. This is ignored for live events.
Example Usage
<?cs call:getUserPlayerUrl(MS.activeContent, #0) ?>
getPlayerEmbedCode
This is the embed version of getPlayerUrl. It will instantiate a media player in the mp (default) skin and allow playback for both logged in and logged out viewers.
Parameters
- obj
- this is the content item. Normally this will be MS.activeContent.
- index
- this is an offset into the video. This offset is a normalized offset between 0 and 1000. This means that index=500 would be half way through the video. This is ignored for live events.
- width
- this is the width of the embedded player.
- height
- this is the height of the embedded player.
- color
- this is the background color of the embedded player.
- wmode
- this is the window mode of the embedded player. The following values are available: window, opaque, or transparent. Window offers the fastest performance but browser elements can not be placed over the player. Opaque is 2nd fastest and lets browser objects be placed over itself. Transparent is the slowest, but lets you have transparencies within the player.
- autoplay
- whether or not the player should start playing immediately upon loading.
Example Usage
<?cs getPlayerEmbedCode(MS.activeContent, #0, #600, #400, "000000", "window", #1) ?>