-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8a02de0
commit 378ffd9
Showing
8 changed files
with
241 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
|
||
/** | ||
* Module dependencies | ||
*/ | ||
|
||
var express = require('express'); | ||
var sio = require('socket.io'); | ||
var http = require('http'); | ||
|
||
|
||
var app = express(); | ||
|
||
app.use(express.static('rc/static')); | ||
|
||
var server = http.createServer(app).listen(8889); | ||
|
||
var io = sio.listen(server); | ||
|
||
io.set('log level', 0); | ||
|
||
io.sockets.on('connection', function(socket){ | ||
|
||
var movies = App.getTorrentsCollection({ | ||
searchTerm: null, | ||
genre: null | ||
}); | ||
|
||
movies.fetch(); | ||
|
||
movies.on('add', function(movie){ | ||
socket.emit('movie', movie); | ||
}) | ||
|
||
socket.on('play', function(data){ | ||
var movie = movies.find(function(model) { return model.get('torrent') === data.torrent; }); | ||
console.log(movie.get('torrent')); | ||
App.sidebar.model = movie; | ||
App.sidebar.play($.Event('click')); | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<title>Popcorn Time Remote Control</title> | ||
<meta name="viewport" content="initial-scale=1, maximum-scale=1"> | ||
<meta name="apple-mobile-web-app-capable" content="yes"> | ||
<meta name="mobile-web-app-capable" content="yes"> | ||
<link type="text/css" rel="stylesheet" href="/styles/style.css" /> | ||
<link href='http://fonts.googleapis.com/css?family=Roboto' rel='stylesheet' type='text/css'> | ||
</head> | ||
<body> | ||
<div id="header"> | ||
<input type="text" placeholder="Search..." /> | ||
</div> | ||
<div id="main"> | ||
</div> | ||
<div id="footer"> | ||
</div> | ||
|
||
<div id="overlay"> | ||
<div class="info"> | ||
</div> | ||
</div> | ||
|
||
<script src="/socket.io/socket.io.js"></script> | ||
<script src="/js/jquery.min.js"></script> | ||
<script src="/js/hammer.min.js"></script> | ||
<script src="/js/index.js"></script> | ||
</body> | ||
</html> |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
;(function(){ | ||
|
||
var socket = io.connect(); | ||
|
||
var $main = $('#main'); | ||
|
||
/* | ||
var hammer = Hammer(document.getElementById('main'), { | ||
prevent_default: true | ||
}); | ||
hammer.on("swipeleft", function() { | ||
alert('you swiped left!'); | ||
}); | ||
*/ | ||
|
||
socket.on('movie', function(movie){ | ||
var $img = $('<img />').attr('src', movie.coverImage) | ||
.data(movie); | ||
|
||
$main.append($img); | ||
|
||
$img.on('click', $main, function(){ | ||
showOverlay($img.data()); | ||
}); | ||
|
||
}); | ||
//■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ | ||
var $overlay = $('#overlay'); | ||
var $info = $overlay.find('.info'); | ||
|
||
function showOverlay(movie) { | ||
$overlay.css({ 'background': ' rgba(0,0,0,.1) url('+movie.backdrop+') no-repeat center center fixed'}); | ||
|
||
var info = '<h1>'+movie.title+'</h1>' + | ||
'<h3>' + movie.year + ' ● ' + movie.runtime + 'min</h3>' + | ||
'<p>' + movie.synopsis + '</p>' + | ||
'<a href="#">WATCH NOW</a>'; | ||
|
||
$('#main').css('overflow', 'hidden'); | ||
$info.html(info) | ||
$overlay.show(); | ||
|
||
$info.find('a').click(function(){ | ||
socket.emit('play', movie); | ||
}); | ||
} | ||
|
||
})(); |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
* { | ||
-webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */ | ||
-moz-box-sizing: border-box; /* Firefox, other Gecko */ | ||
box-sizing: border-box; /* Opera/IE 8+ */ | ||
} | ||
|
||
html, body { | ||
margin: 0; | ||
padding: 0; | ||
width: 100%; | ||
height: 100%; | ||
background: #1a1a1a; | ||
font-family: 'Roboto', sans-serif; | ||
} | ||
|
||
#header { | ||
width: 92%; | ||
height: 32px; | ||
margin-left: 2.5%; | ||
margin-right: 7.5%; | ||
margin-top: 10px; | ||
border: 2px solid #767676; | ||
} | ||
|
||
#header input { | ||
background: #1a1a1a; | ||
width: 100%; | ||
height: 28px; | ||
border: none; | ||
color: #767676; | ||
padding-left: 20px; | ||
font-size: 20px; | ||
} | ||
|
||
#main { | ||
width: 100%; | ||
height: 100%; | ||
} | ||
|
||
#main img { | ||
float: left; | ||
width: 47.5%; | ||
padding-left: 2.5%; | ||
margin-top: 2.5%; | ||
} | ||
|
||
#overlay { | ||
display: none; | ||
z-index: 3; | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
bottom: 0; | ||
right: 0; | ||
width: 100%; | ||
height: 100%; | ||
padding: 5%; | ||
-webkit-background-size: cover !important; | ||
-moz-background-size: cover !important; | ||
-o-background-size: cover !important; | ||
background-size: cover !important; | ||
} | ||
|
||
#overlay .info { | ||
color: #fff; | ||
height: 100%; | ||
width: 100%; | ||
background: rgba(26,26,26,.92); | ||
padding: 5%; | ||
word-break: break-word; | ||
position: relative; | ||
border-radius: 2px; | ||
-webkit-border-radius: 2px; | ||
-moz-border-radius: 2px; | ||
} | ||
|
||
#overlay .info h3 { | ||
color: #2667b8; | ||
} | ||
|
||
#overlay .info p { | ||
font-size: 14px; | ||
height: 50%; | ||
overflow-y: scroll; | ||
} | ||
|
||
|
||
#overlay .info a { | ||
background: #2667b8; | ||
text-decoration: none; | ||
color: #fff; | ||
height: 90px; | ||
font-size: 20px; | ||
padding-top: 30px; | ||
font-weight: bold; | ||
text-align: center; | ||
display: block; | ||
width: 100%; | ||
position: absolute; | ||
bottom: 0; | ||
left: 0; | ||
} |
378ffd9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How would you access the remote page? localhost:8889 is not working
378ffd9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Im think its localhost:8888
378ffd9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pvieito yourip:8889
378ffd9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not working for me, it seems it requires some packages that are not imported. Why is the
node_modules/
folder in .gitignore?378ffd9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pvieito did you try npm install ?
378ffd9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@abadfederico oh, I forgot to do it this time, thanks. Now working!
378ffd9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm having trouble http://notepad.cc/erro_remote_control
378ffd9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't get it working..
whence the
App
should come from?378ffd9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alexeyfrolov if you can fix the problems, please provide a "feedback". I am also experiencing this problem.