java-imp-videoplayer.mkiv /size: 2545 b    last modification: 2020-07-01 14:35
1
%D \module
2
%D [ file=java-imp-videoplayer,
3
%D version=2009.12.31,
4
%D title=\CONTEXT\ JavaScript Macros,
5
%D subtitle=Shockwave Support,
6
%D author=Hans Hagen,
7
%D date=\currentdate,
8
%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
9
%C
10
%C This module is part of the \CONTEXT\ macro||package and is
11
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
12
%C details.
13 14
%D As part of the interaction manual writing this code was moved here. It's
15
%D kind of obsolete as shockwave is obsolete.
16 17
% using videoplayer.swf from adobe or strobemediaplayback.swf from sourceforge:
18 19
\startluaparameterset
[
shockwave
:
display
]
20
toolbar
=
true
,
21
-- preview = "somefile",
22
open
=
"
click
"
,
23
close
=
"
focus
"
,
24
\stopluaparameterset
25 26
\startJSpreamble
shockwave
used
now
27 28
function
StartShockwave
(
label
)
{
29
var
rm
=
this
.
getAnnotsRichMedia
(
this
.
pageNum
,
label
)
[
0
]
;
30
if
(
rm
.
activated
)
{
31
rm
.
callAS
(
"
multimedia
_
play
"
)
;
32
}
else
{
33
rm
.
activated
=
true
;
34
}
35
}
36 37
function
StopShockwave
(
label
)
{
38
var
rm
=
this
.
getAnnotsRichMedia
(
this
.
pageNum
,
label
)
[
0
]
;
39
if
(
rm
.
activated
)
{
40
rm
.
callAS
(
"
multimedia
_
pause
"
)
;
41
rm
.
callAS
(
"
multimedia
_
rewind
"
)
;
42
}
43
}
44 45
function
RewindShockwave
(
label
)
{
46
var
rm
=
this
.
getAnnotsRichMedia
(
this
.
pageNum
,
label
)
[
0
]
;
47
if
(
rm
.
activated
)
{
48
rm
.
callAS
(
"
multimedia
_
rewind
"
)
;
49
}
50
}
51 52
function
PauseShockwave
(
label
)
{
53
var
rm
=
this
.
getAnnotsRichMedia
(
this
.
pageNum
,
label
)
[
0
]
;
54
if
(
rm
.
activated
)
{
55
rm
.
callAS
(
"
multimedia
_
pause
"
)
;
56
}
57
}
58 59
\stopJSpreamble
60 61
\definereference
[
StartShockwave
]
[
JS
(
StartShockwave
)
]
62
\definereference
[
StopShockwave
]
[
JS
(
StopShockwave
)
]
63
\definereference
[
RewindShockwave
]
[
JS
(
RewindShockwave
)
]
64
\definereference
[
PauseShockwave
]
[
JS
(
PauseShockwave
)
]
65 66
\unprotect
67 68
\doglobal
\useexternalfigure
69
[
shockwave
]
70
[
videoplayer
.
swf
]
71
[
\c!arguments
=
\luaparameterset
{
shockwave
:
arguments
}
{
source
=
"
\externalfigureparameter
\v!file
"
}
,
72
\c!resources
=
\luaparameterset
{
shockwave
:
resources
}
{
files
=
{
"
\externalfigureparameter
\v!file
"
}
}
,
73
\c!display
=
shockwave
:
display
]
74 75
% \doglobal \useexternalfigure
76
% [shockwave]
77
% [strobemediaplayback.swf]
78
% [arguments=\luaparameterset{shockwave:arguments}{src="\externalfigureparameter\v!file"},
79
% resources=\luaparameterset{shockwave:resources}{files={"\externalfigureparameter\v!file"}},
80
% display=shockwave:display]
81 82
\protect
\endinput
83