1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191
|
mplayerplug-in supports the following javascript methods, properties and events
methods:
void Play();
void Pause();
void Stop();
void quit();
void DoPlay();
void DoPause();
void FastForward();
void FastReverse();
void ff();
void rew();
void rewind();
void Seek(in double value);
void Open(in string filename);
void SetFileName(in string filename);
double getTime();
double getDuration();
double getPercent();
void controls.play();
void controls.pause();
void controls.stop();
properties:
attribute string filename;
readonly attribute long playState;
attribute boolean ShowControls;
attribute boolean fullscreen;
attribute boolean showlogo;
boolean isplaying();
events:
onMediaComplete
onMediaCompleteWithError(error)
onEndOfStream
onVisible
onHidden
onDestroy
onClick
onMouseDown(button)
onMouseUp(button)
Detail:
Play(), DoPlay(), controls.play()
plays the current media
Pause(), DoPause(), controls.pause()
pauses the playing media
Stop(), controls.stop()
stops the playing media
quit()
cancels the media player triggers onMediaComplete and onEndOfStream events
FastForward(),ff()
Seeks forward 10 seconds in the media
FastReverse(),rew(),rewind()
Seeks backwards 10 seconds in the media
Seek(value)
Seeks "value" seconds into the media
Open(filename),SetFileName()
Opens "filename", but does not start it
getTime()
Returns the number of seconds into the media
getDuration()
Returns the number of seconds the media is long
getPercent()
Gets percentage of media played 0 = 0% 100= 100%
Will return 0 for some media types since duration is not always
available from mplayer
filename
Able to get and set this property
x = filename, puts the URL of the current media in x
filename = "x", opens URL x, like Open("x")
isplaying()
Returns true if playState > 1 and < 7
playState
read only property
Possible return values and meanings
UNDEFINED 0
STOPPED 1
PAUSED 2
PLAYING 3
SCANFORWARD 4
SCANREVERSE 5
BUFFERING 6
WAITING 7
MEDIAENDED 8
TRANSITIONING 9
READY 10
RECONNECTING 11
INITIALIZING 12
ShowControls
Boolean property to make the player controls visible or not
fullscreen
Boolean property to make the player go fullscreen or not
showlogo
Boolean property to make the logo visible or not
onMediaComplete, onEndOfStream
Events that are triggered when the playlist is empty
example:
<embed onEndOfStream='alert("media done");' src="http://host/some/media.mov"></embed>
onMediaCompleteWithError(error)
Events that are triggered when the playlist is empty
error is an integer
ERROR_NO_ERROR 0
ERROR_NO_STREAM 1
ERROR_CODEC_FAILURE ERROR_NO_STREAM << 1
ERROR_EXPLICIT_KILL ERROR_NO_STREAM << 2
ERROR_PLAYER_INTERRUPTED ERROR_NO_STREAM << 3
ERROR_EXECV ERROR_NO_STREAM << 4
ERROR_NOT_PLAYLIST ERROR_NO_STREAM << 5
ERROR_FILE_NOT_FOUND ERROR_NO_STREAM << 6
example:
<embed onMediaCompleteWithError='error_handler(error)' src="http://host/some/media.mov"></embed>
onVisible
Event that is triggered when video media is uncovered by a window, might want to use
with the nopauseonhide embed attribute
<embed onVisible='someMethod();' nopauseonhide=true src="http://host/some/media.mov"></embed>
onHidden
Event that is triggered when video media is covered by a window, might want to use
with the nopauseonhide embed attribute
<embed onHidden='someMethod();' nopauseonhide=true src="http://host/some/media.mov"></embed>
onDestroy
Event that is triggered when the embedded mplayerplug-in is destroyed, best used when mplayerplug-in
is in a frame and the frame is destroyed/hidden.
onClick
Event that is triggered when mouse button one is clicked over the plugin.
onMouseDown(button)
Event that is triggered when the mouse button is down over the plugin.
button is an integer that is the button that is down
onMouseUp(button)
Event that is triggered when the mouse button is released over the plugin.
button is an integer that is the button that is down
|