YAHOO webplayer (MediaPlayer) and ajax

北慕城南 提交于 2019-12-23 02:43:36

问题


Use new MediaPlayer by Yahoo. Content parse automatic - greate, but I use ajax content load and have some problem when new data loaded to page. How display or create player by hand?

Example: open http://dopisalki.ru/art/ and click first element in list (http://dopisalki.ru/art/10/). Now we are on page http://dopisalki.ru/art/10/ loaded by ajax and we have no player. Press f5 and see the player.


回答1:


found this http://mediaplayer.yahoo.com/api/

now call function with

YAHOO.MediaPlayer.addTracks(document.getElementById("ajazload"),1,false));

and the player will be showed

p.s. function YAHOO.MediaPlayer.addTracks

function (domElem, index, clear) {
    var mediaTracks = this.controller.parser.parse(domElem);
    if (clear === true) {
        this.controller.playlistmanager.clear();
        return this.controller.playlistmanager.insert(mediaTracks);
    } else {
        return this.controller.playlistmanager.insert(mediaTracks, index);
    }
}


来源:https://stackoverflow.com/questions/7660020/yahoo-webplayer-mediaplayer-and-ajax

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!