SharePoint 2013:Programatically generate EmbedCode for uploaded Video
On WCM
In this post I will post a code example to generate a SharePoint embedCode for the uploaded videos , In SharePoint you can add three different types of video files
if you use the third option the field VideoSetEmbedCode will contain the embed iframe of the video but if you use the first option the Field VideoSetEmbedCode will remain empty , although you can get the embed code any time manually as you play the video.
The question is how to get the EmbedCode Programatically ? let us first check the format of the automatically generated embed code by SharePoint
it's simply Iframe with Src attribute with different set of parameters
- Upload video
- Provide link to the video
- Using EmbedCode
if you use the third option the field VideoSetEmbedCode will contain the embed iframe of the video but if you use the first option the Field VideoSetEmbedCode will remain empty , although you can get the embed code any time manually as you play the video.
The question is how to get the EmbedCode Programatically ? let us first check the format of the automatically generated embed code by SharePoint
it's simply Iframe with Src attribute with different set of parameters
- Player Url "/_layouts/15/videoembedplayer.aspx"
- Some Parameter like:
- Site : Site ID
- Web :Web ID
- Folder :Actually this is the current video Item ID not the parent Folder ID (Don't know why it's named as Folder)
- img: Thumbnail image of the Video
- lowner: if it equals 1 the owner name will be displayed
- lTitle: if it equals 1 the title will be displayed