MediaPlayer:Macros
MetrixAdmin (Talk | contribs) (Created page with "== 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...") |
MetrixAdmin (Talk | contribs) m (MetrixAdmin moved page Media Player: Macros to MediaPlayer:Macros) |
||
(5 intermediate revisions by one user not shown) | |||
Line 1: | Line 1: | ||
== Getting Started == | == 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 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 == | == getPlayerUrl == | ||
Line 9: | Line 11: | ||
=== Parameters === | === Parameters === | ||
;obj | ;obj | ||
− | :this is the content item. Normally this will be MS.activeContent | + | :this is the content item. Normally this will be MS.activeContent. |
;index | ;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 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 === | === Example Usage === | ||
<?cs call:getPlayerUrl(MS.activeContent, #0) ?> | <?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") ?> | ||
+ | |||
+ | == getCustomPlayerUrl == | ||
+ | |||
+ | This is the universal macro to generate a URL to the player with any combination of configuration options. | ||
+ | |||
+ | === 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. | ||
+ | ;ppm | ||
+ | :this specififies whether or not to enable the pay-per-minute/pay-per-credit functionality. This is only available to logged in users. | ||
+ | ;embed | ||
+ | :this controls whether or not this video can be re-embedded. | ||
+ | ;ipod | ||
+ | :this controls whether or not to show an ipod embed link (if available). | ||
+ | ;formats | ||
+ | :this is a list of formats concatenated via the | character. | ||
+ | |||
+ | === Example Usage === | ||
+ | |||
+ | <?cs call:getCustomPlayerUrl(MS.activeContent, #0, "minimal", #0, #1, #0, "low|med|high|hd") ?> | ||
+ | |||
+ | == getCustomPlayerEmbedCode == | ||
+ | |||
+ | This is the universal macro to generate an embed code to the player with any combination of configuration options. | ||
+ | |||
+ | obj, index, width, height, playerId, color, wmode, autoplay, skin, ppm, embed, ipod, formats | ||
+ | |||
+ | === 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. | ||
+ | ;playerId | ||
+ | :this is HTML element id 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. | ||
+ | ;ppm | ||
+ | :this specififies whether or not to enable the pay-per-minute/pay-per-credit functionality. This is only available to logged in users. | ||
+ | ;embed | ||
+ | :this controls whether or not this video can be re-embedded. | ||
+ | ;ipod | ||
+ | :this controls whether or not to show an ipod embed link (if available). | ||
+ | ;formats | ||
+ | :this is a list of formats concatenated via the | character. | ||
+ | |||
+ | === Example Usage === | ||
+ | |||
+ | <?cs call:getCustomPlayerEmbedCode(MS.activeContent, #0, #600, #400, "myPlayer", "000000", "transparent", #1, "minimal", #0, #1, #0, "low|med|high|hd") ?> |
Latest revision as of 15:00, 1 July 2012
Contents |
[edit] 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.
[edit] 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.
[edit] 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.
[edit] Example Usage
<?cs call:getPlayerUrl(MS.activeContent, #0) ?>
[edit] 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.
[edit] 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.
[edit] Example Usage
<?cs call:getUserPlayerUrl(MS.activeContent, #0) ?>
[edit] 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.
[edit] 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.
[edit] Example Usage
<?cs getPlayerEmbedCode(MS.activeContent, #0, #600, #400, "000000", "window", #1) ?>
[edit] 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.
[edit] 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.
[edit] Example Usage
<?cs getUserPlayerEmbedCode(MS.activeContent, #0, #600, #400, "000000", "window", #1) ?>
[edit] getSkinPlayerUrl
This is the same as getPlayerUrl except it allows the specification of a custom skin.
[edit] 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.
[edit] Example Usage
<?cs call:getSkinPlayerUrl(MS.activeContent, #0, "minimal") ?>
[edit] getSkinUserPlayerUrl
This is the same as getUserPlayerUrl except it allows the specification of a custom skin.
[edit] 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.
[edit] Example Usage
<?cs call:getSkinUserPlayerUrl(MS.activeContent, #0, "minimal") ?>
[edit] getSkinPlayerEmbedCode
This is the same as getPlayerEmbedCode except it allows the specification of a custom skin.
[edit] 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.
[edit] Example Usage
<?cs getSkinPlayerEmbedCode(MS.activeContent, #0, #600, #400, "000000", "window", #1, "minimal") ?>
[edit] getSkinUserPlayerEmbedCode
This is the same as getUserPlayerEmbedCode except it allows the specification of a custom skin.
[edit] 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.
[edit] Example Usage
<?cs getSkinUserPlayerEmbedCode(MS.activeContent, #0, #600, #400, "000000", "window", #1, "minimal") ?>
[edit] getCustomPlayerUrl
This is the universal macro to generate a URL to the player with any combination of configuration options.
[edit] 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.
- ppm
- this specififies whether or not to enable the pay-per-minute/pay-per-credit functionality. This is only available to logged in users.
- embed
- this controls whether or not this video can be re-embedded.
- ipod
- this controls whether or not to show an ipod embed link (if available).
- formats
- this is a list of formats concatenated via the | character.
[edit] Example Usage
<?cs call:getCustomPlayerUrl(MS.activeContent, #0, "minimal", #0, #1, #0, "low|med|high|hd") ?>
[edit] getCustomPlayerEmbedCode
This is the universal macro to generate an embed code to the player with any combination of configuration options.
obj, index, width, height, playerId, color, wmode, autoplay, skin, ppm, embed, ipod, formats
[edit] 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.
- playerId
- this is HTML element id 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.
- ppm
- this specififies whether or not to enable the pay-per-minute/pay-per-credit functionality. This is only available to logged in users.
- embed
- this controls whether or not this video can be re-embedded.
- ipod
- this controls whether or not to show an ipod embed link (if available).
- formats
- this is a list of formats concatenated via the | character.
[edit] Example Usage
<?cs call:getCustomPlayerEmbedCode(MS.activeContent, #0, #600, #400, "myPlayer", "000000", "transparent", #1, "minimal", #0, #1, #0, "low|med|high|hd") ?>