Embedding and Sharing Video in SharePoint. Part Three: Aggregating Video Feeds and utilizing API

Introduction

Previous two posts were devoted to discussion of how to integrate video from YouTube and another Video Providers into SharePoint. In the first post we have discussed how to store embedded video properties and render YouTube player using Computed Field. In the second one we have discussed how to store embed code itself as it was generated by Provider.
This time we will discuss at how you can aggregate video from RSS/Atom Feeds and provide some information about using API for retrieving video content from Video Providers.

Aggregating from Video Providers RSS/Atom Feeds using YouTube

When you retrieve a video feed or list of search results, YouTube returns an Atom feed. Below is presented description of how to display videos from YouTube Feed, in our case we will display results from YouTube channel only.
For retrieving video content and displaying results  YouTube Viewer web part will be used here. In fact, it is just RSSAggregator web part, but with custom XSLT style sheet for processing YouTube feed, for details see implementation section.
So, let’s  see how to add video from YouTube feed on page:

  • Add YouTube Viewer web part which located under category Media Extensions on page
  • Specify FeedUrl for YouTube channel, for example to display video feed from Critical Path Training specify value as shown on picture
  • Result page with  YouTube web part configured is shown below

Utilizing Video Providers API

Another option to retrieve YouTube content  is to use .NET  or JavaScript client libraries directly in SharePoint.
The table below represents summary information about API for commonly used Video Providers listed in oEmbed.

Table 1. API support for Video Providers.

Provider Name API Description
YouTube Data API, Google Data client libraries for use the YouTube Data API (Java.NET, PHP, Python, Objective-C, JavaScript)
Viddler Viddler API
Qik Qik API, client for JavaScript
Vimeo Vimeo APIs

And for displaying it we need some logic to be implemented, for example by creating  custom web part. Implementation details for this functionality  are omitted here.

Implementation

For aggregating and rendering  YouTube Feeds RSSAggregator web part is used as was noted earlier with custom XSLT style sheet for processing YouTube Video Feeds.

To render YouTube feeds we provide custom  XSLT style sheet by specifying XslLink property

and the following XSLT style sheet

References

Advertisements

Embedding and Sharing Video in SharePoint. Part Two: Posting embedded code, support for different Video Providers, Preview view

Introduction

In previous post we have discussed  approach on how to embed video into SharePoint from YouTube. Custom List Video Links were used for storing embedded video properties and Computed Field for rendering Video player.
This time we will extend our solution with the following capabilities:

  • Support for different video providers listed in  oEmbed
  • Preview view for displaying video arranged in list
  • Alternative mode for posting the embed code for video into SharePoint

Support for different video providers

In addition to embed code using iframe, another options also available now. Some providers listed in oEmbed specification use object element for embedding code.

Table 1. Support for Video Providers listed in oEmbed specification

Provider Name Embedded Mode
YouTube IFrame, Object(YouTube)
Viddler
Qik Object(Qik)
Revision3 IFrame
Hulu IFrame
Vimeo IFrame
CollegeHumor Object(CollegeHumor)
Jest Object(Jest)
CircuitLab

Alternative mode for posting embedded code

Additionally to existing mode for embedding video code, the approach described below allows to paste the embed code as it was generated by Provider. Let’s take a look at the common usage scenario:

  • Generate and copy the embed code on the Provider website
  • Select Embed Code from New Item for Video Links List

  • In New Form for Video Links List paste the embed code and fill in comments if needed as shown below

For displaying video player the same (see previous post for details) Computed Field EmbeddedVideoOnForm field is used

Preview view for displaying video

In addition to default view (video player items with details), Preview view is intended to display items arranged by columns as shown below

Implementation

To paste the embed code we define Embed Code Content Type

where field EmbedCode for storing the embed code  is used

As was noted earlier, for displaying video player the same (see previous post for details) Computed Field EmbeddedVideoOnForm field is used, below is presented complete XSLT style sheet for  rendering of a field on a List View

References