~ubuntu-branches/ubuntu/wily/mplayerplug-in/wily

« back to all changes in this revision

Viewing changes to DOCS/tech/javascript.txt

  • Committer: Bazaar Package Importer
  • Author(s): Cesare Tirabassi
  • Date: 2008-07-06 23:35:53 UTC
  • mto: (3.1.2 lenny)
  • mto: This revision was merged to the branch mainline in revision 25.
  • Revision ID: james.westby@ubuntu.com-20080706233553-taa8l29w5yrr1z47
Tags: upstream-3.55
ImportĀ upstreamĀ versionĀ 3.55

Show diffs side-by-side

added added

removed removed

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