<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<body></body>
$(document).ready(function(){
var video =[
{
"id":190,
"drive":"g",
"title":"Genius",
"format":"MP4",
"lang":"en",
"date":2016,
"director":"Michael Grandage",
"actor's":" Colin Firth, Jude Law, Nicole Kidman",
"quality":"HDRip",
"url":"https://goo.gl/2xL4jV",
"des":"A chronicle of Max Perkins's time as the book editor at Scribner, where he oversaw works by Thomas Wolfe, Ernest Hemingway, F. Scott Fitzgerald and others.",
"image":"https://goo.gl/bdARJl",
"video":"https://goo.gl/v03ShX",
"online":"",
"rating":"6",
"pg-rating":13,
"cat":"Drama",
"cat2":"Biography",
"cat3":"",
"length":104,
"Tag":"Drama, Biography",
"producer":"",
"date_added":1481664092,
"player":""
},
{
"id":185,
"title":"Shame",
"titleRu":"",
"format":"MP4",
"lang":"en",
"langRu":"",
"date":2011,
"director":"Steve McQueen",
"actor's":" Michael Fassbender, Carey Mulligan, James Badge Dale",
"quality":"HDRip",
"url":"https://goo.gl/7etjLv",
"des":"In New York City, Brandon's carefully cultivated private life - which allows him to indulge his sexual addiction - is disrupted when his sister arrives unannounced for an indefinite stay.",
"desRu":"",
"image": "https://goo.gl/Q5TsQ6",
"video2":"",
"video":"https://goo.gl/HnmhAF",
"online":"https://goo.gl/HnmhAF",
"rating":"7",
"pg-rating":17,
"cat":"Drama",
"cat2":"",
"cat3":"",
"length":101,
"Tag":"Drama",
"producer":"",
"date_added":1476505617,
"player":"https://content.jwplatform.com/previews/Ncan8zOs-UxT9s6Nu"
},
{
"id":184,
"title":"The Wolf of Wall Street",
"titleRu":"",
"format":"MP4",
"lang":"en",
"lang2":"",
"date":2013,
"director":"Martin Scorsese",
"actor's":"Leonardo DiCaprio, Jonah Hill, Margot Robbie",
"quality":"HDRip",
"url":"https://goo.gl/voqMOU",
"des":"In The Wolf of Wall Street DiCaprio plays Belfort, a Long Island penny stockbroker who served 36 months in prison for defrauding investors in a massive 1990s securities scam that involved widespread corruption on Wall Street and in the corporate banking world, including shoe designer Steve Madden.",
"desRu":"",
"image": "https://goo.gl/iixRU5",
"video2":"",
"video":"https://goo.gl/xlSzC3",
"online":"https://goo.gl/xlSzC3",
"rating":"8",
"pg-rating":13,
"cat":"Comedy",
"cat2":"Biography",
"cat3":"Crime",
"length":180,
"Tag":"Comedy",
"producer":"",
"date_added":1476501889,
"imdb":[{}],
"player":"https://content.jwplatform.com/previews/dWNdgTf2-xoMA00Uj"
},
{
"id":183,
"title":"Bad Moms",
"titleRu":"Очень плохие мамочки",
"format":"MP4",
"lang":"en",
"lang2":"ru",
"date":2016,
"director":"Jon Lucas",
"actor's":"Mila Kunis, Kathryn Hahn, Kristen Bell",
"quality":"HD",
"url":"http://tinyurl.com/z8a2h5n",
"desRu":"Очень плохие мамочки: сегодня ты прекрасная жена, хорошая мама и домохозяйка, но завтра уже тебе стоит немного расслабиться, как тебе сразу же напоминают об обязанностях. Почему только мужчинам можно развлекаться? Пора уже команде отчаянных мамочек круто отдохнуть и оторваться по полной.",
"des":"When three overworked and under-appreciated moms are pushed beyond their limits, they ditch their conventional responsibilities for a jolt of long overdue freedom, fun, and comedic self-indulgence.",
"image": "https://goo.gl/0P3AcQ",
"video2":"https://goo.gl/8gn7f0",
"video":"https://goo.gl/4F86VR",
"online":"https://goo.gl/8gn7f0",
"rating":"6",
"pg-rating":12,
"cat":"Comedy",
"cat2":"",
"cat3":"",
"length":100,
"Tag":"Comedy",
"producer":"",
"date_added":1476342750,
"player":"https://content.jwplatform.com/previews/UOJreT9Q-xoMA00Uj"
},
{
"id":182,
"title":"Лазурный берег",
"title-ru":"Лазурный берег",
"format":"MP4",
"lang":"ru",
"lang2":"",
"date":2015,
"director":"Angelina Jolie",
"actor's":"Brad Pitt, Angelina Jolie, Mélanie Laurent",
"quality":"DVD",
"url":"http://www.imdb.com/title/tt3707106/?ref_=nv_sr_1",
"des":"В мелодраме Лазурный берег Ванесса живет во Франции со своим мужем Роландом. Они путешествуют по стране. Недавно они стали замечать, что отдалились друг от друга. Но все поменялось, когда они заехали в один небольшой приморский городок.",
"desRu":"A couple tries to repair their marriage while staying at a hotel in France.",
"image": "https://goo.gl/p6KAic",
"video2":"",
"video":"https://goo.gl/zrKNjS",
"online":"https://goo.gl/zrKNjS",
"rating":"5",
"pg-rating":12,
"cat":"Drama",
"cat2":"Romance",
"cat3":"",
"length":122,
"Tag":"Drama, Romance",
"producer":"",
"date_added":1476074563,
"player":"https://content.jwplatform.com/previews/NheWZTBz-UxT9s6Nu"
},
{
"id":179,
"title":"Mechanic: Resurrection",
"title-ru":"Механик 2",
"format":"MP4",
"lang":"ru",
"lang2":"",
"date":2016,
"director":"Dennis Gansel",
"actor's":"Jason Statham, Jessica Alba, Tommy Lee Jones",
"quality":"HD",
"url":"https://goo.gl/PfHnHx",
"des":"Механик: Воскрешение: профессиональный механик Артур Бишоп снова берется за дело. На этот раз бандиты похитили его возлюбленную и передали, что вернут ее только в том случае, если он сможет совершить три убийства и обставить их как случайности. Артур может это сделать, вот только что он сделает с похитителями, это уже совсем другой вопрос.",
"desRu":"Arthur Bishop thought he had put his murderous past behind him when his most formidable foe kidnaps the love of his life. Now he is forced to travel the globe to complete three impossible assassinations, and do what he does best, make them look like accidents.",
"image": "https://goo.gl/HGPEYJ",
"video2":"",
"video":"https://goo.gl/BNsgYL",
"online":"https://goo.gl/BNsgYL",
"rating":"6",
"pg-rating":13,
"cat":"Action",
"cat2":"crime",
"cat3":"Thriller",
"length":98,
"Tag":"Action, Crime, Thriller",
"producer":"",
"date_added":1476062820
},
{
"id":178,
"title":"American Beauty",
"title-ru":"",
"format":"MP4",
"lang":"en",
"lang2":"",
"date":1999,
"director":"Sam Mendes",
"actor's":"Kevin Spacey, Annette Bening, Thora Birch",
"quality":"HD",
"url":"https://goo.gl/NVNXK",
"desRu":"",
"des":"Lester and Carolyn Burnham are, on the outside, a perfect husband and wife in a perfect house in a perfect neighborhood. But inside, Lester is slipping deeper and deeper into a hopeless depression. He finally snaps when he becomes infatuated with one of his daughter's friends. Meanwhile, his daughter Jane is developing a happy friendship with a shy boy-next-door named Ricky, who lives with an abusive father.",
"image": "https://goo.gl/6xBJ6T",
"video2":"",
"video":"https://goo.gl/i7oy9e",
"online":"https://goo.gl/i7oy9e",
"rating":"8",
"pg-rating":13,
"cat":"Drama",
"cat2":"Romance",
"cat3":"",
"length":122,
"Tag":"Drama, Romance",
"producer":"",
"date_added":1475625421
},
{
"id":177,
"title":"Дрессировка",
"title-ru":"",
"format":"MP4",
"lang":"ru",
"lang2":"",
"date":1986,
"director":"Pierre B. Reinhard",
"actor's":"Véronique Catanzaro, Patrick Guillemin, Marc Henry",
"quality":"DVD",
"url":"https://goo.gl/pQK3wd",
"desRu":"",
"des":"Дрессировка - эротическая мелодрама про двух молодых развратниц и их сексуальные игры. У них коварный план: соблазнить двух парней из известных семей, чтобы таким образом подпортить их репутацию. Девушки уверены в себе и уже начинают приниматься за выполнение плана.",
"image": "https://goo.gl/bAQui5",
"video2":"",
"video":"https://goo.gl/Z0cX1U",
"online":"https://goo.gl/Z0cX1U",
"rating":"6",
"pg-rating":16,
"cat":"Retro",
"cat2":"Comedy",
"cat3":"",
"length":98,
"Tag":"Retro, Comedy",
"producer":"",
"date_added":1475624574
},
{
"id":176,
"title":"Учительница в колледже",
"title-ru":"",
"format":"MP4",
"lang":"ru",
"lang2":"",
"date":1978,
"director":"Mariano Laurenti",
"actor's":"Edwige Fenech, Renzo Montagnani, Alvaro Vitali",
"quality":"DVD",
"url":"http://www.imdb.com/title/tt0077737/?ref_=fn_al_tt_1",
"desRu":"Edwige Fenech stars in this Italian sex-comedy as the new teacher in all-boys Catholic school. All of the boys desire for the chance to learn more about their new teacher, but only 1 student gets the opportunity.",
"des":"Учительница в колледже - эротика про очаровательную учительницу английского языка Монику. Как только она пришла на работу в колледж, так сразу мужской пол стал намного активнее ходить на ее занятия. Ведь такой сексуальной преподавательницы у них давно не было.",
"image": "http://kino-v-online.tv/uploads/posts/online-1475577160.jpg",
"video2":"",
"video":"http://kino-v-online.tv/kino/6998bc9b3fd74a6a8c7718b536089c81/Uchitelnica_v_kolledzhe.mp4?35",
"online":"https://s3-us-west-2.amazonaws.com/filmairetro/%D0%A3%D1%87%D0%B8%D1%82%D0%B5%D0%BB%D1%8C%D0%BD%D0%B8%D1%86%D0%B0+%D0%B2+%D0%BA%D0%BE%D0%BB%D0%BB%D0%B5%D0%B4%D0%B6%D0%B5/Uchitelnica_v_kolledzhe.mp4",
"rating":"5",
"pg-rating":16,
"cat":"Retro",
"cat2":"Comedy",
"cat3":"",
"length":86,
"Tag":"Comedy",
"producer":"",
"date_added":1475623236
}
];
var movie_window = function(drive,movie,title,image,des,cat){
var category = cat;
var videoTitle = title;
var tmp =[];
$('#myModal').html("");
$('footer').remove();
$('body').append($('<footer/>'));
$('footer').append($('<div/>',{'class':'modal fade','id':'myModal','role':'dialog'}));
$('#myModal').append($('<div/>',{'class':'modal-dialog'}));
$('.modal-dialog').append($('<div/>',{'class':'modal-content'}));
$('.modal-content').append($('<div/>',{'class':'modal-header'}));
$('.modal-header').append($('<button/>',{'class':'close','data-dismiss':'modal','aria-label':'Close'}));
$('.close').append($('<span/>',{'aria-hidden':true,text:'X'}));
$('.modal-header').append($('<h2/>',{'class':'modal-title',html:'<label class="label label-lg label-info">' + title + '<label/>','style':'font-size:1.7em;font-family: "Gill Sans Extrabold", Helvetica, sans-serif;'}));
$('.modal-content').append($('<div/>',{'class':'modal-body'}));
$('.modal-body').append($('<img/>',{'src':image,'class':'img-responsive','width':'250px','height':'280px','id':'poster-image'})).append('<br />');
$('.modal-body').append($('<button/>',{'type':'button','class':'btn btn-primary',text:"About Movie",'data-container':'body','data-toggle':'popover','data-placement':'right','data-content':des})).append('<br><br />');
if(!drive){
setTimeout(function(){
var image = new Image(50,35);
image.src = 'http://megaicons.net/static/img/icons_sizes/8/178/512/users-checked-user-icon.png';
image.className = 'img-responsive pull-right';
image.alt = "Secure Icon";
$(image).attr({'margin':'auto','data-toggle':'tooltip','title':'Available to everyone'});
$('.modal-title').append(image);
}, 700);
$('.modal-body').append($('<div/>',{'class':'player_modal'}));
$('.player_modal').append($('<video/>',{'id':'video-player','width':'350','height':'220','controls':'controls', 'preload':'metadata'})).css({'margin':'2px'});
$('#video-player').append($('<source/>',{'src':movie}));
}else if(drive === 'g'){
setTimeout(function(){
var image = new Image(50,35);
image.src = 'http://www.rvalabs.com/wp-content/uploads/2014/01/antivirus2.gif';
image.className = 'img-responsive pull-right';
image.alt = "Secure Icon";
$(image).attr({'margin':'auto','data-toggle':'tooltip','title':'Protected: Only Users with Permissions can view this file'});
$('.modal-title').append(image);
$(image).click(function(e){
e.preventDefault();
window.open("mailto:info@gmail.com?subject=I%20wish%20to%20view%20content%20of%20your%20site.");
});
}, 700);
$('.modal-body img').remove('');
$('.modal-body').append($('<iframe/>',{'src':image, 'width':'200','height':'180'}));
$('.modal-body').append($('<div/>',{'class':'player_modal'}));
$('.player_modal').append($('<iframe/>',{'src':movie,'id':'video-player','width':'350','height':'220','controls':'controls', 'preload':'metadata','frameborder':0, 'scrolling':'auto', 'allowfullscreen': true})).css({'margin':'2px'});
/*
*Stop Playing video
*/
$('.close').click(function(){
$('#video-player').removeAttr('src');
});
}else{
return;
}
$('.modal-content').append($('<div/>',{'class':'modal-footer'}));
$('.modal-footer').append($('<p/>',{'class':'label label-warning label-lg pull-left','id':'similar-movies',text:'Latest Movies In this Category'}));
$('#similar-movies').append($('<hr/>'));
for(var x in video){
if(video[x].cat == category && video[x].title !== videoTitle){
if(tmp.length >= 5){
break;
}else{
tmp.push(video[x].title);
}
}
}
var displayInfo = function(){
for(var s in tmp){
$('#similar-movies').append($('<p/>',{
'class':'label label-info label-lg pull-left',
'style':'margin:4px;',
'id':s,
text:tmp[s]}));
}
}//end
//Call Display info function
displayInfo();
/*
*Bug Fixed on 18/01/17
*/
$('#similar-movies p').hover(function(e){
e.preventDefault();
var id = $(this).attr('id');
var image = new Image(80, 60);
for(var x in video){
if(video[x].title == tmp[id]){
image.src = video[x].image;
image.className = "img-responsive";
image.alt = tmp[id];
image.id = "similarMovies";
}
}
$(this).html(image);
$('img').mouseenter(function(e){
e.preventDefault();
var title = $(this).attr('alt');
for(var x in video){
if(video[x].title == title){
var watchMovie = video[x];
$(this).attr({'data-tooltip':'toggle','title':watchMovie.des});
$(this).click(function(e){
e.preventDefault();
movie_window(watchMovie.drive,watchMovie.video,watchMovie.title,watchMovie.image,watchMovie.des,watchMovie.cat);
});
break;
}
}
}).mouseleave(function(){
$(this).removeAttr('title');
id = null;
});
});
/*
* Change background image, depends on category
* look to change background() function
*/
change_background_image('.modal-body',cat);
/*
* Function toggles window
*/
$('#myModal').modal("toggle");
/*
* Function toggles popover
*/
$('.modal-body button').mouseenter(function(){
$('.modal-body button').popover('show');
}).mouseleave(function(){
$('.modal-body button').popover('hide');
});
/*
* Remove video player from window, stop downloading video from server
*/
$('.modal-header button').click(function(event){
event.preventDefault();
$('.player_modal video').remove();
return;
});
};//end movie_window()
/**
* Function changes background images dependant on category
*/
var change_background_image = function(element,category){
var tmp_coll = [];
this.element = element;
var backgrounds = [
{"cat":"Action","image":"http://icons.iconarchive.com/icons/lajonard/movie-folder/256/Action-icon.png"},
{"cat":"Action","image":"http://icons.iconarchive.com/icons/limav/movie-genres-folder/512/Action-icon.png"},
{"cat":"Horror","image":"http://files.softicons.com/download/folder-icons/free-movie-folder-icons-by-design-bolts/png/256x256/Horror-Movies.png"},
{"cat":"Horror","image":"http://files.softicons.com/download/tv-movie-icons/movie-genres-icons-2013-by-sirubico/png/256x256/Folder_Horror_1.png"},
{"cat":"Comedy","image":"http://icons.iconarchive.com/icons/sirubico/movie-genre/256/Comedy-icon.png"},
{"cat":"Comedy","image":"http://orig05.deviantart.net/cf5f/f/2015/281/3/b/comedy_folder_icon_by_giilpereiraa-d9cenzn.png"},
{"cat":"Drama","image":"http://icons.iconarchive.com/icons/limav/movie-genres-folder/512/Drama-icon.png"},
{"cat":"Drama","image":"http://orig01.deviantart.net/fe0d/f/2015/281/6/c/drama_folder_icon_by_giilpereiraa-d9ceo6f.png"}
];
//$('#back').animate({opacity: 0}, 0).css({'background-image': 'url(http://vaughnroyko.com/jsfiddle/back.png)'}).animate({opacity: 1}, 2500);
for(var x in backgrounds){
if(backgrounds[x].cat == category){
tmp_coll.push(backgrounds[x]);
var tmp = Math.floor(Math.random() * tmp_coll.length);
$(element).css({'background-image': 'url("'+ tmp_coll[tmp].image +'")',
'background-repeat':'no-repeat',
'background-size':'cover','opacity':'0'}).animate({'opacity':'1'}, 2500);
}
}
if(tmp == null){
$(element).css({
'background-image': 'url("https://image.tmdb.org/t/p/w500/edM906NOM5WxaaAMeTsgDeqnBDr.jpg")',
'background-repeat':'no-repeat',
'background-size':'cover',
'background-position':'80% 50%',
'opacity':'0'}).animate({'opacity':'1'}, 2500);
}
}
var ran = Math.floor(Math.random() * video.length);
movie_window(video[ran].drive, video[ran].video, video[ran].title, video[ran].image, video[ran].des, video[ran].cat);
});