×

Discussion Board

Results 1 to 12 of 12
  1. #1
    Registered User
    Join Date
    Oct 2012
    Posts
    120

    Cool How the videos in NewsReader web application are playing whic is asample provided.

    How the videos in NewsReader web application are playing whicf is asample provided. What is the format of the video played in it.


    Where can I find the code for playing the video in the WebApplication "NewsRedaer" code.

  2. #2
    Super Contributor
    Join Date
    Jun 2008
    Location
    Tampere
    Posts
    833

    Re: How the videos in NewsReader web application are playing whic is asample provide

    Hi,

    There are no tricks needed for playing the video. You just need to find out a link for suitable video and open it with mwl.loadURL.
    If you want sources for video app, check out http://xpresswebapps.nokia.com. Make a new app, download it and modify to suit your needs.

    It seems to use 3GP and for devices that support streaming, rtsp:// is available.

    Br,
    Ilkka

  3. #3
    Registered User
    Join Date
    Oct 2012
    Posts
    120

    Re: How the videos in NewsReader web application are playing whic is asample provide

    Can u please help me with the exact code. Actually I have parsed xml.aspx file conatining channel mages and names .Now I need to play the url contained in xml.aspx.

    My url wil be like :

    rtsp://cdn.m.yuppcdn.net/liveorigin/aajtak1

  4. #4
    Super Contributor
    Join Date
    Jun 2008
    Location
    Tampere
    Posts
    833

    Re: How the videos in NewsReader web application are playing whic is asample provide

    Hi,

    Please note that supported codecs and containers varies in Series 40 devices. Safe bet is to use 3GPP container using H.263 and MPEG-4 SP codecs/profiles.

    The actual code you need is:
    Code:
    <a href="#" onclick="mwl.loadURL('<stream_URL>');">My Video</a>
    Br,
    Ilkka

  5. #5
    Registered User
    Join Date
    Nov 2010
    Posts
    1,169

    Re: How the videos in NewsReader web application are playing whic is asample provide

    where in the code of the application do we need to put this code ?


    I mean in main.js?

    .css ?


    My code in main.js is as follows

    generateHTMLMarkup: function(i, channel){

    var str ="";
    str += "<div class='ui-category-list-item-title-for-Global-Takeof'\">";
    str += "<img class='img-for-Global-Takeof' src=\"" + channel['image'] + "\" />" +
    "<a href=\"" + channel['link'] + "\">" + channel['name'] + "</a>" + "</div>";
    return str;

    },

  6. #6
    Registered User
    Join Date
    Nov 2010
    Posts
    1,169

    Re: How the videos in NewsReader web application are playing whic is asample provide

    Please correct the code

    generateHTMLMarkup: function(i, channel){

    var str ="";
    str += "<div class='ui-category-list-item-title-for-Global-Takeof'\">";
    str += "<img class='img-for-Global-Takeof' src=\"" + channel['image'] + "\" />" +
    "<a href="#" onclick="mwl.loadURL('<stream_URL>');">My Video</a>
    "<a href=\"" + channel['link'] + "\">" + channel['name'] + "</a>" + "</div>";
    return str;

    },

  7. #7
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,143

    Re: How the videos in NewsReader web application are playing whic is asample provide

    Hi GTO_I as you should have noticed, the css files are meant for just visual theming purposes, so you would not really use them for coding purposes.

    Most logical part would be the js-file, though if your logic is small you could embed the code into your html file as well.

  8. #8
    Registered User
    Join Date
    Oct 2012
    Posts
    120

    Re: How the videos in NewsReader web application are playing whic is asample provide

    Yucca I have parsed the images and the title/name of the channels.

    Can u please give me the code to play the rtsp streams from the xml.aspx file in my application.


    what is the code to play video in the basic news reader application also.


    My code looks like this:


    var xmlDataSource = {

    URL: "http://www.yupptv.com/mobile/symbianxml.aspx",

    init: function() {
    //URL, success callback, failure callback
    this.connect(this.URL, this.responseHandler, this.failureHandler);
    },

    /**
    * Parses XML document into JS Object array
    * @param xmlDoc XML Document
    * @returns {Array} array of device objects
    */
    parseResponse: function(xmlDoc) {

    var chElements = xmlDoc.getElementsByTagName("channel");

    var channels = [];

    console.log(chElements.length);

    for(var i=0; i < chElements.length; i++){

    var channel = { };

    for(var j=0; j < chElements[i].childNodes.length; j++){

    var node = chElements[i].childNodes[j];

    if(node.nodeType != 1){ //not an element node
    continue;
    }

    channel[node.tagName] = node.textContent;
    }

    channels.push(channel);
    }
    console.log(channels.length);
    return channels;
    },

    /**
    * Handles the response, and displays device data in web app
    * @param xmlDoc
    */
    responseHandler: function(xmlDoc) {

    var channels = this.parseResponse(xmlDoc);
    var markup = "";

    for(i=0; i < channels.length; i++){

    markup += this.generateHTMLMarkup(i, channels[i]);
    }
    document.getElementById("accordian").innerHTML = markup;
    },

    /**
    * Generates HTML markup to be inserted in to Web App DOM.
    * @index i, index of the device
    * @param device, device object
    */
    /*
    generateHTMLMarkup: function(i, channel){

    var str ="";
    str += "<div class='ui-category-list-item-title ui-close' id='item_title_"+i+"'" +
    "onclick=\"mwl.setGroupTarget('#accordian','#items_"+i+"', 'ui-show', 'ui-hide'); " +
    "mwl.setGroupTarget('#accordian','#item_title_"+i+"', 'ui-open', 'ui-close'); return false;\">";
    str += "<img src=\""+ channel['image'] +"\" height=100% align=left />" + channel['name'] +"</div>";
    str += "<div class='ui-category-list-item-body ui-hide' id='items_"+i+"'>";
    str += "<div class='ui-list'>";
    str += "<div class='ui-list-item'>"+ "id: " + channel['id'] +"</div>";
    str += "<div class='ui-list-item'>"+ "type: " + channel['type'] +"</div>";
    str += "<div class='ui-list-item'>"+ "language: " + channel['language'] +"</div>";
    str += "<div class='ui-list-item'>"+ "bandwidth: " + channel['bandwidth'] +"</div>";
    str += "<div class='ui-list-item'>"+ "cellnapid: " + channel['cellnapid'] +"</div>";
    str += "<div class='ui-list-item'>"+ "link: " + "<a href=\""+ channel['link']+"\">Start video</a> </div>";
    str += "</div></div>";
    return str;
    },*/
    generateHTMLMarkup: function(i, channel){

    var str ="";
    str += "<div class='ui-category-list-item-title-for-Global-Takeof'\">";
    str += "<img class='img-for-Global-Takeof' src=\"" + channel['image'] + "\" />" +
    "<a href=\"" + channel['link'] + "\">" + channel['name'] + "</a>" + "</div>";
    return str;

    },

    failureHandler: function(reason) {
    document.getElementById("accordian").innerHTML = "Could not get XML document.<br>"+ reason;
    },

    /**
    * Retrieves a XML resource in given URL by using XMLHttpRequest.
    * @param url URL of the XML resource to retrieve
    * @param successCb Called, when the XML resourece is retrieved successfully. Retreived XML Document is passed as argument.
    * @param failCb Called, if something goes wrong. Reason in text format, is passed as argument.
    */

    connect: function(url, successCb, failCb) {

    var xmlhttp = new XMLHttpRequest();

    xmlhttp.open("GET", url, true);

    xmlhttp.setRequestHeader("Accept","text/xml,application/xml");
    xmlhttp.setRequestHeader("Cache-Control", "no-cache");
    xmlhttp.setRequestHeader("Pragma", "no-cache");

    var that = this;
    xmlhttp.onreadystatechange = function() {

    if (xmlhttp.readyState == 4 ){

    if(xmlhttp.status == 200){

    if(!xmlhttp.responseXML){
    try {
    //In case server didn't respond with correct MIME type for a XML file.
    var domParser= new DOMParser();
    var xmlDoc = domParser.parseFromString(xmlhttp.responseText,"text/xml");

    successCb.call(that,xmlDoc);

    } catch (e) {
    failCb.call(that,"Response was not in a XML format.");
    }

    }else{
    successCb.call(that,xmlhttp.responseXML);
    }
    }else{
    failCb.call(that,"Connection failed: Status "+xmlhttp.status);
    }
    }
    };
    xmlhttp.send();
    }
    };

  9. #9
    Registered User
    Join Date
    Nov 2010
    Posts
    1,169

    Re: How the videos in NewsReader web application are playing whic is asample provide

    Yucca Iam waiting for your valuable suggestions and solutions.

  10. #10
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,143

    Re: How the videos in NewsReader web application are playing whic is asample provide

    You are confusing me by using two different accounts. and GTO I did answer for you already, for skumar, I would not have any ready made code which would be exactly made for your project, so you would need to try out help given by Ilkkaa and then explain in details on what is not working there still.

  11. #11
    Registered User
    Join Date
    Oct 2012
    Posts
    120

    Re: How the videos in NewsReader web application are playing whic is asample provide

    My company id is GTO_India and my personal one is SKUMAR. aNYWAY ULTIMATE QUERY IS hOW TO PLAY A RTSP STREAM IN WEBAPP.


    Whether rtsp stream cn be played on s40 devices.

  12. #12
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,143

    Re: How the videos in NewsReader web application are playing whic is asample provide

    You might want to stick on using one ID, otherwise you just get people more confused. For the answer, see what Ilkka said in #4.

Similar Threads

  1. Playing videos using Qt
    By bruiz in forum [Archived] Qt Mobility Project
    Replies: 1
    Last Post: 2011-05-03, 08:42
  2. R their any 3rd party API provided by Nokia for playing AMR or Sound Interjection.
    By amitkumar_j2me in forum Mobile Java Media (Graphics & Sounds)
    Replies: 0
    Last Post: 2005-06-16, 10:50
  3. Replies: 0
    Last Post: 2005-06-16, 10:48
  4. Replies: 0
    Last Post: 2005-06-16, 10:20
  5. Replies: 3
    Last Post: 2005-04-07, 13:55

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •