Play video in SharePoint site using jquery

InfoPath alternatives for form designing SharePoint

This is an article about embedding video inside SharePoint site and play it. If a user needs to fetch video file from SharePoint library and display in page daily based on the video uploaded and approved by an admin user. In this case, the admin user will approve a video file to display on the home page.

Step 1: Create a document library and upload a video file.

Step 2: Login as admin user and approve the video file.

Step 3: In home page place video tag in div wherever you want to display.

<p>Video Demo</p>
<embed type=”video/x-ms-wmv” loop=”0″ autostart=”0″ style=”width: 400px; height: 240px;”></embed>

Step 4: Place content editor webpart inside sharepoint page (or) open the page in sharepoint designer and copy the below code




<script src=”/Shared%20Documents/jquery-1.11.0.js” type=”text/javascript”></script>
<script src=”/Shared%20Documents/jquery.SPServices-2013.02a.js” type=”text/javascript”>
</script><script type=”text/javascript”>
$(document).ready(function () {
$().SPServices({
operation: “GetListItems”,
async: false,
webURL: “http://md-abhishekb/pawsubsite1/”,
listName: “Videos”,

CAMLQuery: “<Query><Where><Eq><FieldRef Name=’Approved’ /><Value Type=’Text’>1</Value></Eq></Where></Query>”,
CAMLViewFields: “<ViewFields> <FieldRef Name=’EncodedAbsUrl’/></ViewFields>”,
CAMLRowLimit: 1,

completefunc: function (xData, Status) {
$(xData.responseXML).SPFilterNode(“z:row”).each(function () {
$(“embed”).attr(“src”,url);
});
}
});
});</script>

Step 5: Refer site url and list name in above code.

Step 6: download jquery plugins from

http://spservices.codeplex.com/releases/view/116626

http://code.jquery.com/jquery-1.11.0.min.js


Step 7: Check the video is displayed on the page.

Hope this article will help you.


You May Also like the Following SharePoint Online Tutorials:

About jayabharathi

The turning point in the process of growing up is when you discover the core of strength within you that survives all hurt.

View all posts by jayabharathi →

Leave a Reply