diff options
author | Hans Hagen <pragma@wxs.nl> | 2018-10-10 21:09:32 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2018-10-10 21:09:32 +0200 |
commit | 9f36318b0e571bcbc93dc2112d01bbf2178ed020 (patch) | |
tree | d6b075357717f7fde0bdf73aa364dbbca5417c50 /doc/context/sources/general | |
parent | 753dd0cbafc567d4960c5fc4888ccb4e2302c64d (diff) | |
download | context-9f36318b0e571bcbc93dc2112d01bbf2178ed020.tar.gz |
2018-10-08 17:52:00
Diffstat (limited to 'doc/context/sources/general')
-rw-r--r-- | doc/context/sources/general/manuals/interaction/interaction-javascript.tex | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/doc/context/sources/general/manuals/interaction/interaction-javascript.tex b/doc/context/sources/general/manuals/interaction/interaction-javascript.tex index 57ce54fb1..64e784464 100644 --- a/doc/context/sources/general/manuals/interaction/interaction-javascript.tex +++ b/doc/context/sources/general/manuals/interaction/interaction-javascript.tex @@ -88,6 +88,49 @@ However, the more functionality ended up in the program, the least interesting a recent \CONTEXT\ meeting, so who knows \unknown For now we're stuck with \JAVASCRIPT. +An example of \JAVASCRIPT\ usage is the following, where we load a video and add +some controls. Beware that this kind of functionality is very viewer dependent +and therefore also very unstable over time. Even worse, if you look at the loaded +\JAVASCRIPT\ file you will notice a dependency on soon obsolete (in \ACROBAT\ at +least) shockwave support. First we load a library that will predefine a video +graphic: and then create an instance: + +\starttyping +\useJSscripts[vplayer] + +\setupinteraction + [state=start] + +\externalfigure + [shockwave] + [frame=on, + width=480pt, + height=270pt, + file=test.mp4, + label=foo] +\stoptyping + +The controls are defined with: + +\starttyping +\goto{START} [JS(StartShockwave{foo})] +\goto{REWIND}[JS(RewindShockwave{foo})] +\goto{PAUSE} [JS(PauseShockwave{foo})] +\goto{STOP} [JS(StopShockwave{foo})] +\stoptyping + +or, as we have some defined reference shortcuts: + +\starttyping +\goto{START} [StartShockwave{foo}] +\goto{REWIND}[RewindShockwave{foo}] +\goto{PAUSE} [PauseShockwave{foo}] +\goto{STOP} [StopShockwave{foo}] +\stoptyping + +It's actually not that hard to add all kind of functionality if only we could be +sure of stable support and continuity. + \stopchapter \stopcomponent |