<style type="text/css">
.jwrapbuttons {
max-width: 330px;
margin: 0 auto;
}
.jwbutton {
font-weight: bold;
font-size: 8px;
padding: 10px 30px;
border: 2px solid #FFFFFF;
color: #FFFFFF;
display: inline-block;
text-decoration: none;
margin: 50px 10px;
background: #FFFFFF(255, 0, 0, 0.3);
}
.videobgelement {
position: fixed !important;
z-index: -1;
top: 0;
left: 0;
}
</style>
<script src="https://content.jwplatform.com/libraries/yOuB4gP3.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script>
<script type="text/javascript" src="js/jwplayer.js"></script>
<script type="text/javascript">
$(function () {
$(document.body).wrapInner('<div class="bgvideodata"/>');
$(document.body).prepend($('<div class="videobgelement"><div id="videobgelement"></div></div>'));
//set browser video height and browser height
var ww = $(window).width();
var wh = $(window).height();
jwplayer("videobgelement").setup({
autostart: 1,
controls: 0,
width: ww,
height: wh,
//skin:'jwplayer/jwplayer-skins-free/five.xml',
'shuffle': 'true',
'repeat': 'true',
playlist: [
{file: "https://www.youtube.com/watch?v=qHm9MG9xw1o", image: "http://img.youtube.com/vi/qHm9MG9xw1o/0.jpg"},
{file: "https://www.youtube.com/watch?v=pBsQVP-Olmw", image: "http://img.youtube.com/vi/pBsQVP-Olmw/0.jpg"},
],
});
//buttons part
$('.container').prepend('<div class="jwrapbuttons"><a href="#" class="jwbutton" id="jqbuttonpause">pause</a> <a href="#" class="jwbutton" id="jwbuttonmute">mute</a></a></div>');
$('#jqbuttonpause').click(function (e) {
e.preventDefault();
//$(document).attr('title', function (i,val){ return ''; + val; });
jwplayer().pause();
});
$('#jwbuttonmute').click(function (e) {
e.preventDefault();
jwplayer().setMute();
})
});
//be responsive
$(window).resize(function () {
var ww = $(this).width();
var wh = $(this).height();
$('.videobgelement>div').width(ww + 'px');
$('.videobgelement>div').height(wh + 'px');
});
</script>
<div class="container"></div>
샘플 http://honeymusic.kr
쇼핑몰이나 홍보용으로 용의 할듯 해서 올려 봅니다.
.jwrapbuttons {
max-width: 330px;
margin: 0 auto;
}
.jwbutton {
font-weight: bold;
font-size: 8px;
padding: 10px 30px;
border: 2px solid #FFFFFF;
color: #FFFFFF;
display: inline-block;
text-decoration: none;
margin: 50px 10px;
background: #FFFFFF(255, 0, 0, 0.3);
}
.videobgelement {
position: fixed !important;
z-index: -1;
top: 0;
left: 0;
}
</style>
<script src="https://content.jwplatform.com/libraries/yOuB4gP3.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script>
<script type="text/javascript" src="js/jwplayer.js"></script>
<script type="text/javascript">
$(function () {
$(document.body).wrapInner('<div class="bgvideodata"/>');
$(document.body).prepend($('<div class="videobgelement"><div id="videobgelement"></div></div>'));
//set browser video height and browser height
var ww = $(window).width();
var wh = $(window).height();
jwplayer("videobgelement").setup({
autostart: 1,
controls: 0,
width: ww,
height: wh,
//skin:'jwplayer/jwplayer-skins-free/five.xml',
'shuffle': 'true',
'repeat': 'true',
playlist: [
{file: "https://www.youtube.com/watch?v=qHm9MG9xw1o", image: "http://img.youtube.com/vi/qHm9MG9xw1o/0.jpg"},
{file: "https://www.youtube.com/watch?v=pBsQVP-Olmw", image: "http://img.youtube.com/vi/pBsQVP-Olmw/0.jpg"},
],
});
//buttons part
$('.container').prepend('<div class="jwrapbuttons"><a href="#" class="jwbutton" id="jqbuttonpause">pause</a> <a href="#" class="jwbutton" id="jwbuttonmute">mute</a></a></div>');
$('#jqbuttonpause').click(function (e) {
e.preventDefault();
//$(document).attr('title', function (i,val){ return ''; + val; });
jwplayer().pause();
});
$('#jwbuttonmute').click(function (e) {
e.preventDefault();
jwplayer().setMute();
})
});
//be responsive
$(window).resize(function () {
var ww = $(this).width();
var wh = $(this).height();
$('.videobgelement>div').width(ww + 'px');
$('.videobgelement>div').height(wh + 'px');
});
</script>
<div class="container"></div>
샘플 http://honeymusic.kr
쇼핑몰이나 홍보용으로 용의 할듯 해서 올려 봅니다.
댓글 8개
게시글 목록
| 번호 | 제목 |
|---|---|
| 23606 | |
| 23598 | |
| 23585 | |
| 23579 | |
| 23578 | |
| 23564 | |
| 23550 | |
| 23549 | |
| 23548 | |
| 23529 | |
| 23510 | |
| 23507 | |
| 23481 | |
| 23471 | |
| 23453 | |
| 23452 | |
| 23450 | |
| 23436 | |
| 23428 | |
| 23404 | |
| 23396 | |
| 23389 | |
| 23380 | |
| 23369 | |
| 23350 | |
| 23337 | |
| 23317 | |
| 23307 | |
| 23298 | |
| 23290 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기