📁 PHP Dosya Yöneticisi
/
/
home
/
demodesigncom
/
e-ticaretv11.demodesign.com.tr
/
catalog
/
view
/
javascript
/
me_video
📝
common.js
← Geri Dön
jQuery(function ($) { $(window).on('load', function () { $('.thumbnails a').each(function() { if ($(this).attr('href').indexOf('#frame') >= 0 || $(this).attr('href').indexOf('#local') >= 0) { $(this).addClass('video-link'); } }); //Additional Images with videos var enableautoplay = ''; var video_attrribute = ''; if (typeof $.magnificPopup !== "undefined") { if ($('.thumbnails').length > 0 && typeof $('.thumbnails').data().magnificPopup !== "undefined") { // Extend callbacks per item $('.thumbnails').data().magnificPopup.callbacks = { elementParse: function(item) { if (item.src.indexOf('#frame') >= 0) { var autoplay = $('a[href="'+ item.src +'"]').attr('meautoplay'); var controls = $('a[href="'+ item.src +'"]').attr('mecontrol'); item.type = 'inline'; item.src = item.src.split('#')[0]; if(autoplay == 1){ enableautoplay = 'allow="autoplay"'; video_attrribute += '?autoplay=1&rel=0'; }else{ video_attrribute += '?autoplay=0&rel=0'; } if(controls == 1){ video_attrribute += '&controls=1'; }else{ video_attrribute += '&controls=0'; } var video_html = '<div class="mevideo-popup"><button title="Close (Esc)" type="button" class="mfp-close">×</button>'; video_html += '<div class="mevideo-wrapper"><iframe class="mevideo-video" src="' + item.src + video_attrribute +'" ' + enableautoplay + ' allowfullscreen></iframe>'; video_html += '</div>'; video_html += '</div>' item.src = video_html; } if (item.src.indexOf('#local') >= 0) { var autoplay = $('a[href="'+ item.src +'"]').attr('meautoplay'); item.type = 'inline'; item.src = item.src.split('#')[0]; if(autoplay == 1){ enableautoplay = 'autoplay'; } var rgx = /(?:\.([^.]+))?$/; var ext = rgx.exec(item.src.replace("#local", ""))[1]; var video_html = '<div class="mevideo-popup localpvideo"><button title="Close (Esc)" type="button" class="mfp-close">×</button>'; video_html += '<div class="mevideo-wrapper"><video class="mevideo-video" playsinline controls ' + enableautoplay + ' preload="auto">'; video_html += '<source src="' + item.src + '" type="video/' + ext + '">'; video_html += '</video>'; video_html += '</div></div>' item.src = video_html; if ($(window).width() <= 1024) { $(document).on('mouseover touchstart', '.localpvideo .mevideo-video', function() { this.paused ? this.play() : this.pause(); }); } } }, close: function() { if ($('.mevideo-popup').hasClass('localpvideo')) { $('.mevideo-popup').find('video')[0].load(); } } } } } // Tab Videos $(document).ready(function() { $('.mevideos').magnificPopup({ type:'image', delegate: 'a', gallery: { enabled: true }, callbacks: { elementParse: function(item) { if (item.src.indexOf('#frame') >= 0) { var autoplay = $('a[href="'+ item.src +'"]').attr('meautoplay'); var controls = $('a[href="'+ item.src +'"]').attr('mecontrol'); item.type = 'inline'; item.src = item.src.split('#')[0]; var video_attrribute = ''; if(autoplay == 1){ enableautoplay = 'allow="autoplay"'; video_attrribute += '?autoplay=1&rel=0'; }else{ video_attrribute += '?autoplay=0&rel=0'; } if(controls == 1){ video_attrribute += '&controls=1'; }else{ video_attrribute += '&controls=0'; } var video_html = '<div class="mevideo-popup"><button title="Close (Esc)" type="button" class="mfp-close">×</button>'; video_html += '<div class="mevideo-wrapper"><iframe class="mevideo-video" src="' + item.src + video_attrribute +'" ' + enableautoplay + ' allowfullscreen>'; video_html += '</iframe></div>'; video_html += '</div>' item.src = video_html; } if (item.src.indexOf('#local') >= 0) { var autoplay = $('a[href="'+ item.src +'"]').attr('meautoplay'); item.type = 'inline'; item.src = item.src.split('#')[0]; if(autoplay == 1){ enableautoplay = 'autoplay'; } var rgx = /(?:\.([^.]+))?$/; var ext = rgx.exec(item.src.replace("#local", ""))[1]; var video_html = '<div class="mevideo-popup localpvideo"><button title="Close (Esc)" type="button" class="mfp-close">×</button>'; video_html += '<div class="mevideo-wrapper"><video class="mevideo-video" playsinline controls ' + enableautoplay + ' preload="auto">'; video_html += '<source src="' + item.src + '" type="video/' + ext + '">'; video_html += '</video>'; video_html += '</div></div>' item.src = video_html; if ($(window).width() <= 1024) { $(document).on('mouseover touchstart', '.localpvideo .mevideo-video', function() { this.paused ? this.play() : this.pause(); }); } } }, close: function() { if ($('.mevideo-popup').hasClass('localpvideo')) { $('.mevideo-popup').find('video')[0].load(); } } } }); }); $('.thumbnails div.video-link').on('click', function(e) { var enableautoplay = ''; var video_attrribute = ''; var video_href = $(this).attr('video-href'); var autoplay = $(this).attr('meautoplay'); var controls = $(this).attr('mecontrol'); $('.thumbnails li:first a').hide(); if (video_href.indexOf('#frame') >= 0) { video_href = video_href.split('#')[0]; if(autoplay == 1){ enableautoplay = 'allow="autoplay"'; video_attrribute += '?autoplay=1&rel=0'; }else{ video_attrribute += '?autoplay=0&rel=0'; } if(controls == 1){ video_attrribute += '&controls=1'; }else{ video_attrribute += '&controls=0'; } $('.mainthumbvideo').html('<iframe src ="'+ video_href + video_attrribute +'" class="mevideomain-video thumbnail" frameborder="no" '+ enableautoplay +' allowfullscreen></iframe>'); }else if (video_href.indexOf('#local') >= 0) { video_href = video_href.split('#')[0]; if(autoplay == 1){ enableautoplay = 'autoplay'; } var rgx = /(?:\.([^.]+))?$/; var ext = rgx.exec(video_href.replace("#local", ""))[1]; $('.mainthumbvideo').html('<video class="mevideomain-video thumbnail localvideo" playsinline controls ' + enableautoplay + ' preload="auto"><source src="' + video_href + '" type="video/' + ext + '"></video>'); if ($(window).width() <= 1024) { $(document).on('mouseover touchstart', '.localvideo', function() { this.paused ? this.play() : this.pause(); }); } }else{ $('.thumbnails li:first a').show(); } }); $('.popup-quickview .main-image .swiper-slide img').each(function(sindex,value){ var index = $(this).parent().data('index'); if (index == undefined) { index = sindex; $(this).parent().attr('data-index',index); } }); $('.swiper-slide img[data-largeimg$="local"],.swiper-slide img[data-largeimg$="frame"],.image-gallery a[href$="local"],.image-gallery a[href$="frame"],.swiper-slide img[data-href$="local"],.swiper-slide img[data-href$="frame"]').each(function() { var enableautoplay = ''; var video_attrribute = ''; var video_href = $(this).attr('data-href'); if (video_href == undefined) { video_href = $(this).attr('data-largeimg'); } var index = $(this).parent().data('index'); var gallery = $(this).parent().data('gallery'); var galleryimages = $(gallery).data('images'); var type = $('.additional-images .swiper-wrapper').find("[data-index='" + index + "']").attr('metype'); if ($('html').hasClass('popup-quickview')) { if (type == undefined) { autoplay = $('.popup-quickview .additional-images').find("[data-index='" + index + "']").attr('meautoplay'); controls = $('.popup-quickview .additional-images').find("[data-index='" + index + "']").attr('mecontrol'); } if(autoplay == 1){ video_attrribute += '?autoplay=1&rel=0'; }else{ video_attrribute += '?autoplay=0&rel=0'; } if(controls == 1){ video_attrribute += '&controls=1'; }else{ video_attrribute += '&controls=0'; } enableautoplay = ''; } if (video_href.indexOf('#frame') >= 0) { video_href = video_href.split('#')[0]; $('.main-image .swiper-wrapper').find("[data-index='" + index + "']").find('img').after('<iframe class="mevideomain-video" src ="'+ video_href + video_attrribute +'" frameborder="no" '+ enableautoplay +' allowfullscreen></iframe>').show(); $('.main-image .swiper-wrapper').find("[data-index='" + index + "']").find('img').hide(); video_href = video_href.replace('https://www.youtube-nocookie.com/embed/','https://www.youtube.com/watch?v='); video_href = video_href.replace('https://player.vimeo.com/video/','https://vimeo.com/'); video_href = video_href.replace('https://www.dailymotion.com/embed/video/','https://dai.ly/'); if(galleryimages){ galleryimages[index]['src'] = video_href; } } if (video_href.indexOf('#local') >= 0) { if(galleryimages){ galleryimages[index]['src'] = ''; galleryimages[index]['poster'] = $(this).attr('src'); galleryimages[index]['html'] = '#local'+index; } video_href = video_href.split('#')[0]; var rgx = /(?:\.([^.]+))?$/; var ext = rgx.exec(video_href.replace("#local", ""))[1]; var autoplay = $('.additional-images .swiper-wrapper').find("[data-index='" + index + "']").attr('meautoplay'); if(autoplay == 1 && type == 1){ //enableautoplay = 'autoplay'; } $(this).removeAttr('href'); var video_html = '<div class="mevideo-popup localpvideo" style="display:none;" id="local' + index + '">'; video_html += '<div class="mevideo-wrapper"><video class="embed-responsive-item lg-video-object lg-html5" autoplay muted controls ' + enableautoplay + ' preload="none">'; video_html += '<source src="' + video_href + '" type="video/' + ext + '" autostart="false">'; video_html += 'Your browser does not support the HTML5 video tag.'; video_html += '</video></div>'; video_html += '</div>'; $('.main-image .swiper-wrapper').find("[data-index='" + index + "']").find('img').after('<video class="mevideomain-video localvideo" playsinline controls ' + enableautoplay + ' preload="auto"><source src="' + video_href + '" type="video/' + ext + '" autostart="false"></video>'); $('.main-image .swiper-wrapper').find("[data-index='" + index + "']").find('img').hide(); if(type == 0){ $('.main-image .swiper-wrapper').find("[data-index='" + index + "']").removeAttr('data-gallery'); } if ($(window).width() <= 1024) { $(document).on('mouseover touchstart', '.localvideo', function() { this.paused ? this.play() : this.pause(); }); } $('body').append(video_html); } }); $('.additional-image,.product-info .image-additional a').on('click',function(e){ e.preventDefault(); var type = $(this).attr('metype'); if ($('html').hasClass('popup-quickview')) { type = 0; } if(type == 1){ $('.main-image .swiper-slide').each(function () { var f = $(this); g=f.find("iframe").get(0),h=f.find("iframe").get(0),i=f.find("iframe").get(0),j=f.find(".lg-vk").get(0),k=f.find("video").get(0); $('.main-image .swiper-slide iframe').each(function () { var oldsrc = $(this).attr('src'); if(oldsrc == undefined){ }else{ oldsrc = oldsrc.replace('?autoplay=1&rel=0&controls=1','',oldsrc); oldsrc = oldsrc.replace('?autoplay=0&rel=0&controls=0','',oldsrc); $(this).attr('src', oldsrc); } }); if(k){var vids = f.find("video"); if(vids.length > 0){ vids[0].pause(); vids[0].currentTime = 0; } } }); var index_value = $(this).data('index'); $('.main-image .swiper-wrapper').find("[data-index='" + index_value + "']").trigger('click'); }else{ var index_value = $(this).data('index'); var video_attrribute = ''; var enableautoplay = ''; video_href = $('.main-image .swiper-wrapper').find("[data-index='" + index_value + "']").find('img').data('href'); if (video_href == undefined) { video_href = $('.main-image .swiper-wrapper').find("[data-swiper-slide-index='" + index_value + "']").find('img').data('largeimg'); } if (video_href == undefined || video_href == '') { video_href = $('.main-image .swiper-wrapper').find("[data-index='" + index_value + "']").find('img').attr('data-href'); } if (video_href == undefined) { video_href = $(this).attr('href'); } if (video_href == undefined) { video_href = $(this).attr('video-href'); } if (video_href == undefined) { video_href = $('.main-image .swiper-wrapper .swiper-slide:eq('+ index_value +')').find('img').data('largeimg'); } var autoplay = $(this).attr('meautoplay'); var controls = $(this).attr('mecontrol'); if (typeof video_href !== 'undefined' && (video_href.indexOf('#frame') >= 0 || video_href.indexOf('#local') >= 0)) { $('.main-image .swiper-slide').each(function () { var f = $(this); g=f.find("iframe").get(0),h=f.find("iframe").get(0),i=f.find("iframe").get(0),j=f.find(".lg-vk").get(0),k=f.find("video").get(0); $('.main-image .swiper-slide iframe').each(function () { var oldsrc = $(this).attr('src'); if(oldsrc == undefined){ }else{ oldsrc = oldsrc.replace('?autoplay=1&rel=0&controls=1','',oldsrc); oldsrc = oldsrc.replace('?autoplay=0&rel=0&controls=0','',oldsrc); $(this).attr('src', oldsrc); } }); if(k){var vids = f.find("video"); if(vids.length > 0){ vids[0].pause(); vids[0].currentTime = 0; } } }); if (video_href.indexOf('#frame') >= 0) { video_href = video_href.split('#')[0]; if(autoplay == 1){ enableautoplay = 'allow="autoplay"'; video_attrribute += '?autoplay=1&rel=0'; }else{ video_attrribute += '?autoplay=0&rel=0'; } if(controls == 1){ video_attrribute += '&controls=1'; }else{ video_attrribute += '&controls=0'; } if ($('html').hasClass('popup-quickview')) { $('.main-image .swiper-wrapper .swiper-slide:eq('+ index_value +')').find('iframe').remove(); $('.main-image .swiper-wrapper .swiper-slide:eq('+ index_value +')').find('video').remove(); $('.main-image .swiper-wrapper .swiper-slide:eq('+ index_value +')').find('img').after('<iframe class="mevideomain-video" src ="'+ video_href + video_attrribute +'" frameborder="no" '+ enableautoplay +' allowfullscreen></iframe>').show(); $('.main-image .swiper-wrapper .swiper-slide:eq('+ index_value +')').find('img').hide(); } else { $('.main-image .swiper-wrapper').find("[data-index='" + index_value + "']").find('iframe').remove(); $('.main-image .swiper-wrapper').find("[data-index='" + index_value + "']").find('video').remove(); $('.main-image .swiper-wrapper').find("[data-index='" + index_value + "']").find('img').after('<iframe class="mevideomain-video" src ="'+ video_href + video_attrribute +'" frameborder="no" '+ enableautoplay +' allowfullscreen></iframe>').show(); $('.main-image .swiper-wrapper').find("[data-index='" + index_value + "']").find('img').hide(); } } if (video_href.indexOf('#local') >= 0) { var rgx = /(?:\.([^.]+))?$/; var ext = rgx.exec(video_href.replace("#local", ""))[1]; if(autoplay == 1){ enableautoplay = 'autoplay'; } if ($('html').hasClass('popup-quickview')) { $('.main-image .swiper-wrapper .swiper-slide:eq('+ index_value +')').find('iframe').remove(); $('.main-image .swiper-wrapper .swiper-slide:eq('+ index_value +')').find('video').remove(); $('.main-image .swiper-wrapper .swiper-slide:eq('+ index_value +')').find('img').after('<video class="mevideomain-video localvideo" playsinline controls ' + enableautoplay + ' preload="auto"><source src="' + video_href + '" type="video/' + ext + '" autostart="false"></video>'); $('.main-image .swiper-wrapper .swiper-slide:eq('+ index_value +')').find('img').hide(); } else { $('.main-image .swiper-wrapper').find("[data-index='" + index_value + "']").find('iframe').remove(); $('.main-image .swiper-wrapper').find("[data-index='" + index_value + "']").find('video').remove(); $('.main-image .swiper-wrapper').find("[data-index='" + index_value + "']").find('img').after('<video class="mevideomain-video localvideo" playsinline controls ' + enableautoplay + ' preload="auto"><source src="' + video_href + '" type="video/' + ext + '" autostart="false"></video>'); $('.main-image .swiper-wrapper').find("[data-index='" + index_value + "']").find('img').hide(); } $('.main-image .swiper-wrapper').find("[data-index='" + index_value + "']").removeAttr('data-gallery'); if ($(window).width() <= 1024) { $(document).on('mouseover touchstart', '.localvideo', function() { this.paused ? this.play() : this.pause(); }); } } }else{ /* $('.main-image .swiper-wrapper').find('video').remove(); $('.main-image .swiper-wrapper').find('iframe').remove(); */ //$('.main-image .swiper-wrapper .swiper-slide-active').find('img').show(); $('.main-image .swiper-slide').each(function () { var f = $(this); g=f.find("iframe").get(0),h=f.find("iframe").get(0),i=f.find("iframe").get(0),j=f.find(".lg-vk").get(0),k=f.find("video").get(0); $('.main-image .swiper-slide iframe').each(function () { var oldsrc = $(this).attr('src'); if(oldsrc == undefined){ }else{ oldsrc = oldsrc.replace('?autoplay=1&rel=0&controls=1','',oldsrc); oldsrc = oldsrc.replace('?autoplay=0&rel=0&controls=0','',oldsrc); $(this).attr('src', oldsrc); } }); if(k){var vids = f.find("video"); if(vids.length > 0){ vids[0].pause(); vids[0].currentTime = 0; } } }); } } }); setTimeout(function() { $('.additional-images .video-link:first-child').trigger('click'); }, 10); if ($.fn.lightGallery != undefined) { $.getScript('https://cdnjs.cloudflare.com/ajax/libs/lg-video/1.4.0/lg-video.min.js'); } $(document).delegate('.main-image .swiper-button-next', 'click', function() { $('.main-image .swiper-slide-prev').each(function () { var f = $(this); g=f.find("iframe").get(0),h=f.find("iframe").get(0),i=f.find("iframe").get(0),j=f.find(".lg-vk").get(0),k=f.find("video").get(0); $('.main-image .swiper-slide-prev iframe').each(function () { var oldsrc = $(this).attr('src'); if(oldsrc == undefined){ }else{ oldsrc = oldsrc.replace('?autoplay=1&rel=0&controls=1','',oldsrc); oldsrc = oldsrc.replace('?autoplay=0&rel=0&controls=0','',oldsrc); $(this).attr('src', oldsrc); } }); if(k){var vids = f.find("video"); if(vids.length > 0){ vids[0].pause(); vids[0].currentTime = 0; } } }); $('.product-info .main-image .swiper-slide-active.swiper-slide-visible').each(function () { var index_value = $(this).data('index'); $('.product-info .additional-images').find("[data-index='" + index_value + "']").trigger('click'); }); }); $(document).delegate('.main-image .swiper-pagination-bullet', 'click', function() { $('.main-image .swiper-slide-next').each(function () { var f = $(this); g=f.find("iframe").get(0),h=f.find("iframe").get(0),i=f.find("iframe").get(0),j=f.find(".lg-vk").get(0),k=f.find("video").get(0); $('.main-image .swiper-slide-next iframe').each(function () { var oldsrc = $(this).attr('src'); if(oldsrc == undefined){ }else{ oldsrc = oldsrc.replace('?autoplay=1&rel=0&controls=1','',oldsrc); oldsrc = oldsrc.replace('?autoplay=0&rel=0&controls=0','',oldsrc); $(this).attr('src', oldsrc); } }); if(k){var vids = f.find("video"); if(vids.length > 0){ vids[0].pause(); vids[0].currentTime = 0; } } }); $('.main-image .swiper-slide-prev').each(function () { var f = $(this); g=f.find("iframe").get(0),h=f.find("iframe").get(0),i=f.find("iframe").get(0),j=f.find(".lg-vk").get(0),k=f.find("video").get(0); $('.main-image .swiper-slide-prev iframe').each(function () { var oldsrc = $(this).attr('src'); if(oldsrc == undefined){ }else{ oldsrc = oldsrc.replace('?autoplay=1&rel=0&controls=1','',oldsrc); oldsrc = oldsrc.replace('?autoplay=0&rel=0&controls=0','',oldsrc); $(this).attr('src', oldsrc); } }); if(k){var vids = f.find("video"); if(vids.length > 0){ vids[0].pause(); vids[0].currentTime = 0; } } }); $('.product-info .main-image .swiper-slide-active.swiper-slide-visible').each(function () { var index_value = $(this).data('index'); $('.product-info .additional-images').find("[data-index='" + index_value + "']").trigger('click'); }); }); $(document).delegate('.main-image .swiper-button-prev', 'click', function() { $('.main-image .swiper-slide-next').each(function () { var f = $(this); g=f.find("iframe").get(0),h=f.find("iframe").get(0),i=f.find("iframe").get(0),j=f.find(".lg-vk").get(0),k=f.find("video").get(0); $('.main-image .swiper-slide-next iframe').each(function () { var oldsrc = $(this).attr('src'); if(oldsrc == undefined){ }else{ oldsrc = oldsrc.replace('?autoplay=1&rel=0&controls=1','',oldsrc); oldsrc = oldsrc.replace('?autoplay=0&rel=0&controls=0','',oldsrc); $(this).attr('src', oldsrc); } }); if(k){var vids = f.find("video"); if(vids.length > 0){ vids[0].pause(); vids[0].currentTime = 0; } } }); $('.product-info .main-image .swiper-slide-active.swiper-slide-visible').each(function () { var index_value = $(this).data('index'); $('.product-info .additional-images').find("[data-index='" + index_value + "']").trigger('click'); }); }); }); });
💾 Kaydet
İptal
📝 Yeniden Adlandır
İptal
Kaydet
🔐 Dosya İzinleri (chmod)
İzin Değeri:
Hızlı Seçim:
777
755
644
600
777
= Herkes okur/yazar/çalıştırır
755
= Sahip tam, diğerleri okur/çalıştırır
644
= Sahip okur/yazar, diğerleri okur
600
= Sadece sahip okur/yazar
İptal
Uygula