0
votes

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,

1
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
The field you need for length is 'MediaLengthInSeconds'.Markus

1 Answers

1
votes

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