JavaScript How do I change a div with the video's title when a relevant video is clicked? change video with,change song with video,change video format,

I'm trying to have a div with the currently playing video's title change when a user clicks a relevant video (when the video ends), so that the correct title is displayed. The problem is, I don't see anything in the api that alerts me that the video has changed. Is there an event I can listen for to detect that the source has changed?

I'm not sure it'll help, but this is what I have currently:

var player;

function onYouTubeIframeAPIReady() {
  player = new YT.Player('player', {
    height: '390',
    width: '640',
    videoId: 'BOMWNgejuPc',
    playerVars: {
      // 'controls': 0,
      'autoplay': 0,
      'disablekb': 1,
      'enablejsapi': 1,
      'fs': 1,
      'iv_load_policy': 3,
      // 'rel': 0,
      'showinfo': 0
    },
    events: {
      'onReady': onPlayerReady,
    }
  });
}

function onPlayerReady(event) {
  // Update title with current video title
  $('#title').text(player.getVideoData().title);
}
<h3 id="title">Title</h3>
<div id="player"></div>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script defer type="text/javascript" src="https://www.youtube.com/iframe_api"></script>
Answer:1

I have two li's which, by using javascript, is the same width of a certain li. The li is fluid css so it changes according to the browser width. The li becomes the same width as the other li when I ...

I have two li's which, by using javascript, is the same width of a certain li. The li is fluid css so it changes according to the browser width. The li becomes the same width as the other li when I ...

<ul id="bad-drifting"> <li>text</li> </ul> http://jsfiddle.net/wZ8MC/2/ jQuery(document).ready(function() { if (jQuery('#bad-drifting').has('em')) { jQuery('#...

<ul id="bad-drifting"> <li>text</li> </ul> http://jsfiddle.net/wZ8MC/2/ jQuery(document).ready(function() { if (jQuery('#bad-drifting').has('em')) { jQuery('#...

I am merely looking for some help as a newbie learning webdesign, please understand I am still in the very early stages of learning when answering my question. I have the following: <script src="...

I am merely looking for some help as a newbie learning webdesign, please understand I am still in the very early stages of learning when answering my question. I have the following: <script src="...

  1. javascript jquery image carousel
  2. jquery script for zooming image on mouseover
  3. javascript jquery image

I am fairly new to using SugarCRM and I am just trying to do some validation on a form page I have. I am simply trying to get the value of my dropdown, and perform my error if it is equal to "None" ...

I am fairly new to using SugarCRM and I am just trying to do some validation on a form page I have. I am simply trying to get the value of my dropdown, and perform my error if it is equal to "None" ...

  1. variable dropdown selected value