И снова прошу помощи!!!!!!!!
Привет народ на бейте больно но снова обращаюсь за помощью!!!
Суть вот в чём на просторах интернета нашёл подходящий модуль вывода плейлистов и сезонов но вот загвоздка он сделан так что делает вывод при добавлении видео с ютуб или вк посредством iframe а мне надо по прямой ссылке кто сможет убрать ненужное с кода???Сезоны выводятся вверху плеера а серии внизу можно ещё сделать так что бы серии с сезонами остались а в центр был помещён мой плеер если можно обьясните как???Предоставляю код На всякий случай даю ссылку на ресурс откуда скачивал та есть скрин как выглядит модуль в работе [red]Ссылка[/red] var pos = 0; var poz = 0; var sea = null; var width = 530; var vk = new Object(); (vk = { init: function () { document.write("<div id=\"player-vk-write\" align=\"center\"> <ul id=\"player-vk-season\"><li id=\"seasons\"></li></ul> <div id=\"player-vk-player\"></div> <ul id=\"player-vk-serial\"></ul> <a href=\"javascript://\" class=\"prev\" onclick=\"vk.move(1);\">prev</a> <a href=\"javascript://\" class=\"next\" onclick=\"vk.move(0);\">next</a> <a href=\"javascript://\" class=\"prev1\" onclick=\"vk.move1(1);\">prev</a> <a href=\"javascript://\" class=\"next1\" onclick=\"vk.move1(0);\">next</a> <\/div>") }, player: function (a, b) { document.getElementById("player-vk-player").innerHTML = ""; var d = document.createElement("iframe"); d.src = String(a); d.width = "100%"; d.height = "372"; d.setAttribute("border", "0"); d.setAttribute("frameborder", "0"); d.setAttribute("scrolling", "no"); d.setAttribute("allowfullscreen", ""); d.setAttribute("webkitallowfullscreen", ""); d.setAttribute("mozallowfullscreen", ""); d.setAttribute("oallowfullscreen", ""); d.setAttribute("msallowfullscreen", ""); document.getElementById("player-vk-player").appendChild(d); if (document.getElementById("player-vk-serial")) { c = document.getElementById("player-vk-serial").getElementsByTagName("span"); for (var i = 0; i < c.length; i++) { c[i].removeAttribute("class") } } b.setAttribute("class", "active") }, season: function (a, b) { if (document.getElementById("player-vk-season")) { c = document.getElementById("player-vk-season").getElementsByTagName("span"); for (var i = 0; i < c.length; i++) { document.getElementById("season" + i).style.display = "none"; c[i].removeAttribute("class") } document.getElementById("season" + a).style.display = ""; sea = a } b.setAttribute("class", "active") }, show: function (a, b) { for (var i = 0; i < a; i++) { document.getElementById("player-vk-season").getElementsByTagName("li")[0].innerHTML += "<span onclick=\"vk.season(" + i + ", this)\">Сезон " + (i + 1) + "</span>"; document.getElementById("player-vk-serial").innerHTML += "<li id=\"season" + i + "\" style=\"display:none;\"></li>" } for (var i = 0; i < a; i++) { for (var j = 0; j < b[i].length; j++) { document.getElementById("season" + i).innerHTML += "<span onclick=\"vk.player('" + b[i][j] + "', this);\">Серия " + (j + 1) + "</span>" } } document.getElementById("player-vk-season").getElementsByTagName("span")[0].setAttribute("class", "active"); document.getElementById("player-vk-season").getElementsByTagName("span")[0].click(); document.getElementById("season0").getElementsByTagName("span")[0].click(); document.getElementById("season0").style.display = "" }, move: function (d) { var a, b; var c = document.getElementById("seasons"); var e = c.offsetWidth; var f = c.offsetLeft; if (d == 0) { clearTimeout(a); b = setInterval(function () { pos = pos - 10; if (pos >= (f - width) && pos >= -(e - width)) { c.style.left = pos + "px" } else clearTimeout(b) }, 15) } if (d == 1) { clearTimeout(b); b = setInterval(function () { pos = pos + 10; if (pos <= (f + width) && pos <= 0) { c.style.left = pos + "px" } else clearTimeout(b) }, 15) } }, move1: function (d) { var a, b; var c = document.getElementById("season" + sea); var e = c.offsetWidth; var f = c.offsetLeft; if (d == 0) { clearTimeout(a); b = setInterval(function () { poz = poz - 10; if (poz >= (f - width) && poz >= -(e - width)) { c.style.left = poz + "px" } else clearTimeout(b) }, 15) } if (d == 1) { clearTimeout(b); b = setInterval(function () { poz = poz + 10; if (poz <= (f + width) && poz <= 0) { c.style.left = poz + "px" } else clearTimeout(b) }, 15) } } }); Заранее большое спасибо!!!!!!!!!И тем кто поможет и тем кто попинает!!!!!!! |
Или может можно что то подобное сделать чтобы оно на низ плеера налаживалось и можно было бы выбрать серии????ПОМОГИТЕ НАРОД ПЛИЗ!!!!!!!!!
|
На сколько я понимаю, без iframe не получится. Страницы из
разных поддоменов не могут взаимодействовать с помощью JS (из-за ограничений безопасности). |
Цитата:
Или типа такого [red]Тык[/red]Уже всю голову сломил не могу никак реализовать!!!На заказ кодера пока денег нет вот и кидаюсь с форума на форум за помощью добрых людей!!!!!!!!!! |
Слушай а вот нашёл ещё какой то скрипт может с этого может что то выйти??? Сам скрипт <script type="text/javascript"> var viDims,viWidth,viHeight,firstVideo=1,currBtn,barNr=0,vidBtns='',tmpState='',overVid='',vidClicked=0,mouse_evt='mousedown',touch_device='ontouchstart' in document.documentElement; if(touch_device) {mouse_evt='click';} var is_series=true,serie_timer=null; if(document.getElementById('video_wrapper').offsetWidth>700) { viWidth=700; viHeight=393; viDims='width="700" height="393"'; } else { viWidth=document.getElementById('video_wrapper').offsetWidth; viHeight=Math.round(viWidth/1.78); viDims='width="'+viWidth+'" height="'+viHeight+'"'; } $('#video_wrapper').css({'width':viWidth+'px','height':viHeight+'px'}); function loadingPlayer() { $('#video_wrapper .moon_rising').remove(); $('#video_wrapper').append('<div class="moon_rising"><img src="/engine/skins/images/loading_white.gif" style="vertical-align:middle;margin-right:15px" />Загрузка плеера...</div>'); } function getMoonList() { loadingPlayer(); $.ajax({method:'GET',url:'/getMoonList.php',dataType:'json',cache:false,data:{id:3980,id2:610422,se:'4',ep:'36',ad:'2014-03-26 14:16:06',t1:"Великолепный век",t2:"Muhtesem Yüzyil"}}).done(function( data ) { if(typeof data=='object' && data!=null && typeof data.videos=='object') { vkArr=data.videos; if(typeof data.serie_added!='undefined'){ $('#serie_added').text('('+data.serie_added+')'); } if(typeof data.reason!='undefined') { $('#re3980').text(data.reason);checkNewSeries(); } } }).fail(function(){ }).always(function(){ startPlayers(); }); } function getMoonSeason(current,code) { loadingPlayer(); var btnTxt=$(current).text(),lvl=$(current).parents('.tabs_container').attr('lvl'),tmpBarNr,currBarNr=$(current).parents('.tabs_container').attr('id'); if(currBarNr!=null) currBarNr=parseInt(currBarNr.substring(3)); else currBarNr=0; lvl=parseInt(lvl); if(lvl==null || isNaN(lvl)) lvl=0; $.ajax({method:'GET',url:'/getMoonSeason.php',dataType:'json',cache:false,data:{id:3980,url:code,btn:btnTxt,lvl:lvl}}).done(function( data ) { if(typeof data=='object' && data!=null && typeof data.videos=='object' && data.videos[0]!=null) { if(typeof data.serie_added!='undefined'){ $('#serie_added').text('('+data.serie_added+')'); } if(typeof data.reason!='undefined') { $('#re3980').text(data.reason);checkNewSeries(); } vidBtns=''; tmpBarNr=++barNr; formatPlaylist(data.videos,++lvl,tmpBarNr); $('#btns_wrapper').append(vidBtns); initBtns(); if(current!=null) $(current).attr('on'+mouse_evt, 'showSeason(this,'+tmpBarNr+','+currBarNr+')').removeClass('inset').trigger(mouse_evt); else $('#tab'+tmpBarNr+' .serieTab:first').trigger(mouse_evt); } else { tmpState='skip'; if(current!=null) $(current).removeClass('inset').trigger(mouse_evt);else loadVideo(null,code); } }).fail(function(){tmpState='skip'; if(current!=null) $(current).removeClass('inset').trigger(mouse_evt);else loadVideo(null,code);}).always(function(){ }); } function getMoonSerie(current,url) { loadingPlayer(); $.ajax({method:'GET',url:url,dataType:'html',cache:false,data:{id:3980}}).done(function( code ) { if(code!='' && code.search(/(moonwalk\.cc|serpens\.nl|[0-9\.]{8,})\/(video|serial)\/[a-z0-9]+\/iframe/i) != -1) { $(current).attr('on'+mouse_evt, 'loadVideo(this,\''+code+'\')').removeClass('inset'); loadVideo(current,code); } else { $('.moon_rising').html('<div style="margin-top:23px;color:red;">Произошла ошибка!</div><div style="font-size:9pt;font-weight:normal">Попробуйте через пару минут.</div>'); } }); } function startCounter(current) { clearTimeout(serie_timer); var sz1=0,sz2=0,sr1=0,sr2=0,s_e1,s_e2,comment=$(current).html().replace(/(<br>| )/g,' ').replace(/\s{2,}/g,' ').replace(/[()]/g,'').replace(/([0-9,.-]+ (серия|эпизод|часть|выпуск)) ([0-9]+ (сезон|глава))/ig, '$3 $1'); if(typeof lastSerie!='undefined') { sz1=lastSerie.match(/([0-9]+) (сезон|глава)/i); if(sz1)sz1=parseInt(sz1[1]); else { sz1=lastSerie.match(/(ТВ|TV)[-\s]{0,3}([0-9]+)/i); if(sz1)sz1=parseInt(sz1[2]); else sz1=0; } sr1=lastSerie.match(/([0-9.]+) (серия|эпизод|часть|выпуск)/i);if(sr1)sr1=parseFloat(sr1[1]);else sr1=0; } if(typeof comment!='undefined') { if(sz2=comment.match(/([0-9]+) (сезон|глава)/i))sz2=parseInt(sz2[1]); else if(sz2=comment.match(/(ТВ|TV)[-\s]{0,3}([0-9]+)/i))sz2=parseInt(sz2[2]); else sz2=0; if(sr2=comment.match(/([0-9.]+) (серия|эпизод|часть|выпуск)/i))sr2=parseFloat(sr2[1]);else sr2=0; } s_e1=sz1*1000+sr1;s_e2=sz2*1000+sr2; if(typeof c_serie!='undefined'){ var video_length=$('#video_length').text(); if(video_length=='')video_length=6; serie_timer=setTimeout(function(){if(s_e1<s_e2 || vidClicked){var i,c,found=0,cm=comment.replace(/ выпуск/gi,'v').replace(/ часть/gi,'c').replace(/ серия/gi,'r').replace(/ сезон/gi,'z').replace(/(ТВ|TV)-?/gi,'t').replace(/(ОВА|OVA)/gi,'o').replace(/ /g,'_'); if(typeof a_serie[3980]=='undefined'){ c_serie[c_serie.length]='3980*'+cm; } else { for(i=0;i<c_serie.length;i++){if(c_serie[i].indexOf('3980*')==0) {c_serie[i]='3980*'+cm;break;}} } lastSerie=comment; a_serie[3980]=cm; c=c_serie.join('@');createCookie('ser',c,365);$('.last_serie span').text(comment);$('div.last_serie').show();checkNewSeries();}},video_length*60*1000*0.4); // ,video_length*60*1000*0.4 } } function loadVideo(current,code,poster) { if($(current).hasClass('inset')) return; var lvl=$(current).parents('.tabs_container').attr('lvl'); if(lvl!='') { $('.series.tabs_container.lvl'+lvl+' .serieTab.inset').removeClass('inset'); $('.series.tabs_container.lvl'+(++lvl)).hide().find('.serieTab.inset').removeClass('inset'); $('.series.tabs_container.lvl'+(++lvl)).hide().find('.serieTab.inset').removeClass('inset'); } $(current).siblings('.serieTab').removeClass('inset'); $(current).addClass('inset viewed'); if(code.indexOf('getMoonSerie') != -1) { getMoonSerie(current,code); return; } if(tmpState!='skip' && code.search(/(moonwalk\.cc|serpens\.nl|[0-9\.]{8,})\/serial\/[a-z0-9]+\/iframe/i) != -1) { getMoonSeason(current,code); return; } else if(tmpState=='skip') tmpState=''; currBtn=current; if(current!=null){ if(is_series) startCounter(current); var comment=$(current).html().replace(/<br>/g,' ').replace(/[()]/g,'').replace(/([0-9,.-]+ (серия|эпизод|часть|выпуск)) ([0-9]+ (сезон|глава))/ig, '$3 $1'); } makePlayer(code,comment,poster); } function makePlayer(code,comment,poster) { var vidWrapper=document.getElementById('video_wrapper'); if(code.search(/^oid=/) != -1) { code=code.replace(/(oid=[0-9a-z-]+&id=)([0-9]{2})([0-9]{2})([0-9]+&hash=)([0-9a-z]{3})([0-9a-z]{3})/g,'$1$3$2$4$6$5').replace(/(oid=[0-9a-z&=-]+hash=[0-9a-z]{2})([0-9a-z]{1})([0-9a-z]{1})/g,'$1$3$2'); vidWrapper.innerHTML='<iframe src="http://www.autobonus.lt/video.php?code='+encodeURIComponent(code)+(firstVideo==1?'&first=1':'')+'" '+viDims+' frameborder="0" allowfullscreen="true" webkitallowfullscreen="true" mozallowfullscreen="true"></iframe>'; } else if(code.search(/kset.kz/i) != -1) { code=code.replace(/([^a-z]{1})width=(['"\\]*)[0-9]+(['"\\]*)/gi, "$1width=$2"+viWidth+"$3").replace(/height=(['"\\]*)[0-9]+(['"\\]*)/gi, "height=$1"+viHeight+"$2"); vidWrapper.innerHTML='<iframe src="http://www.autobonus.kz/kset.php?code='+encodeURIComponent(code)+(firstVideo==1?'&first=1':'')+'" '+viDims+' frameborder="0" allowfullscreen="true" webkitallowfullscreen="true" mozallowfullscreen="true"></iframe>'; } else if(code.search(/<(object|embed) /i)==0) { code=code.replace(/([^a-z]{1})width=(['"\\]*)[0-9]+(['"\\]*)/gi, "$1width=$2"+viWidth+"$3").replace(/height=(['"\\]*)[0-9]+(['"\\]*)/gi, "height=$1"+viHeight+"$2"); vidWrapper.innerHTML=code; } else if(code.search(/\.(3gp|aac|f4v|flv|m4a|mp3|mp4)/i) != -1) { if(!document.getElementById('uppod_player')){ vidWrapper.innerHTML='<div id="uppod_player"></div>'; var flashvars = {'uid':'uppod_player','m':'video','st':'/engine/classes/flashplayer/video_inpl.txt'}; |
if(navigator.appName=='Microsoft Internet Explorer') flashvars.file=code; else flashvars.pl='{"playlist":[{"file":"'+code+'","comment":"'+comment+'"}]}'; if(typeof poster=='string') flashvars.poster=poster; var params = {allowFullScreen:'true',allowScriptAccess:'always',wmode:'auto',bgColor:'#000000'}; new swfobject.embedSWF('/engine/classes/flashplayer/uppod.swf', 'uppod_player', viWidth, viHeight, '9.0.115', false, flashvars, params); } else { if(navigator.appName=='Microsoft Internet Explorer') { uppodSend('uppod_player','file:'+code); uppodSend('uppod_player','play'); } else { uppodSend('uppod_player','pl:{"file":"'+code+'","comment":"'+comment+'"}'); if(typeof poster=='string') uppodSend('uppod_player','poster:'+poster); uppodSend('uppod_player','start_1'); } } } else if(code.search(/video\.rutube\.ru/i) != -1) { code=code.replace(/^.*?(http:[^"]+).*?$/,'$1'); vidWrapper.innerHTML='<OBJECT '+viDims+'><PARAM name="movie" value="'+code+'"></PARAM><PARAM name="wmode" value="window"></PARAM><PARAM name="allowFullScreen" value="true"></PARAM><EMBED src="'+code+'" type="application/x-shockwave-flash" wmode="window" '+viDims+' allowFullScreen="true" ></EMBED></OBJECT>'; } else { code=code.replace(/youtube\.com\/watch\?v=/,'youtube.com/embed/'); code=code.replace(/w=[0-9]+px&h=[0-9]+px/, 'w='+viWidth+'px&h='+viHeight+'px').replace(/w=[0-9]+&h=[0-9]+/, 'w='+viWidth+'&h='+viHeight).replace(/width=[0-9]+&height=[0-9]+/, 'width='+viWidth+'&height='+viHeight); vidWrapper.innerHTML='<if' +'rame src="'+code+'" '+viDims+' frameborder="0" scrolling="no" allowfullscreen="true" webkitallowfullscreen="true" mozallowfullscreen="true" style="overflow:hidden;"></if' +'rame>'; } vidClicked=0; } var vkArr='http://moonwalk.cc/serial/ae2bd003bbca77e1b4502c9e3fea6b1f/iframe'; function formatPlaylist(a,lvl,nr) { var cls=(lvl?'series':'seasons'); vidBtns += '<div id="bar'+nr+'" class="'+cls+' tabs_container lvl'+lvl+'" lvl='+lvl+' style="visibility:hidden;width:'+viWidth+'px;"><div id="tab'+nr+'" class="tabs">'; for(var i=0; i < a.length; i++) { if(typeof a[i].file != 'undefined' && a[i].file!='') { a[i].file=a[i].file.replace(/'/g, "\\'"); if(typeof a[i].poster=='string') vidBtns += '<div class="serieTab" on'+mouse_evt+'="loadVideo(this,\''+a[i].file+'\',\''+a[i].poster+'\')">'+a[i].comment+'</div>'; else vidBtns += '<div class="serieTab" on'+mouse_evt+'="loadVideo(this,\''+a[i].file+'\')">'+a[i].comment+'</div>'; } else if(typeof a[i].link != 'undefined') { vidBtns += '<div class="serieTab"><a href="'+a[i].link+'" target="_blank" rel="nofollow">'+a[i].comment+'</a></div>'; } else if(typeof a[i].playlist != 'undefined') { barNr++; a[i].barNr=barNr; vidBtns += '<div class="serieTab" on'+mouse_evt+'="showSeason(this,'+barNr+','+nr+')">'+a[i].comment+'</div>'; } } vidBtns += '</div></div>'; for(var i=0; i < a.length; i++) { if(typeof a[i].playlist != 'undefined') { formatPlaylist(a[i].playlist,lvl+1,a[i].barNr); } } } function showSeason(current,nr,parent) { if($(current).hasClass('inset')) return; $(current).siblings('.serieTab').removeClass('inset'); $(current).addClass('inset'); $('.series.tabs_container').removeClass('current').hide(); $('#bar'+parent).addClass('current').show(); $('#bar'+nr+' .serieTab').removeClass('inset'); $('#bar'+nr).addClass('current').show(); if(touch_device) $('#bar'+nr+' .tabs').niceScroll({cursorcolor:'#1A1D22',cursoropacitymax:0.7,touchbehavior:true,smoothscroll:true,autohidemode:true,enablemousewheel:false,cursorborder:'1px solid #777'}); $('#bar'+nr+' .serieTab:first').trigger(mouse_evt); } if(is_series){ var lastSerie=''; $('#vid').after('<div class="last_serie" style="display:none;width:'+viWidth+'px;">Последняя просмотренная вами серия: <span></span> <font>[ <a onclick="return resetCounter(3980,this);">сбросить счетчик</a> ]</font></div>'); if(typeof a_serie[3980]!='undefined'){ lastSerie=a_serie[3980].replace(/([0-9]+)v/,'$1 выпуск').replace(/([0-9]+)c/,'$1 часть').replace(/([0-9]+)r/,'$1 серия').replace(/([0-9]+)z/,'$1 сезон').replace(/t([0-9]+)/,'ТВ-$1').replace(/_o$/,' ОВА').replace(/_/g,' '); if(lastSerie!='') $('div.last_serie').show().children('span').text(lastSerie); } } function startPlayers() { if(typeof vkArr == 'string') { if(vkArr.search(/(moonwalk\.cc|serpens\.nl|[0-9\.]{8,})\/serial\/[a-z0-9]+\/iframe/i) != -1) { loadVideo(null,vkArr); } else { makePlayer(vkArr); } } else if(typeof vkArr[0] != 'undefined') { formatPlaylist(vkArr,0,0); $('#btns_wrapper').append(vidBtns); } else return; initBtns(); for(var i=0; i < vkArr.length; i++) { if(typeof vkArr[i].playlist != 'undefined') {showSeason($('.seasons .serieTab:first'),0,null); break;} if(typeof vkArr[i].file != 'undefined') {loadVideo($('.serieTab:first'),vkArr[i].file.replace(/\\'/g, "'")); break;} } firstVideo=0; }; function initBtns() { if(touch_device) { $('#vid .tabs').css('padding-bottom','10px'); $('.seasons .tabs').niceScroll({cursorcolor:'#1A1D22',cursoropacitymax:0.7,touchbehavior:true,smoothscroll:true,autohidemode:true,enablemousewheel:false,cursorborder:'1px solid #777'}); //$('.series .tabs').niceScroll({cursorcolor:'#1A1D22',cursoropacitymax:0.7,touchbehavior:true,smoothscroll:true,autohidemode:true,enablemousewheel:false,cursorborder:'1px solid #777'}); } else { $('.tabs_container').not('.ovfHid').each(function() { var container = this; $(container).addClass('ovfHid').css({'overflow':'hidden'}); var cont_width = $(container).width(); var elem_width = 0; $(container).find('.serieTab').each(function() { elem_width += $(this).outerWidth(true); }); var max_scroll = elem_width - cont_width; var correction = parseInt(max_scroll / 12); max_scroll += correction * 2; var differential = max_scroll / cont_width; $(this).on('mousemove', function(e){ var pos = (e.pageX - $(this).offset().left) + 1; var scr = Math.round(pos * differential) - correction; if(scr < 0) scr=0; else if(scr > max_scroll - correction * 2) scr = max_scroll - correction * 2; $(this).scrollLeft(scr); //$('.related').html('cont_width: '+cont_width+'<br>elem_width: '+elem_width+'<br>max_scroll: '+max_scroll+'<br>differential: '+differential+'<br>pos: '+pos+'<br>scr: '+scr); //$('.related').append('<br>e.offsetX: '+e.offsetX+'<br>e.pageX: '+e.pageX+'<br>offset.left: '+$(this).offset().left); }); }) } $('.tabs_container').css('visibility','visible'); } $('#video_wrapper').hover(function() { overVid=$(this).closest('#video_wrapper').attr('id'); }, function() { overVid=''; }); $(window).blur(function() { if(overVid=='video_wrapper'){vidClicked=1;if(currBtn!=null) startCounter(currBtn);} }); $(function(){ getSchedule(3980,'1848220','4','36','2014-03-26 14:16:06',null); }); $(function(){getMoonList();}); </script> Вот сайт на котором нашёл [red]Тык[/red] Помоги плиз больше не знаю к кому обратится:cray: !!!!Знал бы js не просил бы ни кого а так дуб полный:-? !!!!Во век не забуду!!!!!!!! |
Часовой пояс GMT +3, время: 01:58. |