Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
aa
wiki
Commits
90d3f3ad
Commit
90d3f3ad
authored
Apr 12, 2012
by
Michael Murtaugh
Browse files
removed visibility requirement and caught exception on setting currentTime
parent
a067d623
Changes
1
Hide whitespace changes
Inline
Side-by-side
aawiki/static/aawiki/js/jquery.aamediasync.js
View file @
90d3f3ad
...
...
@@ -48,7 +48,7 @@ function aaMediaSync (element, opts) {
var
i
,
l
,
m
;
for
(
i
=
0
,
l
=
syncedmedia
.
length
;
i
<
l
;
i
++
)
{
m
=
syncedmedia
[
i
];
if
(
!
is_visible
(
m
))
{
continue
;
}
//
if (!is_visible(m)) { continue; }
if
(
!
((
m
.
readyState
>=
3
)
&&
!
m
.
seeking
)
)
{
return
false
;
}
...
...
@@ -80,7 +80,11 @@ function aaMediaSync (element, opts) {
if
(
elt
.
setCurrentTime
)
{
elt
.
setCurrentTime
(
t
);
}
else
{
try
{
elt
.
currentTime
=
t
;
}
catch
(
e
)
{
console
.
log
(
"
error setting time
"
,
elt
,
t
);
}
}
}
...
...
@@ -112,7 +116,7 @@ function aaMediaSync (element, opts) {
}
function
enter
(
elt
)
{
//console.log("enter", elt);
//
console.log("enter", elt);
// sync elt time to timeline
var
rt
=
getRelativeTime
(
element
,
elt
);
if
(
opts
.
trace
)
console
.
log
(
"
enter
"
,
elt
,
rt
);
...
...
@@ -138,7 +142,7 @@ function aaMediaSync (element, opts) {
if
(
opts
.
trace
)
console
.
log
(
"
initiate groupplay
"
);
if
(
get_all_ready
())
{
$
(
syncedmedia
).
each
(
function
()
{
if
(
this
!=
triggering_elt
&&
is_visible
(
this
))
{
if
(
this
!=
triggering_elt
)
{
//
&& is_visible(this)) {
this
.
play
()
}
});
...
...
@@ -150,9 +154,9 @@ function aaMediaSync (element, opts) {
if
(
opts
.
trace
)
console
.
log
(
"
ready, calling play
"
);
// timeline.play();
$
(
syncedmedia
).
each
(
function
()
{
if
(
is_visible
(
this
))
{
//
if (is_visible(this)) {
this
.
play
()
}
//
}
});
window
.
setTimeout
(
function
()
{
initiatingGroupPlay
=
false
;
...
...
@@ -183,7 +187,8 @@ function aaMediaSync (element, opts) {
// console.log("restore play state audio");
// timeline.play();
$
(
syncedmedia
).
each
(
function
()
{
if
(
is_visible
(
this
))
{
this
.
play
();
}
// if (is_visible(this)) { this.play(); }
this
.
play
();
});
}
});
...
...
@@ -217,7 +222,8 @@ function aaMediaSync (element, opts) {
bind
(
elt
,
"
pause.aamediasync
"
,
function
()
{
// console.log(elt, "pause");
var
eventreceiver
=
this
;
if
(
is_visible
(
this
)
&&
initiatingGroupPlay
===
false
&&
driver
===
null
)
{
// if (is_visible(this) && initiatingGroupPlay === false && driver === null) {
if
(
initiatingGroupPlay
===
false
&&
driver
===
null
)
{
// TRIGGER GROUP PAUSE
// timeline.pause();
$
(
syncedmedia
).
each
(
function
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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