Собственно интересует как устроен плеер у резки, у них есть такая заглушка с кодом
и сам плеер но база от moonwalk
Как у них это сделано? кто-то может реализовать такое ?
Код:
<!DOCTYPE html>
<html lang="ru" dir="ltr">
<head>
<meta charset="utf-8">
<title>PLAYER</title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
<script src="http://craftapponline.com/player/uppod.js?v=6"></script>
<script src="http://craftapponline.com/player/video.js?v=6"></script>
<style>
html,
body {
background: transparent;
margin: 0;
padding: 0;
}
html {
overflow: hidden;
}
body {
color: #000;
font: 12px Arial,sans-serif;
height: 100%;
line-height: 1;
overflow: hidden;
position: absolute;
text-align: left;
text-align: start;
width: 100%;
-webkit-tap-highlight-color: rgba(0,0,0,0);
}
#MT_overroll,
.hd-player {
height: 100%;
margin: 0;
overflow: hidden;
padding: 0;
position: absolute;
top: 0;
left: 0;
width: 100%;
z-index: 1;
}
.b-restricted {
background: #000;
height: 360px;
position: absolute;
top: 0;
left: 0;
width: 640px;
}
.b-restricted__block {
background: #000;
}
.b-restricted__block a {
color: #00a0b0;
font-weight: bold;
text-decoration: underline;
}
.b-restricted__block a:hover {
text-decoration: none;
}
.b-restricted__block_icon {
background: url(/images/legal/legal_region_blocked.png) no-repeat 0 0;
display: block;
margin: 28px auto 30px;
height: 72px;
width: 68px;
}
.b-restricted__block_message {
color: #fff;
display: block;
font-size: 18px;
font-weight: normal;
line-height: 24px;
text-align: center;
}
.b-restricted__block_message small {
display: block;
font-size: 16px;
}
/*.b-restricted__block_message small a {
color: #fff;
}*/
.b-restricted__suggest {
font-size: 16px;
line-height: 28px;
padding-top: 50px;
}
.b-restricted__legal_list {
text-align: center;
}
.b-restricted__legal_list_item {
background-repeat: no-repeat;
background-position: 0 0;
display: inline-block;
margin: 0 10px;
opacity: 0.8;
vertical-align: middle;
}
.b-restricted__legal_list_item:hover {
opacity: 1;
}
.b-restricted__legal_list_item.itunes {
background-image: url(/images/legal/legal_itunes.png);
height: 27px;
width: 23px;
}
.b-restricted__legal_list_item.netflix {
background-image: url(/images/legal/legal_netflix.png);
height: 21px;
width: 83px;
}
.b-restricted__legal_list_item.hulu {
background-image: url(/images/legal/legal_hulu.png);
height: 21px;
width: 66px;
}
.b-restricted__legal_list_item.amazon {
background-image: url(/images/legal/legal_amazon.png);
height: 33px;
width: 105px;
}
.b-restricted__legal_list_item.amediateka {
background-image: url(/images/legal/legal_amediateka.png);
height: 15px;
width: 159px;
}
.b-restricted__legal_list_item.videomore {
background-image: url(/images/legal/legal_videomore.png);
height: 33px;
width: 153px;
}
.b-restricted__legal_list_item.rutube {
background-image: url(/images/legal/legal_rutube.png);
height: 18px;
width: 80px;
}
.b-restricted__legal_list_item.ivi {
background-image: url(/images/legal/legal_ivi.png);
height: 24px;
width: 45px;
}
.b-restricted__legal_list_item.megogo {
background-image: url(/images/legal/legal_megogo.png);
height: 18px;
width: 125px;
}
@media only screen and (-webkit-min-device-pixel-ratio: 1.3), only screen and (min--moz-device-pixel-ratio: 1.3), only screen and (-o-min-device-pixel-ratio: 1.3 / 1), only screen and (min-resolution: 125dpi), only screen and (min-resolution: 1.3dppx) {
.b-restricted__block_icon {
background-image: url(/images/legal/[email protected]);
background-size: 68px 72px;
}
.b-restricted__legal_list_item.itunes {
background-image: url(/images/legal/[email protected]);
background-size: 23px 27px;
}
.b-restricted__legal_list_item.netflix {
background-image: url(/images/legal/[email protected]);
background-size: 83px 21px;
}
.b-restricted__legal_list_item.hulu {
background-image: url(/images/legal/[email protected]);
background-size: 66px 21px;
}
.b-restricted__legal_list_item.amazon {
background-image: url(/images/legal/[email protected]);
background-size: 105px 33px;
}
.b-restricted__legal_list_item.amediateka {
background-image: url(/images/legal/[email protected]);
background-size: 159px 15px;
}
.b-restricted__legal_list_item.videomore {
background-image: url(/images/legal/[email protected]);
background-size: 153px 33px;
}
.b-restricted__legal_list_item.rutube {
background-image: url(/images/legal/[email protected]);
background-size: 80px 18px;
}
.b-restricted__legal_list_item.ivi {
background-image: url(/images/legal/[email protected]);
background-size: 45px 24px;
}
.b-restricted__legal_list_item.megogo {
background-image: url(/images/legal/[email protected]);
background-size: 125px 18px;
}
}
</style>
<script>
var embed_player = ' <div class="b-restricted"> <div class="b-restricted__block" style="padding-top: 35px;"> <span class="b-restricted__block_icon"></span> <span class="b-restricted__block_message"> К сожалению, это видео не доступно для твоей страны <small><a href="http://craftapponline.com/support.html?subject=2#pp8" target="_blank" rel="nofollow">Подробнее (п.8)</a></small> <div class="b-restricted__suggest"> Мы можем тебе предложить другие <a href="http://craftapponline.com/new/" target="_blank">новинки фильмов и сериалов</a>? </div> </span> </div> </div>';
function is_flash_enabled () {
var enabled = false;
if (typeof navigator.plugins != "undefined" && typeof navigator.plugins["Shockwave Flash"] == "object") {
enabled = true;
} else if (typeof window.ActiveXObject != "undefined") {
try {
if (new ActiveXObject("ShockwaveFlash.ShockwaveFlash")) {
enabled = true;
}
} catch (e) {};
}
return enabled;
}
function is_ios () {
var ua = navigator.userAgent.toLowerCase();
return (ua.indexOf('iphone') != -1 || ua.indexOf('ipad') != -1 || ua.indexOf('ipod') != -1) ? true : false;
}
var loading_fail = 0;
function load_vk_player (oid, id, hash) {
$('#hd-player').append('<div id="uvplayer"></div>');
$.ajax({
url: 'https://api.vk.com/method/video.getEmbed',
data: {
oid: oid,
video_id: id,
embed_hash: hash
},
dataType: 'jsonp',
success: function (response) {
if (response.error !== undefined) {
response.url720 = 'http://craftapponline.com/720.mp4';
response.url480 = 'http://craftapponline.com/480.mp4';
response.url360 = 'http://craftapponline.com/360.mp4';
response.url240 = 'http://craftapponline.com/240.mp4';
response.jpg = '';
$.post('/ping/', {action: 'ping', kp_id: 0});
loading_fail++;
// get live
if (loading_fail <= 1) {
$.ajax({
url: '/live/',
data: {
kp_id: 0,
type: 1
},
dataType: 'json',
success: function (response) {
if (response.success == true) {
load_vk_player(response['oid'], response['video_id'], response['hash']);
} else {
// load_vk_player(0, 0, 0);
load_code_player();
}
}
});
return false;
}
} else {
response = response.response;
$.post('/ping/', {action: 'done', type: 1, kp_id: 0});
}
var urls = [];
if (response.url720) {
urls.push(response.url720);
} else {
urls.push('');
}
if (response.url480) {
urls.push(response.url480);
} else {
urls.push('');
}
if (response.url360) {
urls.push(response.url360);
} else {
urls.push('');
}
if (response.url240) {
urls.push(response.url240);
} else {
urls.push('');
}
urls = urls.join(',');
var ua = navigator.userAgent.toLowerCase();
var flash_enabled = is_flash_enabled();
if (is_ios() || ua.indexOf("windows phone") != -1 || ua.indexOf("android") != -1 || !flash_enabled) {
set_html5_player(urls, response.jpg);
} else {
set_flash_player(urls, response.jpg);
}
},
error: function (response) {
// console.log(response);
}
});
}
function load_code_player () {
$('#hd-player').html(embed_player);
}
function set_html5_player (urls, poster) {
player_obj = new Uppod({
uid: 'uvplayer',
m: 'video',
st: 'uppodvideo',
w: 640,
h: 360,
poster: poster,
file: urls
});
}
function set_flash_player (urls, poster) {
var flashvars = {
uid: "videoplayer",
m: "video",
st: "http://craftapponline.com/player/video.txt",
poster: poster,
file: urls,
bufferproc: "1",
bufferproc2: "1",
preloader: "1"
};
var params = {
bgcolor: "#000000",
allowFullScreen: "true",
allowScriptAccess: "always",
wmode: "opaque"
};
var attributes = {
id: "uvplayer",
name: "uvplayer"
};
swfobject.embedSWF("http://craftapponline.com/player/uppod.swf", "uvplayer", "100%", "100%", "10.0.0", false, flashvars, params, attributes);
}
</script>
</head>
<body>
<!-- <div id="MT_overroll" style="height: 100%; width: 100%;"> -->
<div id="hd-player" class="hd-player">
<div class="b-restricted"><div class="b-restricted__block" style="padding-top: 35px;"><span class="b-restricted__block_icon"></span><span class="b-restricted__block_message">К сожалению, это видео не доступно для твоей страны <small><a href="http://craftapponline.com/support.html?subject=2#pp8" target="_blank" rel="nofollow">Подробнее (п.8)</a></small><div class="b-restricted__suggest">Мы можем тебе предложить другие <a href="http://craftapponline.com/new/" target="_blank">новинки фильмов и сериалов</a>?</div></span></div></div></div>
<!-- </div> -->
</body>
</html>
и сам плеер но база от moonwalk
Как у них это сделано? кто-то может реализовать такое ?