0

我是 tvML 的新手,所以我很可能错过了一些简单的东西......脚本运行良好,没有错误,视频播放,mediaItemWillChange 事件永远不会触发再次播放视频。这是我的 tvJS 代码,任何建议将不胜感激。

App.onLaunch = function (options) {
var video = new MediaItem('video', 'https://localhost/file_example_MP4_1920_18MG.mp4');

var player = new Player();

var playlist = new Playlist();
player.playlist = playlist;
player.playlist.push(video);

var parser = new DOMParser();
var alertString = '<?xml version="1.0" encoding="UTF-8" ?>'
    + '<document>'
    + '<alertTemplate>'
    + '</alertTemplate>'
    + '</document>';
var alertDoc = parser.parseFromString(alertString, "application/xml");  

player.interactiveOverlayDocument = alertDoc;
player.interactiveOverlayDismissable = false;

player.addEventListener("mediaItemWillChange", function (e) {
    player.playlist.push(video);
});

player.play();
}
4

0 回答 0