Browse Source

video play button improve

master
filesite 4 months ago
parent
commit
0fad1af1d7
  1. 4
      themes/beauty/views/site/index.php
  2. 2
      www/js/beauty.js

4
themes/beauty/views/site/index.php

@ -268,7 +268,7 @@ eof;
{$title} {$title}
</span> </span>
</div> </div>
<img src="/img/video-play.svg" class="playbtn" alt="video play button"> <img src="/img/video-play.svg" class="playbtn hide" alt="video play button">
<span class="duration">00:00:00</span> <span class="duration">00:00:00</span>
</a> </a>
</div> </div>
@ -304,7 +304,7 @@ eof;
{$title} {$title}
</span> </span>
</div> </div>
<img src="/img/video-play.svg" class="playbtn" alt="video play button"> <img src="/img/video-play.svg" class="playbtn hide" alt="video play button">
<span class="duration">00:00:00</span> <span class="duration">00:00:00</span>
</a> </a>
</div> </div>

2
www/js/beauty.js

@ -259,6 +259,7 @@ if ($('#pr-player').length > 0 && typeof(videojs) != 'undefined') {
if (duration && snapshotImg && /^data:image\/.+;base64,/i.test(snapshotImg)) { if (duration && snapshotImg && /^data:image\/.+;base64,/i.test(snapshotImg)) {
$('#poster_'+mc_video_id).attr('src', snapshotImg); $('#poster_'+mc_video_id).attr('src', snapshotImg);
$('#poster_'+mc_video_id).parent('a').find('.duration').text(formatDuration(duration)); $('#poster_'+mc_video_id).parent('a').find('.duration').text(formatDuration(duration));
$('#poster_'+mc_video_id).parent('a').find('.playbtn').removeClass('hide');
saveVideoMeta(mc_video_id, { saveVideoMeta(mc_video_id, {
duration: duration, duration: duration,
@ -289,6 +290,7 @@ var getVideoMetaAndShowIt = function(videoId, videoUrl) {
}else { }else {
$('#poster_'+videoId).attr('src', data.meta.snapshot); $('#poster_'+videoId).attr('src', data.meta.snapshot);
$('#poster_'+videoId).parent('a').find('.duration').text(formatDuration(data.meta.duration)); $('#poster_'+videoId).parent('a').find('.duration').text(formatDuration(data.meta.duration));
$('#poster_'+videoId).parent('a').find('.playbtn').removeClass('hide');
} }
}).fail(function(jqXHR, textStatus, errorThrown) { }).fail(function(jqXHR, textStatus, errorThrown) {
console.error('视频数据获取失败,错误信息:' + errorThrown); console.error('视频数据获取失败,错误信息:' + errorThrown);

Loading…
Cancel
Save