Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

Having trouble with Vidyard playlist example

Advocate ,
Dec 19, 2016 Dec 19, 2016

Copy link to clipboard

Copied

Hey all,

Like the title says I'm having some trouble with a working video playlist demo from Vidyard. There seems to be some javascript errors but I'm quite unfamiliar with these. The working demo from Vidyard works perfectly but the code provided brings errors. I've loaded it into codepen and on page load the first video works but clicking either link brings more errors. Below is a link to the demo and below that is a link to codepen.

https://www.vidyard.com/blog/video-players-demand-page-performance/#main

http://codepen.io/anon/pen/NbozJp

Thanks in advance,

Views

535
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Dec 19, 2016 Dec 19, 2016

Try the code below:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>

<script>

function getEmbedCode(uuid) {

var script=document.createElement('script');

script.type='text/javascript';           

script.id='vidyard_embed_code_'+uuid;

script.src='https://play.vidyard.com/'+uuid+'.js?v=3.1&type=inline';  

return script;

}

function changePlayer(modalid,uuid) {

document.getElementById(modalid).innerHTML = "";

$("#"+modalid).append(getEmbedCode(uuid));

}

</script>

<ul>

<li><

...

Votes

Translate
LEGEND ,
Dec 19, 2016 Dec 19, 2016

Copy link to clipboard

Copied

Try the code below:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>

<script>

function getEmbedCode(uuid) {

var script=document.createElement('script');

script.type='text/javascript';           

script.id='vidyard_embed_code_'+uuid;

script.src='https://play.vidyard.com/'+uuid+'.js?v=3.1&type=inline';  

return script;

}

function changePlayer(modalid,uuid) {

document.getElementById(modalid).innerHTML = "";

$("#"+modalid).append(getEmbedCode(uuid));

}

</script>

<ul>

<li><a href="javascript:void(0);" onclick="changePlayer('video_container_9RcFEGMolLKHMGxMCuMcWg','hedIuHeKRKySm1qx9xXV7w');">Video 1</a></li>

<li><a href="javascript:void(0);" onclick="changePlayer('video_container_9RcFEGMolLKHMGxMCuMcWg','9RcFEGMolLKHMGxMCuMcWg');">Video 2</a></li>

</ul>

<div style="height: 360px;">

<div id="video_container_9RcFEGMolLKHMGxMCuMcWg">

<script type="text/javascript" id="vidyard_embed_code_9RcFEGMolLKHMGxMCuMcWg" src="//play.vidyard.com/9RcFEGMolLKHMGxMCuMcWg.js?v=3.1&type=inline"></script>

</div>

</div>

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Dec 19, 2016 Dec 19, 2016

Copy link to clipboard

Copied

Thanks for the reply. Unfortunately I'm getting the same results as before. The first video plays but if any of the links are clicked the video disappears.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 19, 2016 Dec 19, 2016

Copy link to clipboard

Copied

Boss DJ wrote:

Thanks for the reply. Unfortunately I'm getting the same results as before. The first video plays but if any of the links are clicked the video disappears.

I just tested the script and it works fine for me.......are you waiting long enough for the 2nd video to appear. For me it appears instantly but if you have dodgy connection is may take a few seconds to load.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Dec 19, 2016 Dec 19, 2016

Copy link to clipboard

Copied

Yeah. I just get a javascript void error. Here is an updated pen.


http://codepen.io/anon/pen/QGYzMR

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 19, 2016 Dec 19, 2016

Copy link to clipboard

Copied

Have you tried the script on your own server?

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Dec 19, 2016 Dec 19, 2016

Copy link to clipboard

Copied

Locally and on my work's server. Same result.

Sent from my BlackBerry 10 smartphone.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 19, 2016 Dec 19, 2016

Copy link to clipboard

Copied

Boss DJ wrote:

Locally and on my work's server. Same result.

Sent from my BlackBerry 10 smartphone.

I'm not sure why that is then, the code works ok on the vidyard server and on my server.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Dec 19, 2016 Dec 19, 2016

Copy link to clipboard

Copied

LATEST

Ok I'll have to look into it more then. Thanks for your help. I'll update this thread when I figure out the issue.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines