Syndication Videos

NHS Choices videos cover a huge range of health topics. As well as embedding single videos, you can create playlists with multiple topics and videos. You can also access the Brightcove API directly. Check our catalogue of videos on the NHS Choices site.

Using the Brightcove API to return videos

This post quickly summarises how to use the Brightcove API to pull back a video. Please refer to other posts for information about multiple renditions, and other methods. All data is returned in .json.

You’ll first need a token – speak to your relevant syndication manager, who can supply you with one. This token will enable you to access the video library in read format, making calls to pull back content based on criteria.

To retrieve all records, with no filtering or specific criteria, the call would look like:

http://api.brightcove.com/services/library?command=search_videos&token={token_ID}

This will return the entire information associated with our videos. In order to narrow down the content, such as returning a single video, you need to add criteria to filter the list.

To do this for a single video, the call would look like this:

http://api.brightcove.com/services/library?command=find_video_by_id&video_id={video_ID}&token={token_ID}

where video_id is the ID of the video you’re trying to find. You could use the initial call to return and parse the IDs from the entire list, and then pull each video based on this ID using the second call.

This will return the entire information based on a single video. From here, you can work with the information, such as accessing the rendition (stored within FLVURL). You can then apply other methods and criteria as required. For further information on how to use these criteria and methods, see http://support.brightcove.com/en/video-cloud/docs/how-to-search-videos-media-api#searchTerms and http://docs.brightcove.com/en/video-cloud/media/reference.html#Video_Read.

 

Accessing multiple renditions with the Brightcove API

When using the Brightcove API to pull down videos, it’s possible to access the various quality formats we hold. To do this, once you’ve used the standard API call to return your video list, append

&video_fields=name,renditions

to the string. This will bring back all available renditions, and the name of the video file, allowing you to access the desired quality video.

For further information about accessing multiple video formats, see http://support.brightcove.com/en/video-cloud/docs/accessing-video-content-media-api#Accessing multi-bitrate streaming renditions

Using the Brightcove Media API

Please note that this product is not owned, updated or hosted by NHS Choices. Whilst we can supply basic information on how the API works, for full information, please see the following areas:

Brightcove Media API Reference: http://support.brightcove.com/en/video-cloud/docs/media-api-reference

Getting started: http://docs.brightcove.com/en/video-cloud/media/quick-start.html

Introduction

The Brightcove Media API allows you to take information regarding the NHS Choices videos hosted on Brightcove, and use this information to retrieve videos and their associated information. You can use this to pull back specific videos based on tagging information, retrieve a full list of titles available, or consume the IDs for videos, passing it across to a predefined player.

Method

API access is via a read access token. If you do not have this, please speak to your syndication manager. This token must be appended to the API call to access the syndication video account. Calls are restricted to 100 videos per page – to return further titles and information, use

&page_number= criteria

Paging starts at 0. Note that the data is returned as .json, which will need consuming in order to display correctly – the raw data output will need manipulation in order to make sense.

HTML5 video player

This player is enabled for HTML5 video delivery, and is based on the standard player. To use, amend the video ID below
(highlighted) with the relevant code for the video required. Please note that this is a smart player, so will play as flash
on flash-enbaled devices, but as an HTML5 player on non-flash devices.

<!-- Start of Brightcove Player --> <div style="display:none"> </div> <!-- By use of this code snippet, I agree to the Brightcove Publisher T and C found at https://accounts.brightcove.com/en/terms-and-conditions/. --> <script language="JavaScript" type="text/javascript" src="http://admin.brightcove.com/js/BrightcoveExperiences.js"></script> <object id="myExperience693503304001"> <param name="bgcolor" value="#FFFFFF" /> <param name="width" value="486" /> <param name="height" value="412" /> <param name="playerID" value="1661945041001" /> <param name="playerKey" value="AQ~~,AAAABgoPhOk~,ohCJ14D-UAu8YaopRLUDgnUAMgKxMw9P" /> <param name="isVid" value="true" /> <param name="isUI" value="true" /> <param name="dynamicStreaming" value="true" /> <param name="@videoPlayer" value="1644987003001" /> </object> <!-- This script tag will cause the Brightcove Players defined above it to be created as soon as the line is read by the browser. If you wish to have the player instantiated only after the rest of the HTML is processed and the page load is complete, remove the line. --> <script type="text/javascript">brightcove.createExperiences();</script> <!-- End of Brightcove Player -->

Video Multiplayer Usage

As well as taking single videos, it is also possible to create a multiplayer, which can embed multiple videos, either as a single playlist, or using multiple playlists. For example, you may wish to create a single multiplayer for all your videos, with different playlists like Healthy Eating, Exercise and Lose Weight. Or you might consider using a single playlist across multiple titles. To set up a mutliplayer, you’ll need to know what videos and categories you want, and also what player styling (see playerPreviews). When you have selected these, speak to your syndication manager to set the player up.

Embedding video from site

By far the easiest method to take video from NHS Choices is to embed the video file directly from the site. To do so, please refer to Embed videos from NHS Choices. Please note that if a video doesn’t have an embed code, it means it is unavailable for syndication. If you want to use a mutliplayer, with multiple videos and playlists, please see Video multiplayer usage