代码如下:
<HTML>
<HEAD><TITLE>Playback Example</TITLE>
</HEAD>
<BODY>
<script language="JavaScript">
function addmedia(url)
{
// Player.controls.stop(); //停止播放器
// alert(Player.versionInfo); //播放器的版本信息
//取得向Player对象的播放列表中添加媒体的权限
document.getElementById("MediaPlayer").settings.requestMediaAccessRights("full");
// 取得当前的播放列表
var playlist=MediaPlayer.currentPlaylist;
//新建一个指定URL的Media
var currMedia = MediaPlayer.newMedia(url);
//把新建的Media item添加到播放器列表
playlist.appendItem(currMedia);
}
function clearlist()
{
//MediaPlayer.currentPlaylist.count返回列表中的歌曲数量
while(MediaPlayer.currentPlaylist.count>0) {
var item =MediaPlayer.currentPlaylist.item(MediaPlayer.currentPlaylist.count-1);
MediaPlayer.currentPlaylist.removeItem(item); // 从播放列表中删除项
}
}
function addSeletedSongToPlayList()
{
clearlist();
var selectItem = document.getElementsByName("song");
新闻热点
疑难解答
图片精选