Skip to main content

YouTube Videos in Cogniss

Learn how to take advantage of URL parameters to control how your YouTube videos appear and how your users can interact with them

Ryan Miller avatar
Written by Ryan Miller
Updated over 8 months ago

When YouTube videos are used in Cogniss, they should be created under a content block using the External Media content type. For more information on this content type, and how to use it, please see this article.

YouTube video base URLs

When getting the URL for a YouTube video, you'll need to extract the URL from the embed version of the URL which can be found within the ‘share’ option on the page of the video.

  1. Open the relevant video on YouTube

  2. Select the ‘share’ option from the navigation beneath the video

  3. Select ‘embed’ option from the top row of the share popup

  4. Extract the ‘embed’ URL from the HTML ( appears with ' ' characters after the src= in the HTML)


Adding Parameters to YouTube Videos

Youtube video URLs can have additional parameters added onto them to help control certain elements of the video player and playback to enhance the user experience of these videos within Cogniss.

How to apply parameters:

Parameters generally should be stacked at the end of a video’s URL (unless they are referenced within the base of the URL). The defaults are built into the standard behavior of a YouTube video, but you can overrule them or force specific behavior by specifying different parameters.

Parameters get stacked by including ‘&PARAMETER=NUMBER’ at the end of a URL. Please note that for the first parameter, the URL should end in a ? and no & is inserted as per the below example:

https://www.youtube.com/embed/VIDEO_ID?     
rel=0
&loop=1
&playlist=VIDEO_ID

i.e. the final URL of the above would be:

https://www.youtube.com/embed/VIDEO_ID?rel=0&loop=1&playlist=VIDEO_ID

Useful parameters in Cogniss:

Parameter

Description

Application

Autoplay

Dictates whether the video auto-plays upon loading. Note: The default behavior is for a video not to autoplay.

autoplay=0 <don’t autoplay>

autoplay=1 <autoplay>

rel

Google made a change in late 2018 blocking the ability to remove the display of related videos from the end of a video after it has finished playing, however, you can (and it is recommended) use this parameter to only show videos from the channel that this video belongs to.

rel=0 <show only vids from current channel>

rel=1 <show related videos>

loop

In the case of a single video player, a setting of 1 causes the player to play the initial video again and again. In the case of a playlist player (or custom player), the player plays the entire playlist and then starts again at the first video.

Supported values are 0 and 1, and the default value is 0.

loop=0 <play once>

loop=1 <play on loop>

start

This parameter causes the player to begin playing the video at the given number of seconds from the start of the video. The parameter value is a positive integer. Note that similar to the seekTo function, the player will look for the closest keyframe to the time you specify. This means that sometimes the play head may seek to just before the requested time, usually no more than around two seconds.

start=10 <starts the video at the 10 sec time stamp>


External Tools:

Here is the full list of parameters that YouTube offers - we at Cogniss have not tested all of them, so we cannot confirm that they all are useful or work within our context

Google also has a tool you can play around with to adjust parameters using a web form. This allows you to see the impact the parameters have on the video and then copy the video URL which includes the defined parameters:

Did this answer your question?