0

Here is my setup, and I'm in an-premise SharePoint 2013 environment:

  1. Asset Library (OOTB)
  2. "Video" Content Type Applied (OOTB)
  3. Video file uploaded and default rendition created
  4. CQWP (OOTB) Filtering by content type (Video)

The CQWP query properties:

web part configuration

The result, using a ShowXML item style, is the following data. Notice how the path to the actual video file is not referenced:

xml data returned for "video" item

There is some missing data from this view. I cannot find the right column names to type in the "Fields to display" to get the following items:

  • Frame Width (Found) VideoWidthInPixels
  • Frame Height (Found) VideoHeightInPixels
  • Length (Found) MediaLengthInSeconds
  • Video File URL

I understand if I navigate to the FileRef that I get redirected to a page that renders the video, but we need the videos output by a CQWP to build an html5 player directly on the page - without silverlight.

Thanks for any help you guys can provide,

Markus
  • 689
  • 1
  • 7
  • 14
  • I've since found some of the missing information. Frame Width is 'VideoWidthInPixels', and Frame Height is 'VideoHeightInPixels'. Using these in a CQWP / Item Style will get the width / height of the video. – Markus Apr 18 '14 at 16:33
  • The field you need for length is 'MediaLengthInSeconds'. – Markus Apr 18 '14 at 17:08

1 Answers1

1

The Content Query Web Part does not return all fields for all items automatically. You can use the CommonViewFields property to request specific fields to render.

Steps:

1) Export CQWP

In order to render VideoHeightInPixels and VideoWidthInPixels properties locate the CommonViewFields property in the .webpart file, and then edit it to look like the following:

<property name="CommonViewFields" type="string" >VideoHeightInPixels, Integer;VideoWidthInPixels, Integer</property>

This markup requests the VideoHeightInPixels and VideoWidthInPixelscolumns, to make the data in the columns available for rendering. Each internal column name is specified, followed by its data type. The name/type pairs are separated by semicolons.

2) Save the modified .webpart file and upload it

Video Content Type

Since Video content type (called Video Set) is derived from Document Set content type, when the video asset is uploaded the new Video Set (Folder) is being created.

FileRef format:

/<weburl>/<assetsname>/<videosetname>/<filename>

where videosetname is automatically generated based on the uploaded file name, for example:

/media/Video Archive/Wildlife_512kb/Wildlife_512kb.mp4

How to configure CQWP to render video files from Assets Library

In order to render video files from Assets library specify the following query

Content Type: Video Rendition

enter image description here

Vadim Gremyachev
  • 57,952
  • 20
  • 129
  • 193
  • Thanks Vadim - I was able to find those fields and use them correctly. However there is one more site column I'm unable to identify - the site column used to store the filename. FileLeafRef unfortunately returns the filename of the file containing the content type info. That may be a little confusing - but if I upload a video with the title of "Legos" then there will a file "Site Assets/Legos" which is returned in the FileLeafRef site column, but the location of the mp4 file is actually "Site Assets/Legos/original-filename.mp4". Does that make sense? – Markus Apr 19 '14 at 01:11
  • Markus, since Video content type is derived from Document Set content type, when the video asset is uploaded the new Document Set is being created. – Vadim Gremyachev Apr 19 '14 at 15:28
  • thanks so much! I'm looking into the FileRef to see if I get any of the data back. I can't connect to the env just yet, but will mark your answer as soon as I test this afternoon. – Markus Apr 21 '14 at 14:30
  • FileRef, used within a CQWP, is returning the path to the folder (sp 2013) and not including the filename of the file. So in my example above, with a video titled 'Test Lego Video'. The FileRef returns "sites/mdrake/SiteAssets/Test Lego Video", and not "sites/mdrake/SiteAssets/Test Lego Video/small.mp4" which is the file I uploaded. Is there any way to get the remainder of what's missing... "small.mp4"? – Markus Apr 21 '14 at 14:52
  • That's correct, FileRef returns the path to Video Set, not the files itself since CQWP is configured to retrieve Video content type. In order to return the location of files, you have to modify the query. Please check an updated answer for a details (section: How to configure CQWP to render video files from Assets Library) – Vadim Gremyachev Apr 24 '14 at 21:08