XML file does't load when HTML5 video plays
- by DD77
I should be able to loads the related XML file and displays the content of the XML file as the video plays back.
What am I missing?
DEMO
JAVSCRIPT
// properties
var XML_PATH = "http://www.adjustyourset.tv/interview/cuepoints.xml";
var video_width;
var video_height;
var videos_array=new Array();
// init the application
function init()
{
// call loadXML function
loadXML();
}
// XML loading
function loadXML()
{
$.ajax({
type: "GET",
url: XML_PATH,
dataType: "xml",
success: function onXMLloaded(xml)
{
// set cuepoints
find("cuepoints");
find("cuepoints");
// loop for each cuepoint
$(xml).find('cuepoint').each(function loopingItems(value)
{
// create an object
var obj={timeStamp:$(this).find("timeStamp").text(), desc:$(this).find("desc").text(), thumbLink:$(this).find("thumbLink").text(), price:$(this).find("price").text()};
videos_array.push(obj);
// append <ul> and timeStamp
$("#mycustomscroll").append('<ul>');
$("#mycustomscroll").append('<a><li id="item">Time Stamp:'+obj.timeStamp+'</li></a>');
});
// close </ul>
$("#mycustomscroll").append('</ul>');
// append li tags
$("#leftcolumn").append('<li src="'+videos_array[0].desc+'"> <p src="'+videos_array[0].thumbLink+'" /></li>');
// append description
$("#price").append(videos_array[0].price);
// call addListeners function
addListeners();
}
});
}