Thread: Java/XML help

  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Rep Power

    Talking Java/XML help

    I'm working on a video player that pulls from an xml playlist. So far I have it success fully pulling from the following xml structure:

    chapter - looping object
    title (video title)
    screen (video location and type)
    description (description of video)

    Here is what I would like to do, but am having difficulty understanding how to set it up properly:

    courseinfo label=" "
    chapter label =" "
    screen label = " " (instead of title) path= " " (url to file) type="video/mp4" /screen

    here is the code that I am using:

    // properties
    var XML_PATH = "xml/screens.xml";
    var video_width;
    var video_height;
    var videos_array=new Array();

    // init the application
    function init()
    // call loadXML function

    // XML loading
    function loadXML()
    type: "GET",
    url: XML_PATH,
    dataType: "xml",
    success: function onXMLloaded(xml)
    // set video_width and video_height

    // loop for each item
    $(xml).find('chapter').each(function loopingItems(value)
    // create an object
    var obj={title:$(this).find("title").text(), screen:$(this).find("screen").text(), description:$(this).find("description").text()};

    // append <ul> and video title
    $("#playlist2").append('<a><li id="chapter"><strong>'+obj.title+'</strong></li></a>');

    // close </ul>
    // append video tag player
    $("#player").append('<video width="600" height="300" controls="controls"><source src="'+videos_array[0].screen+'" type="video/mp4" />Your browser does not support the video tag.</video>');
    // append description

    // call addListeners function

    // add <li> listener
    function addListeners()
    // loop for each list item
    $('#playlist2 li').each(function looping(index)
    // onclick...
    $(this).click(function onItemClick()
    // empty left column and description
    // append video tag
    $("#player").append('<video width="600" height="300" controls="controls"><source src="'+videos_array[index].screen+'" type="video/mp4" />Your browser does not support the video tag.</video>');
    // append description
    Also, I want to display the course info lable in a box called #courseinfo.
    The player is set up with the video element on top, then I've been trying to put in the courseinfo under that, then the description, then the actual playlist.

    any help would be much appreciated
  2. #2
  3. Contributing User
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Aug 2010
    Eastern Florida
    Rep Power
    Try a javascript forum. This one is for java

IMN logo majestic logo threadwatch logo seochat tools logo