back-swf.mkiv /size: 4405 b    last modification: 2020-07-01 14:35
1
%D \module
2
%D [ file=back-swf,
3
%D version=2009.12.31,
4
%D title=\CONTEXT\ Backend Macros,
5
%D subtitle=Shockwave Experiment,
6
%D author=Hans Hagen \& Luigi Scarso,
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 The question is: should I still document this in interaction.tex or just
15
%D assume it's obsolete technology \unknown
16 17
%D This is only a placeholder that demonstrates the usage of swf resources.
18
%D There is no need to include this file into the format. The module was
19
%D tested by Luigi and Willi and based on their suggestions the functionality
20
%D was improved.
21
%D
22
%D \starttyping
23
%D \enabletrackers[graphics.locating]
24
%D \enabletrackers[backend.swf]
25
%D
26
%D \startluaparameterset [swf:relative:resources]
27
%D relativepaths = {
28
%D "assets"
29
%D }
30
%D \stopluaparameterset
31
%D
32
%D \startluaparameterset[swf:relative:display]
33
%D toolbar = true,
34
%D preview = "images/posterframes/*.jpg", -- relative to assets
35
%D open = "click",
36
%D close = "focus",
37
%D \stopluaparameterset
38
%D
39
%D \startTEXpage
40
%D \externalfigure
41
%D [whatever.swf]
42
%D [resources=swf:relative:resources,
43
%D display=swf:relative:display]
44
%D \stopTEXpage
45
%D \stoptyping
46 47
%D Embedding (and using) movies used to be a breeze in acrobat but depended
48
%D on a plugin. Then we got renditions that depended on the built-in flash
49
%D player. And now we have rich media, depending on whatever and being able
50
%D to use the flash player as well ... but it's an erratic and soon obsolete
51
%D adventure. So \unknown\ we do provide the user the means but stay away
52
%D from it ourselves: it's a dead end. The following tricks use the already
53
%D present shockwave (flash) trickery.
54
%D
55
%D At some point we will no longer provide this in the core but load it at
56
%D runtime.
57
%D
58
%D \starttyping
59
%D \externalfigure
60
%D [shockwave]
61
%D [file=test.mp4,
62
%D label=foo]
63
%D
64
%D \useJSscripts[vplayer] % or \useJSscripts[videoplayer]
65
%D
66
%D \goto{START} [JS(StartShockwave{foo})]
67
%D \goto{REWIND}[JS(RewindShockwave{foo})]
68
%D \goto{PAUSE} [JS(PauseShockwave{foo})]
69
%D \goto{STOP} [JS(StopShockwave{foo})]
70
%D
71
%D \useexternalrendering[foo][application/x-shockwave-flash][test.swf][embed=yes,width=100pt,height=100pt]
72
%D \definerenderingwindow[foo][width=100pt,height=100pt]
73
%D
74
%D \placerenderingwindow[foo][foo]
75
%D
76
%D \goto{START}[StartRendering{foo}]
77
%D \goto{STOP} [StopRendering{foo}]
78
%D \goto{PAUSE}[PauseRendering{foo}]
79
%D
80
%D % \useexternalrendering[foo][audio/mpeg][t:/sources/akkerman.mp3][embed=yes]
81
%D % \definerenderingwindow[foo][width=0pt,height=0pt]
82
%D % % \placerenderingwindow[foo][foo]
83
%D % \setupbackgrounds[page][background=resources]
84
%D % \setlayer[resources]{\placerenderingwindow[foo][foo]}
85
%D % \goto{START}[StartRendering{foo}]
86
%D % \goto{STOP} [StopRendering{foo}]
87
%D % \goto{PAUSE}[PauseRendering{foo}]
88
%D \stoptyping
89 90
\unprotect
91 92
%D The code has moved to the (explicitly loaded) \JAVASCRIPT\ modules. See there
93
%D for more info.
94 95
\protect
\endinput
96 97
\starttext
98 99
\startluaparameterset
[
swf
:
myset
:
display
:
1
]
100
toolbar
=
true
,
101
preview
=
"
assets/images/posterframes/SPT_14-16_Ra_01_PN_LE01_02_DoLikeMeLater_posterframe.jpg
"
,
102
-- preview = "t:/sources/cow.pdf",
103
-- preview = "t:/sources/hacker.jpg",
104
open
=
"
click
"
,
-- click page focus
105
close
=
"
focus
"
,
-- click page focus
106
\stopluaparameterset
107 108
\startluaparameterset
[
swf
:
myset
:
resources
:
1
]
109
paths
=
{
110
"
assets
"
111
}
,
112
files
=
{
113
-- "somename_1"
114
-- "somename_1"
115
}
116
\stopluaparameterset
117 118
\startluaparameterset
[
swf
:
dolikemelater
:
resources
]
119
paths
=
{
120
"
assets
"
121
}
,
122
\stopluaparameterset
123 124
% preview=swf:myset:display:1
125
% controls=swf:myset:controls:1
126
% resources=swf:myset:resources:1
127 128
\placefigure
129
{
flash
demo
}
130
{
\startcombination
[
2
*
2
]
131
{
\externalfigure
[
trasf
1
.
swf
][
width
=
0
.
4
5
\textwidth
,
height
=
0
.
2
5
\textheight
]
}
{
one
}
132
{
\externalfigure
[
trasf
2
.
swf
][
width
=
0
.
4
5
\textwidth
,
height
=
0
.
2
5
\textheight
]
}
{
two
}
133
{
\externalfigure
[
trasf
3
.
swf
][
width
=
0
.
4
5
\textwidth
,
height
=
0
.
2
5
\textheight
]
}
{
three
}
134
{
\externalfigure
[
trasf
4
.
swf
][
width
=
0
.
4
5
\textwidth
,
height
=
0
.
2
5
\textheight
]
}
{
four
}
135
\stopcombination
}
136 137
\stoptext
138