Skip to main content

Adding YouTube Videos to Your App

Learn how to add YouTube videos using the External Media content type

Written by Vivian Zhang

YouTube videos can be added to your app in Cogniss using the External Media content type. For more information on this content type, and how to use it, please see this article.

When adding a YouTube video, you can simply use the video's URL, as Cogniss supports direct YouTube URLs. Alternatively, you can use an embedded URL if you require specific playback or embed settings.

Standard YouTube Video Integration

  1. Copy the Video URL from youtube

    1. Open the relevant video on YouTube, then copy the video URL directly from your browser's address bar.

    2. Or, Open the relevant video on YouTube, click Share below the video, then select Copy to copy the video URL.

  2. Insert the URL into Cogniss Creator

  3. Paste the copied video URL into the External Media content block in the Media embed URL field.

  4. Save your changes.

Customised YouTube Video Integration Using Playback Parameters

Another method of using YouTube videos in Cogniss is by embedding YouTube videos with additional playback parameters. These parameters allow you to customise specific video player settings and playback behaviours, creating a more tailored viewing experience for users.

To use playback parameters, you 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)


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?