5/26/2015

SharePoint 2013 Asset Library Secrets and Wierdness!

 

Asset Libraries are… weird. When you just upload videos using only the Upload button, and just view the videos, then all is good. But if you want the link to the video file, or you upload without the Upload button, or you want to search for all videos, then weirdness happens! Especially in Office 365 / SharePoint Online.

In this article:
  • Finding the URL to an Asset library video.
  • Two Three ways to upload a video, with TWO THREE different results!
  • Searching Asset Libraries.

Finding the URL to an Asset library video

The Asset library does a pretty good job of hiding the full URL to a video file. A "video asset" item is actually a folder. The folder contains the video and supporting files like preview thumbnails.

So, if you upload a video named butterfly.wmv to http://yourSite/sites/demo/Assets the path to the video would be http://yourSite/sites/demo/Assets/butterfly/butterfly.wmv. If you changed the Name property while uploading the file to "Pretty bugs" the URL would then be http://yourSite/sites/demo/Assets/Pretty%20Bugs/butterfly.wmv.




There are two ways to discover the "real" URL, mouse over a download link or use SharePoint Designer.

Mouse over:
  1. In SharePoint 2013, click the video to display the VideoPlayerPage.aspx page.
  2. Mouse over the DOWNLOAD link and right-click and select Properties.
  3. Copy the Address (URL), paste into Notepad and "un-escape" the SourceUrl parameter. (Not fun!)
 
SharePoint Designer:
  1. Launch SharePoint Designer and open your site.
  2. In the Navigation area click "All Files". (If you don't see All Files then your administrators may have partially locked down SPD.)
  3. In the list of files and folders click the Assets library.
  4. Find and click your video (you will see the "Name" as entered in the file's properties during upload, not the file name.)
  5. Find the video file, right-click it and click Properties.
  6. Copy the Location.
If you just want to display the video in the page using a Media Web Part:
  1. Edit the page.
  2. Click INSERT.
  3. Click Web Part.
  4. From the Media and Content category select Media Web Part and click Add.
  5. Edit the web part (click the web part's dropdown).
  6. From the MEDIA ribbon click Change Media.
  7. Click From SharePoint and navigate to your assets library and pick a video.
 

Two Three ways to upload a video, with TWO THREE different results!

Uploading a file to a library is just uploading a file, right?
The Upload Button
Click the Upload button and the video will be uploaded as a full featured "Asset Library Video"!  A folder will be created with the "Name" entered by the user and the video will be stored in that folder with the original file name.


(I didn't have Silverlight loaded on the test workstation.)
 
The Upload Button (with a duplicate file!)
Here again, Office 365 is different than On Premise. With 365 if you upload the same file again, using the Upload button, you won't get a "Duplicate" error, it will just upload the file as an ordinary library file, but with a default Content Type of "Video Rendition". BUT… click OK and the file disappears! No error messages, just no file in the library! (Best guess… there was a server side error when trying to create the duplicate folder and no error was returned to the user.) With On Premise the upload just seems to freeze and never completes.
 

Drag and Drop (Office 365 / SharePoint Online only!)
Note: This is only a problem in Office 365!
Drag a video from Windows Explorer onto the Asset Library page and you will get a "plain old library file" with the Content Type set to "Image". (Image is the default Content Type.)
  • If you edit the properties of the file you can only change the Content Type to "Image" or "Audio".
  • SharePoint does not stop and ask for any metadata and simply uploads the file and assigns the "Image" Content Type.
  • There is no folder created.
  • Clicking this video only displays its properties. The link there only offers to download it, not display it in the browser.

You can actually upload the same video twice, once as an Asset Library Video and once as a "plain old library file". Remember that the Asset Library Video is really a folder.
 
 
 

Searching Asset Libraries

If you search an asset library by file extension you will not find any Asset Library Videos. You will only file the "plain old library file" videos that were uploaded using Office 365 drag and drop. The examples below are from the library's search box, but you get the same results from the site search box or the Enterprise Search Center.

   
  
Search by file extension will find other file types uploaded to the Asset library:
   
  
Best way to search? Cover all of the bases! Use the Videos vertical in the Enterprise Search Center or the following search (borrowed from the Local Videos result source).

searchKeywordsHere
AND
(
 ContentTypeId:0x0120D520A808* 
 OR ContentTypeId:0x010100F3754F12A9B6490D9622A01FE9D8F012* 
 OR (
     SecondaryFileExtension=wmv OR 
     SecondaryFileExtension=avi OR 
     SecondaryFileExtension=mpg OR 
     SecondaryFileExtension=asf OR 
     SecondaryFileExtension=mp4 OR 
     SecondaryFileExtension=ogg OR 
     SecondaryFileExtension=ogv OR 
     SecondaryFileExtension=webm OR 
     SecondaryFileExtension=mov
    )
)
The first content type for "Video" as found in the Asset libraries. The second content type is for the Office 365 Video Portal videos. The "*" is added to include any content types you create that inherit from these two.


Takeaways



  • In an Asset library there are "videos" and "Asset Library Videos". Which you get depends on how you upload them.
  • "Asset Library Videos" files are well hidden in a folder and their true URLs can only be discovered using SharePoint Designer, PowerShell, code or from the "DOWNLOAD" link in the videoplayerpage.aspx page.
  • Searching for videos where the videos could be in a library, an Asset Library or an Office 365 Video Portal is best done using the "Videos" vertical in the Enterprise Search Center.


.

5 comments:

HY said...

Another weird thing:
When you create a new asset library it's all good - uploading a video using the Upload button works fine and etc. Then you open the asset library in Windows Explorer (using IE) and create a folder and/or drag&drop some pictures in it. Then the Upload button stops working properly for videos - videos are now uploaded as a Picture content type. What the heck?!

Mike Smith said...

Hristo,

Windows Explorer view just sees the Asset library as a general library. The video "magic" is not available from there. Same problem occurs when uploading using SharePoint Designer. The uploaded files are just files, not videos.

Mike

Roman K said...

Hi there!

"Asset Library Video" is not a folder but a document set.
And the weirdest thing for me is that when you open the "video" document set server will redirect you to the folder "Additional Content" which is created inside the set when you upload "Asset Library Video". And I can't understand where does this magic happen.

Here is the simple log:

GET
.../TestAssetsLib/Test%20clip

HTTP 302 Redirect
Location:
.../_layouts/15/DocSetHome.aspx?id=/TestAssetsLib/Test%20clip&RootFolder=/TestAssetsLib/Test%20clip

GET
.../_layouts/15/DocSetHome.aspx?id=/TestAssetsLib/Test%20clip&RootFolder=/TestAssetsLib/Test%20clip

HTTP 302 Found
Location:
.../TestAssetsLib/Forms/Video/videoplayerpage.aspx?ID=4&FolderCTID=0x0120D520A8080048096958098E9546A5AF9E5EF12F8411&List=c4fdc911-1976-4016-84dc-d09c5e4b6dd5&RootFolder=/TestAssetsLib/Test%20clip/Additional%20Content&RecSrc=/TestAssetsLib/Test%20clip

GET
.../TestAssetsLib/Forms/Video/videoplayerpage.aspx?ID=4&FolderCTID=0x0120D520A8080048096958098E9546A5AF9E5EF12F8411&List=c4fdc911-1976-4016-84dc-d09c5e4b6dd5&RootFolder=/TestAssetsLib/Test%20clip/Additional%20Content&RecSrc=/TestAssetsLib/Test%20clip

HTTP 200 OK

Roman K said...

I've put some thoughts about it in blog https://akupaka.blogspot.com/2017/11/asset-library-video-content-type.html

Mike Smith said...

akupaka,

Thanks for the info!

My guess is that there is an event receiver on the Document Set folders that's doing the "magic".

Mike

Note to spammers!

Spammers, don't waste your time... all posts are moderated. If your comment includes unrelated links, is advertising, or just pure spam, it will never be seen.