MediaPlayer:Macros

From Metrixstream
Revision as of 17:30, 21 March 2011 by MetrixAdmin (Talk | contribs)

Jump to: navigation, search

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.

For your convenience we list several macros that have reduced parameters. If you need full customization of the player, then you should use the custom macros towards the end of the 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) ?>

getUserPlayerEmbedCode

This is the embed version of getUserPlayerUrl. It will instantiate a media player in the mp (default) skin. 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.
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 getUserPlayerEmbedCode(MS.activeContent, #0, #600, #400, "000000", "window", #1) ?>

getSkinPlayerUrl

This is the same as getPlayerUrl except it allows the specification of a custom skin.

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.
skin
this is name of the skin you want to use for the player. See SKINS for a list of available skins.

Example Usage

<?cs call:getSkinPlayerUrl(MS.activeContent, #0, "minimal") ?>

getSkinUserPlayerUrl

This is the same as getUserPlayerUrl except it allows the specification of a custom skin.

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.
skin
this is name of the skin you want to use for the player. See SKINS for a list of available skins.

Example Usage

<?cs call:getSkinUserPlayerUrl(MS.activeContent, #0, "minimal") ?>

getSkinPlayerEmbedCode

This is the same as getPlayerEmbedCode except it allows the specification of a custom skin.

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.
skin
this is name of the skin you want to use for the player. See SKINS for a list of available skins.

Example Usage

<?cs getSkinPlayerEmbedCode(MS.activeContent, #0, #600, #400, "000000", "window", #1, "minimal") ?>

getSkinUserPlayerEmbedCode

This is the same as getUserPlayerEmbedCode except it allows the specification of a custom skin.

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.
skin
this is name of the skin you want to use for the player. See SKINS for a list of available skins.

Example Usage

<?cs getSkinUserPlayerEmbedCode(MS.activeContent, #0, #600, #400, "000000", "window", #1, "minimal") ?>
Personal tools