XML file does't load when HTML5 video plays

Posted by DD77 on Stack Overflow See other posts from Stack Overflow or by DD77
Published on 2012-11-13T16:41:55Z Indexed on 2012/11/13 17:00 UTC
Read the original article Hit count: 198

Filed under:
|
|
|

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();
            }
    });
}

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery