Video Player Problem

canozpey2
Offline
Last seen: 11 months 1 week ago
Wed, 07/20/2016 - 18:48
#1
Video Player Problem

Hello

On course-intro page, video player does not working when i click play. How can i fix it?

Thanks

<div class="video-course-intro">
<div class="inner">
<div class="video-place">
<div class="img-thumb">
<img src="images/thumb-intro.jpg" alt="">
</div>
<div class="awe-overlay"></div>
<a href="#" class="play-icon">
<i class="fa fa-play"></i>
</a>
</div>
<div class="video embed-responsive embed-responsive-16by9">
<iframe src="//player.vimeo.com/video/100872038" class="embed-responsive-item">
</iframe>
</div>
</div>
<div class="price">
Free
</div>
<a href="#" class="take-this-course mc-btn btn-style-1">Take this course</a>
</div>

linhpeter0508
linhpeter0508's picture
Offline
Last seen: 1 week 1 day ago
Thu, 07/21/2016 - 10:39

Hi,

You save this code the last line in script.js:

function playVideo() {
$('[data-init="play-video"]').click(function(e){
e.preventDefault();
var addPlay = $(this).closest('.video').find('iframe').attr('src');
var _vimeo = addPlay.indexOf('vimeo');
var res = addPlay.substring(_vimeo, (_vimeo + 5));


$(this).parent().hide();


if (res == 'vimeo') {
$(this).closest('.video').find('iframe').attr('src', addPlay + '?autoplay=1');
} else {
$(this).closest('.video').find('iframe').attr('src', addPlay + '&autoplay=1');
}
});
};
playVideo();

and add data-init="play-video"in button play video.

<a href="#" class="play-icon" data-init="play-video">
<i class="fa fa-play"></i>
</a>

Log in or register to post comments