大神解救,帮我把每一句的注释写出来
mui.previewImage();
var photoFile;
var videoFile;
var videoEmptyLi = document.getElementById("videoEmptyLi");
var videoList = document.getElementById("videoList");
window.onload = function(){
mui.plusReady(function(){
photoFile = mui.currentWebview.photoFile;
videoFile = mui.currentWebview.videoFile;
initRecord(recordFile);
initPhoto(photoFile);
initVideo(videoFile);
});
}
function initVideo(paths){
for(var i=0;i<paths.length;i++){
plus.io.resolveLocalFileSystemURL(paths[i],function(entry){
createVideoItem(entry);
},getFileError);
}
}
function initPhoto(paths){
if(paths.length>0){
document.getElementById("pempty").style.display = 'none';
}
for(var i=0;i<paths.length;i++){
plus.io.resolveLocalFileSystemURL(paths[i],function(entry){
createPhoto(entry);
},getFileError);
}
}
var photoList = document.getElementById("photoList")
function createPhoto(entry){
var li = document.createElement("li");
li.className = 'mui-table-view-cell mui-media mui-col-xs-4';
li.innerHTML = '<img class="mui-col-xs-12" style="height: 20%;" src="'+entry.fullPath+'" '
+'data-preview-src="" data-preview-group="1">';
photoList.appendChild(li);
}
function getFileError(e){
alert(e.message);
}
function createVideoItem( entry ) {
var li = document.createElement("li");
li.className = "ditem";
li.innerHTML = '<span class="iplay"><font class="aname"></font><br/><font class="ainf"></font></span>';
li.setAttribute( "onclick", "playVideo(this);" );
videoList.appendChild(li);
li.querySelector(".aname").innerText = entry.name;
li.querySelector(".ainf").innerText = "...";
li.entry = entry;
updateInformation( li );
videoEmptyLi.style.display = "none";
}
var vDiv = document.getElementById("videoView");
var v = document.getElementById("video");
function playVideo(li){
var path = li.entry.fullPath;
v.src = path;
vDiv.style.display = 'block';
v.play();
}
function playVideoEnd(){
vDiv.style.display='none';
}
function _pause(btn){
if(v.paused){
v.play();
btn.innerText = "暂停";
}else{
v.pause();
btn.innerText = "开始";
}
}
function _back(){
v.pause();
vDiv.style.display = 'none';
}