none
How to add video file in sharepoint RRS feed

  • Question

  • Hi

    I need to upload a video in my sharepoint site and that video must be played in the site itself...

    Please send me how to do that...

    I will be very thankful for you if you help me in doing this...

    Thanks in Advance....

    Thursday, July 25, 2013 12:32 PM

Answers

All replies

  • Hi Sanam,

    You can use the new Asset Library template to set up a library that makes it easy to store, organize, and find rich media assets, such as image, audio, or video files.

    Please go through following URL for further reference:

    http://office.microsoft.com/en-in/sharepoint-server-help/set-up-a-library-to-store-image-audio-or-video-files-HA101828004.aspx

    Regarding Playing video files You can use the OOB Media web part for that. The media web part in SharePoint is a Silverlight control. So it supports all the formats supported by the silverlight.

    You can go through following article for further reference and other alternatives:

    http://sharepointconnoisseur.blogspot.ru/2011/05/play-video-and-media-files-in.html


    Please don't forget to 'mark answer/propose answer' or 'vote as helpful' as appropriate.


    • Edited by Mahesh.Nalam Thursday, July 25, 2013 1:27 PM more info
    • Marked as answer by Sanam K M N Friday, August 2, 2013 10:34 AM
    Thursday, July 25, 2013 1:25 PM
  • How are you adding the videos to the SharePoint? Via code or via the UI?

    Firstly, you will need to check the maximum file upload limit (set via the WebApplications General Settings). The default value is 50MB.

    You can upload the videos to a SharePoint media library, and play the videos directly from the library. SharePoint uses a Silverlight control to play videos in the browser, so as long as you have Silverlight installed for your browser, you can play the videos inline.

    If you want to use a custom webpart for listing and displaying videos, then you need to add a small bit of JavaScript and DIV with an ID.

    E.g.

    <div class="row" id="mediaplayer">
    	<!-- List of videos go here -->
    	<a href="http://somesite/video.wmv" onclick="">The video Title</a>
    </div>
    <script type="text/javascript">
    	_spBodyOnLoadFunctionNames.push('mediaPlayer.createOverlayPlayer');  
    	mediaPlayer.attachToMediaLinks( document.getElementById('mediaplayer'), ['wmv', 'avi', 'mp3']);  
    </script>


    Regards, Matthew
    MCPD | MCITP
    My Blog
    Please remember to click "Mark As Answer" if a post solves your problem or "Vote As Helpful" if it was useful.

    I just added a webpart to the TechNet Gallery that allows administrative users to upload, crop and format user profile photos. Check it out here: Upload and Crop User Profile Photos

    • Proposed as answer by yogesh sainee Monday, July 29, 2013 3:30 PM
    Thursday, July 25, 2013 1:39 PM
  • Actually i have video in my computer..

    I need to upload that video in sharepoint site..

    How can i do that?? please explain me.


    Monday, July 29, 2013 5:41 AM
  • Hi Sanam,

    I wrote a wiki article about uploading (and resizing) images to SharePoint. The code example in the article is the same you would use to upload videos from your computer.

    The article is here: http://social.technet.microsoft.com/wiki/contents/articles/17739.sharepoint-uploading-and-resizing-images-to-a-sharepoint-picture-library-via-a-webpart.aspx

    An example of the code (this assumes you have a FileUpload control on your page/in you webpart called fileBrowser):

    protected void UploadFileClick(object sender, EventArgs e)
    {
        try
        {
            userMessage.Text = String.Empty;
            SPWeb web = SPContext.Current.Site.RootWeb;
            if (!fileBrowser.HasFile)
            {
                userMessage.Text = "Please select a video before clicking Upload.";
                return;
            }
            //Check the file is less than 250MB (or whatever the maximum file upload size is for the web application
            int fileSize = fileBrowser.PostedFile.ContentLength;
            if (fileSize > 250000000)
            {
                userMessage.Text += String.Format("Video Size Exceeds 250MB.");
                return;
            }
            var videoFileData = fileBrowser.FileBytes;
            SPList listExists = web.Lists.TryGetList("videos");
            SPUtility.ValidateFormDigest();
            if (listExists == null)
            {
                //...
                return;
            }
            var fileName = fileBrowser.FileName.Replace(" ", "-");
            var videoUrl = String.Format("{0}/videos/{1}", web.Url, fileName);
            web.Files.Add(videoUrl, videoFileData, true);
                    
        }
        catch (Exception exception)
        {
            //...
        }
    }


    Regards, Matthew
    MCPD | MCITP
    My Blog
    Please remember to click "Mark As Answer" if a post solves your problem or "Vote As Helpful" if it was useful.

    I just added a webpart to the TechNet Gallery that allows administrative users to upload, crop and format user profile photos. Check it out here: Upload and Crop User Profile Photos

    Monday, July 29, 2013 8:59 AM
  • Upload it to any library and give the path of the that vedio in above script.

    Monday, July 29, 2013 3:31 PM
  • Hi 

    Thanks for your replies....

    I have uploaded wmv video file of 176MB in sharepoint Asset Library when i am trying to play i am getting media not found error.

    Later i have uploaded mp4 file of 85MB which playing good in my sharepoint site..

    Please help me to know what is the problem..

    Thanks in Advance...

    Tuesday, July 30, 2013 8:41 AM