Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
VideoLAN
VLC-iOS
Commits
2fc33cf8
Commit
2fc33cf8
authored
Nov 21, 2015
by
David Loiret
Browse files
remote playback: add getPlaying
parent
022bc9b6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Resources/web/playerControl.js
View file @
2fc33cf8
...
...
@@ -22,10 +22,16 @@ $(function() {
/**
* @method init
*/
Ws
.
prototype
.
init
=
function
()
{
Ws
.
prototype
.
init
=
function
(
fn
)
{
var
self
=
this
;
this
.
init
=
true
;
this
.
socket
.
onopen
=
function
()
{
self
.
_onOpen
(
this
);
if
(
self
.
init
&&
typeof
fn
===
'
function
'
)
{
//Should be called only once
fn
(
this
);
}
self
.
init
=
false
;
};
this
.
socket
.
onmessage
=
function
(
e
)
{
...
...
@@ -524,6 +530,16 @@ $(function() {
}
};
/**
* @method getPlaying
*/
PlayerControl
.
prototype
.
getPlaying
=
function
()
{
//Trigger playing event (from server)
this
.
socket
.
sendMessage
({
type
:
'
playing
'
});
};
/**
* @method playing
* @param {Object} message
...
...
@@ -560,13 +576,16 @@ $(function() {
var
socket
=
new
Ws
({
url
:
URL
});
socket
.
init
();
var
playerControl
=
new
PlayerControl
({
socket
:
socket
,
element
:
$
(
'
.player-control
'
)
});
playerControl
.
init
();
socket
.
init
(
function
()
{
playerControl
.
getPlaying
();
});
/**
* Map which method is allowed by event type
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment