Browse Source

auto show video snapshot

master
filesite 4 months ago
parent
commit
65b91916f1
  1. 9
      www/js/beauty.js

9
www/js/beauty.js

@ -254,16 +254,23 @@ if ($('#pr-player').length > 0 && typeof(videojs) != 'undefined') { @@ -254,16 +254,23 @@ if ($('#pr-player').length > 0 && typeof(videojs) != 'undefined') {
ctx.drawImage( video, 0, 0, canvas.width, canvas.height );
var snapshotImg = canvas.toDataURL('image/jpeg');
//更新视频封面图和视频时长
$('#poster_'+mc_video_id).attr('src', snapshotImg);
$('#poster_'+mc_video_id).parent('a').find('.duration').text(formatDuration(myPlayer.duration()));
saveVideoMeta(mc_video_id, {
duration: myPlayer.duration(),
snapshot: snapshotImg
});
mc_video_id = null;
tryToGetVideoSnapshot(); //go next
}
});
setInterval(tryToGetVideoSnapshot, 1000);
setInterval(tryToGetVideoSnapshot, 500);
}
//视频列表封面图加载

Loading…
Cancel
Save