Brightcove Video Cloud Player Plugin which allows user to download highest rendition from Player interface
JavaScript ActionScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
RenditionDownloadOS
beml
images
README.md

README.md

Rendition Download Plugin

Plugin Overview

This Plugin places a Button within your Brightcove Video Cloud Player which allows the viewer to download the highest rendition of the currently loaded Video.

How the Plugin Works & What your Account Requires to use this Plugin

The Plugin interacts with the custom BEML XML that makes up your template. In addition, it also interacts with the Media API. This means you will need to make sure your account has access to the following in order to properly use this Player plugin:

  • Read API token with URL Access
  • BEML Access to create New Templates

Initial Set-up and Hosting

If you have not already, please upload the ‘RenditionDownload.swf’ file onto your own server.

Make sure that a crossdomain.xml file is set up in the root of this server so that the Brightcove Player has access to this SWF file. You can learn more about Cross-Domain Security here: http://support.brightcove.com/en/docs/cross-domain-security-flash

But basically, you will want to create an XML file named 'crossdomain.xml' and have it contain the following content:

<cross-domain-policy xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xsi:noNamespaceSchemaLocation="http://www.adobe.com/xml/schemas/PolicyFile.xsd">
  <allow-access-from domain="admin.brightcove.com"/>
  <allow-access-from domain="*.brightcove.com"/>
</cross-domain-policy>

Account Set-up & Getting a Read API token with URL Access

Because we want to offer a downloadable URL via HTTP and Brightcove accounts host streaming assets over RTMP by default, we’ll need to use the Universal Delivery Service feature along with the Video Cloud Media API to generate an HTTP URL for your video assets.

The first step to do this is to enable UDS (Universal Delivery Service) on your account by taking the following steps:

  • From the Video Cloud Home Page, click to ‘Account Settings’. You must be logged in as a User with Administrator privileges
  • Click to ‘Publishing Settings’
  • Under ‘Universal Delivery Service’, click ‘Edit’
  • Select ‘Enable’ and Save Changes

Next we will need to get a Read API token with URL access. Please note that these tokens are only available to Express III, Pro, and Enterprise customers.

  • From the Video Cloud Home Page, click to ‘Account Settings’
  • Click to ‘API Management’
  • Your account should already have a Read Token with URL Access. Please copy this token by clicking its corresponding ‘copy’ button

If you are an Express III, Pro, or Enterprise customer and do not have a Read Token with URL Access, please contact Customer Support at https://support.brightcove.com/en/contact

Creating the Player Templates

Within the Project files you’ll find a folder called ‘beml’ which contains the basic code for creating a Chromeless Video Player experience and a Video Player with Chrome Experience.

Within each, you will need to edit a few values to reflect the paths of the assets once they have been hosted on your own web server:

<Modules>
        <Module file="INSERT-PATH-TO-RenditionDownload.swf">
            <param name="apiToken" value="INSERT-API-TOKEN-WITH-URL-ACCESS" />
            <param name="downloadIcon" value="INSERT-PATH-TO-arrow-icon-chrome.png" />
        </Module>
</Modules>

These BEML snippets can be modified and placed inside of other templated, just please be sure to maintain the “renditionDownload” button tag and the “Module” tags from the original BEML code.

Modifying the Download Icon Graphic

Because the Download Icon Graphic is a URL defined in BEML, you are able to create and define your own graphic. Please be sure to adjust the size of the ‘Button’ tag within the BEML (found with the id of ‘renditionDownload’) accordingly. One other note about using graphics in this scenario: You will want to use a solid shape against a transparent background. This allows Flash to recognize the graphic and will allow you to style the colors via the Publishing Module.

Possible Future Enhancements

  • Allowing the Publisher to disable the download functionality on a Video-level basis via Custom Fields.