Embed codes are quick and easy ways to view your video or playlist on your website. An embed code is a simple JavaScript tag that can be pasted into a body of a story or blog.

For more advanced implementations, you may want to have your CMS automate the way an embed code is constructed. By doing this, you can allow more control of how your video content is displayed (or not displayed). This is especially valuable when you are re-using your content in RSS or other types of feeds that may not display properly with JavaScript embed codes.

Please note in the examples below, the omission of “http” or “https” from the URLs is purposeful. The Field59 player will check the page on which it is being embedded, and determine whether it needs to serve as secure or insecure, depending on the application environment in which it is being rendered.

Video Embed Code

The video embed code follows a simple URL pattern and uses the following elements:

  • Player Source URL –  //player.field59.com/v4/vp/
  • User Identification – This will be the identification given to your publishing account and will be the same for all videos and playlists. This should match your Field59 account name. This data can come from a root-level field that can be manually entered. For broadcast clients, it is usually your call letters. It is not case-sensitive.
  • Key – This is unique for each video.

Example:

<script src='//player.field59.com/v4/vp/YOUR_IDENTIFICATION/YOUR_KEY'></script>

When combined with a key check, the embed code can be scripted to automatically be generated on a page.

Example:

  ## Set a variable $key
  #set($key = $string.trim($story.key))
  ## Set a variable $ident.
  #set($ident = $host.identification)
  #if($key != "" && $key.length() == 40)
  <script src='//player.field59.com/v4/vp/${ident}/${key}'></script>
  #end

Playlist Embed Code

To embed a playlist on your website is similar to how individual videos are embedded. Both “smart” and “manual” playlist types follow a simple URL pattern and uses the following elements:

  • Player Source URL –  //player.field59.com/v4/playlist/
  • User Identification – This will be the identification given to your publishing account and will be the same for all videos and playlists. This should match your Field59 account name. This data can come from a root-level field that can be manually entered. For broadcast clients, it is usually your call letters. It is not case-sensitive.
  • Key – This is unique for each playlist. Video keys do not work with playlist embeds, so you should make sure you are able to differentiate them in some naming convention in your system.

When combined with a key check, the playlist embed code can be scripted to automatically be generated on a page.

Example:

    ## Set a variable $key
    #set($playlistKey = $string.trim($story.playlistKey))
        #set($ident = $host.identification)
    <script src='//player.field59.com/v4/playlist/${ident}/${playlistKey}'></script>

Live Event Embed Code

The live event embed code follows a simple URL pattern and uses the following elements:

  • Player Source URL –  //player.field59.com/v4/live/
  • User Identification – This will be the identification given to your publishing account and will be the same for all videos and playlists. This should match your Field59 account name. This data can come from a root-level field that can be manually entered. For broadcast clients, it is usually your call letters. It is not case-sensitive.
  • Key – This is unique for each live event.

Example:

<script src='//player.field59.com/v4/live/YOUR_IDENTIFICATION/YOUR_KEY'></script>

When combined with a key check, the embed code can be scripted to automatically be generated on a page.

Example:

  ## Set a variable $key
  #set($key = $string.trim($story.key))
  ## Set a variable $ident.
  #set($ident = $host.identification)
  #if($key != "" && $key.length() == 40)
  <script src='//player.field59.com/v4/live/${ident}/${key}'></script>
  #end

Live Channel Embed Code

To embed a live channel of multiple live events on your website is similar to how individual live events are embedded. It follows a simple URL pattern and uses the following elements:

  • Player Source URL –  //player.field59.com/v4/channel/
  • User Identification – This will be the identification given to your publishing account and will be the same for all videos and playlists. This should match your Field59 account name. This data can come from a root-level field that can be manually entered. For broadcast clients, it is usually your call letters. It is not case-sensitive.
  • Key – This is unique for each live channel. Live event keys do not work with live channel embeds, so you should make sure you are able to differentiate them in some naming convention in your system.

When combined with a key check, the live channel embed code can be scripted to automatically be generated on a page.

Example:

    ## Set a variable $key
    #set($playlistKey = $string.trim($story.channelKey))
        #set($ident = $host.identification)
    <script src='//player.field59.com/v4/channel/${ident}/${channelKey}'></script>

Programmable Parameters

There are several parameters that affect what markup is written out to the page when the page loads that can also be passed into the player via a request parameter(s) on the script tag, with semi-colons separating each parameter. (These can also be set by non-technical staff by configuring custom players in the Manager). These are:

  • autoplay=true (don’t pass false, just leave off if autoplay is not desired.)
  • autoadvance=true, if you’d like a playlist to automatically play the next video in the playlist. (This parameter is ignored by single video players. Don’t pass false, just leave off if autoadvance is not desired.)
  • targetdiv=[idofdiv], if you want to control into which div the player renders itself
  • player=[key], for overriding an associated player. This would be used in cases where, on a particular section of your site, it’s desired to use a particular player configuration in the Manager that is different than the player associated with a given video or playlist. Simply pass in the ID of the player configuration as a request parameter and set the height, width and autoplay settings in the manager app, and have any changes to them automatically translate onto the page. (You would need to have some way to store this value in your CMS).

To add these parameters to an embed code, follow this pattern using semi-colons between the parameters. For example:

<script src='//player.field59.com/v4/vp/YOUR_IDENTIFICATION/YOUR_KEY/autoplay=true;targetdiv=[idofdiv];player=[key]'></script>

Share This