~ubuntu-branches/ubuntu/natty/gecko-mediaplayer/natty

« back to all changes in this revision

Viewing changes to src/nsScriptablePeer.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Cesare Tirabassi
  • Date: 2007-11-04 10:51:22 UTC
  • Revision ID: james.westby@ubuntu.com-20071104105122-9javs7kuzqfv12l2
Tags: upstream-0.5.2
ImportĀ upstreamĀ versionĀ 0.5.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 
2
/* ***** BEGIN LICENSE BLOCK *****
 
3
 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
 
4
 *
 
5
 * The contents of this file are subject to the Mozilla Public License Version
 
6
 * 1.1 (the "License"); you may not use this file except in compliance with
 
7
 * the License. You may obtain a copy of the License at
 
8
 * http://www.mozilla.org/MPL/
 
9
 *
 
10
 * Software distributed under the License is distributed on an "AS IS" basis,
 
11
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 
12
 * for the specific language governing rights and limitations under the
 
13
 * License.
 
14
 *
 
15
 * The Original Code is mozilla.org code.
 
16
 *
 
17
 * The Initial Developer of the Original Code is
 
18
 * Netscape Communications Corporation.
 
19
 * Portions created by the Initial Developer are Copyright (C) 1998
 
20
 * the Initial Developer. All Rights Reserved.
 
21
 *
 
22
 * Contributor(s):
 
23
 *
 
24
 * Alternatively, the contents of this file may be used under the terms of
 
25
 * either the GNU General Public License Version 2 or later (the "GPL"), or
 
26
 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 
27
 * in which case the provisions of the GPL or the LGPL are applicable instead
 
28
 * of those above. If you wish to allow use of your version of this file only
 
29
 * under the terms of either the GPL or the LGPL, and not to allow others to
 
30
 * use your version of this file under the terms of the MPL, indicate your
 
31
 * decision by deleting the provisions above and replace them with the notice
 
32
 * and other provisions required by the GPL or the LGPL. If you do not delete
 
33
 * the provisions above, a recipient may use your version of this file under
 
34
 * the terms of any one of the MPL, the GPL or the LGPL.
 
35
 *
 
36
 * ***** END LICENSE BLOCK ***** */
 
37
 
 
38
// ==============================
 
39
// ! Scriptability related code !
 
40
// ==============================
 
41
 
 
42
/////////////////////////////////////////////////////
 
43
//
 
44
// This file implements the nsScriptablePeer object
 
45
// The native methods of this class are supposed to
 
46
// be callable from JavaScript
 
47
//
 
48
#include "plugin.h"
 
49
 
 
50
static NS_DEFINE_IID(kIScriptableIID, NS_ISCRIPTABLEGECKOMEDIAPLAYER_IID);
 
51
static NS_DEFINE_IID(kIScriptableControlIID, NS_ISCRIPTABLEGECKOMEDIAPLAYERCONTROLS_IID);
 
52
static NS_DEFINE_IID(kIClassInfoIID, NS_ICLASSINFO_IID);
 
53
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
 
54
 
 
55
nsScriptablePeer::nsScriptablePeer(nsPluginInstance * aPlugin)
 
56
{
 
57
    mPlugin = aPlugin;
 
58
    mRefCnt = 0;
 
59
    mPlugin = NULL;
 
60
}
 
61
 
 
62
nsScriptablePeer::~nsScriptablePeer()
 
63
{
 
64
}
 
65
 
 
66
void nsScriptablePeer::InitControls(nsControlsScriptablePeer * aControls)
 
67
{
 
68
    mControls = aControls;
 
69
}
 
70
 
 
71
// AddRef, Release and QueryInterface are common methods and must 
 
72
// be implemented for any interface
 
73
NS_IMETHODIMP_(nsrefcnt) nsScriptablePeer::AddRef()
 
74
{
 
75
    ++mRefCnt;
 
76
    return mRefCnt;
 
77
}
 
78
 
 
79
NS_IMETHODIMP_(nsrefcnt) nsScriptablePeer::Release()
 
80
{
 
81
    --mRefCnt;
 
82
    if (mRefCnt == 0) {
 
83
        delete this;
 
84
        return 0;
 
85
    }
 
86
    return mRefCnt;
 
87
}
 
88
 
 
89
// here nsScriptablePeer should return three interfaces it can be asked for by their iid's
 
90
// static casts are necessary to ensure that correct pointer is returned
 
91
NS_IMETHODIMP nsScriptablePeer::QueryInterface(const nsIID & aIID, void **aInstancePtr)
 
92
{
 
93
    if (!aInstancePtr)
 
94
        return NS_ERROR_NULL_POINTER;
 
95
 
 
96
    if (aIID.Equals(kIScriptableIID)) {
 
97
        *aInstancePtr = static_cast < nsIScriptableGeckoMediaPlayer * >(this);
 
98
        AddRef();
 
99
        return NS_OK;
 
100
    }
 
101
 
 
102
    if (aIID.Equals(kIClassInfoIID)) {
 
103
        *aInstancePtr = static_cast < nsIClassInfo * >(this);
 
104
        AddRef();
 
105
        return NS_OK;
 
106
    }
 
107
 
 
108
    if (aIID.Equals(kISupportsIID)) {
 
109
        *aInstancePtr =
 
110
            static_cast < nsISupports * >(static_cast < nsIScriptableGeckoMediaPlayer * >(this));
 
111
        AddRef();
 
112
        return NS_OK;
 
113
    }
 
114
 
 
115
    return NS_NOINTERFACE;
 
116
}
 
117
 
 
118
void nsScriptablePeer::SetInstance(nsPluginInstance * plugin)
 
119
{
 
120
    mPlugin = plugin;
 
121
}
 
122
 
 
123
//
 
124
// the following methods will be callable from JavaScript
 
125
//
 
126
 
 
127
NS_IMETHODIMP nsScriptablePeer::Play(void)
 
128
{
 
129
    printf("JS Play issued\n");
 
130
    mPlugin->Play();
 
131
    return NS_OK;
 
132
}
 
133
 
 
134
/* void PlayAt (in double value); */
 
135
NS_IMETHODIMP nsScriptablePeer::PlayAt(double value)
 
136
{
 
137
    printf("JS Play issued\n");
 
138
    // mPlugin->PlayAt(value);
 
139
    return NS_OK;
 
140
}
 
141
 
 
142
NS_IMETHODIMP nsScriptablePeer::Pause(void)
 
143
{
 
144
    printf("JS Pause issued\n");
 
145
    mPlugin->Pause();
 
146
    return NS_OK;
 
147
}
 
148
 
 
149
NS_IMETHODIMP nsScriptablePeer::PlayPause(void)
 
150
{
 
151
    printf("JS playPause issued\n");
 
152
    mPlugin->PlayPause();
 
153
    return NS_OK;
 
154
}
 
155
 
 
156
NS_IMETHODIMP nsScriptablePeer::Stop(void)
 
157
{
 
158
    printf("JS Stop issued\n");
 
159
    mPlugin->Stop();
 
160
    return NS_OK;
 
161
}
 
162
 
 
163
NS_IMETHODIMP nsScriptablePeer::Quit(void)
 
164
{
 
165
    printf("JS Quit issued\n");
 
166
    // mPlugin->Quit();
 
167
    return NS_OK;
 
168
}
 
169
 
 
170
NS_IMETHODIMP nsScriptablePeer::DoPlay(void)
 
171
{
 
172
    printf("JS DoPlay issued\n");
 
173
    mPlugin->Play();
 
174
    return NS_OK;
 
175
}
 
176
 
 
177
NS_IMETHODIMP nsScriptablePeer::DoPause(void)
 
178
{
 
179
    printf("JS DoPause issued\n");
 
180
    mPlugin->Pause();
 
181
    return NS_OK;
 
182
}
 
183
 
 
184
NS_IMETHODIMP nsScriptablePeer::FastForward(void)
 
185
{
 
186
    printf("JS FastForward issued\n");
 
187
    mPlugin->FastForward();
 
188
    return NS_OK;
 
189
}
 
190
 
 
191
NS_IMETHODIMP nsScriptablePeer::FastReverse(void)
 
192
{
 
193
    printf("JS FastReverse issued\n");
 
194
    mPlugin->FastReverse();
 
195
    return NS_OK;
 
196
}
 
197
 
 
198
NS_IMETHODIMP nsScriptablePeer::Ff(void)
 
199
{
 
200
    printf("JS ff issued\n");
 
201
    mPlugin->FastForward();
 
202
    return NS_OK;
 
203
}
 
204
 
 
205
NS_IMETHODIMP nsScriptablePeer::Rew(void)
 
206
{
 
207
    printf("JS rew issued\n");
 
208
    mPlugin->FastReverse();
 
209
    return NS_OK;
 
210
}
 
211
 
 
212
NS_IMETHODIMP nsScriptablePeer::Rewind(void)
 
213
{
 
214
    printf("JS Quit issued\n");
 
215
    mPlugin->FastReverse();
 
216
    return NS_OK;
 
217
}
 
218
 
 
219
NS_IMETHODIMP nsScriptablePeer::Seek(double counter)
 
220
{
 
221
    printf("JS Seek issued\n");
 
222
    mPlugin->Seek(counter);
 
223
    return NS_OK;
 
224
}
 
225
 
 
226
NS_IMETHODIMP nsScriptablePeer::GetPlayState(PRInt32 * aPlayState)
 
227
{
 
228
    printf("JS playState issued\n");
 
229
    if (mPlugin != NULL) {
 
230
        mPlugin->GetPlayState(aPlayState);
 
231
    } else {
 
232
        *aPlayState = STATE_UNDEFINED;
 
233
    }
 
234
    return NS_OK;
 
235
}
 
236
 
 
237
NS_IMETHODIMP nsScriptablePeer::GetTime(double *_retval)
 
238
{
 
239
    printf("JS getTime issued\n");
 
240
    mPlugin->GetTime(_retval);
 
241
    return NS_OK;
 
242
}
 
243
 
 
244
NS_IMETHODIMP nsScriptablePeer::GetDuration(double *_retval)
 
245
{
 
246
    printf("JS getDuration issued\n");
 
247
    mPlugin->GetDuration(_retval);
 
248
    return NS_OK;
 
249
}
 
250
 
 
251
NS_IMETHODIMP nsScriptablePeer::GetPercent(double *_retval)
 
252
{
 
253
    printf("JS getPercent issued\n");
 
254
    mPlugin->GetPercent(_retval);
 
255
    return NS_OK;
 
256
}
 
257
 
 
258
NS_IMETHODIMP nsScriptablePeer::GetFilename(char **aFilename)
 
259
{
 
260
    printf("JS filename issued\n");
 
261
    mPlugin->GetFilename(aFilename);
 
262
    return NS_OK;
 
263
}
 
264
 
 
265
NS_IMETHODIMP nsScriptablePeer::SetFilename(const char *aFilename)
 
266
{
 
267
    printf("JS filename issued\n");
 
268
    mPlugin->SetFilename(aFilename);
 
269
    return NS_OK;
 
270
}
 
271
 
 
272
NS_IMETHODIMP nsScriptablePeer::GetSrc(char **aSrc)
 
273
{
 
274
    printf("JS src requested\n");
 
275
    mPlugin->GetFilename(aSrc);
 
276
    return NS_OK;
 
277
}
 
278
 
 
279
NS_IMETHODIMP nsScriptablePeer::SetSrc(const char *aSrc)
 
280
{
 
281
    printf("JS src issued to %s\n",aSrc);
 
282
    mPlugin->SetFilename(aSrc);
 
283
    return NS_OK;
 
284
}
 
285
 
 
286
NS_IMETHODIMP nsScriptablePeer::Open(const char *filename)
 
287
{
 
288
    printf("JS filename issued\n");
 
289
    mPlugin->SetFilename(filename);
 
290
    return NS_OK;
 
291
}
 
292
 
 
293
/* void SetVolume (in double value); */
 
294
NS_IMETHODIMP nsScriptablePeer::SetVolume(double value)
 
295
{
 
296
    printf("JS SetVolume issued\n");
 
297
    mPlugin->SetVolume(value);
 
298
    return NS_OK;
 
299
}
 
300
 
 
301
/* double GetVolume (); */
 
302
NS_IMETHODIMP nsScriptablePeer::GetVolume(double *_retval)
 
303
{
 
304
    printf("JS GetVolume issued\n");
 
305
    mPlugin->GetVolume(_retval);
 
306
    return NS_OK;
 
307
}
 
308
 
 
309
 
 
310
NS_IMETHODIMP nsScriptablePeer::SetFileName(const char *filename)
 
311
{
 
312
    printf("JS filename issued\n");
 
313
    mPlugin->SetFilename(filename);
 
314
    return NS_OK;
 
315
}
 
316
 
 
317
/* void SetIsLooping (in boolean loop); */
 
318
NS_IMETHODIMP nsScriptablePeer::SetIsLooping(PRBool loop)
 
319
{
 
320
    printf("JS SetIsLooping issued\n");
 
321
    mPlugin->SetLoop(loop);
 
322
    return NS_OK;
 
323
}
 
324
 
 
325
/* boolean GetIsLooping (); */
 
326
NS_IMETHODIMP nsScriptablePeer::GetIsLooping(PRBool * _retval)
 
327
{
 
328
    printf("JS GetIsLooping issued\n");
 
329
    mPlugin->GetLoop(_retval);
 
330
    return NS_OK;
 
331
}
 
332
 
 
333
/* void SetAutoPlay (in boolean autoPlay); */
 
334
NS_IMETHODIMP nsScriptablePeer::SetAutoPlay(PRBool autoPlay)
 
335
{
 
336
    printf("JS SetAutoPlay issued\n");
 
337
    // mPlugin->SetAutoPlay(autoPlay);
 
338
    return NS_OK;
 
339
}
 
340
 
 
341
/* boolean GetAutoPlay (); */
 
342
NS_IMETHODIMP nsScriptablePeer::GetAutoPlay(PRBool * _retval)
 
343
{
 
344
    printf("JS GetAutoPlay issued\n");
 
345
    // mPlugin->GetAutoPlay(_retval);
 
346
    return NS_OK;
 
347
}
 
348
 
 
349
  /* boolean isplaying (); */
 
350
NS_IMETHODIMP nsScriptablePeer::Isplaying(PRBool * _retval)
 
351
{
 
352
    printf("JS isplaying issued\n");
 
353
    // mPlugin->GetPlaying(_retval);
 
354
    return NS_OK;
 
355
}
 
356
 
 
357
/* void playlistAppend (in string filename); */
 
358
NS_IMETHODIMP nsScriptablePeer::PlaylistAppend(const char *item)
 
359
{
 
360
    printf("JS playlistAppend issued\n");
 
361
    // mPlugin->PlaylistAppend(item);
 
362
    return NS_OK;
 
363
}
 
364
 
 
365
/* void playlistClear (PRInt32 *_retval; */
 
366
NS_IMETHODIMP nsScriptablePeer::PlaylistClear(PRBool * _retval)
 
367
{
 
368
    printf("JS playlistClear issued\n");
 
369
    // mPlugin->PlaylistClear(_retval);
 
370
    return NS_OK;
 
371
}
 
372
 
 
373
 
 
374
/* void SetHREF (in string url); */
 
375
NS_IMETHODIMP nsScriptablePeer::SetHREF(const char *url)
 
376
{
 
377
    printf("JS filename issued\n");
 
378
    mPlugin->SetFilename(url);
 
379
    return NS_OK;
 
380
}
 
381
 
 
382
/* string GetHREF (); */
 
383
NS_IMETHODIMP nsScriptablePeer::GetHREF(char **_retval)
 
384
{
 
385
    printf("JS filename issued\n");
 
386
    mPlugin->GetFilename(_retval);
 
387
    return NS_OK;
 
388
}
 
389
 
 
390
/* void SetURL (in string url); */
 
391
NS_IMETHODIMP nsScriptablePeer::SetURL(const char *url)
 
392
{
 
393
    printf("JS filename issued\n");
 
394
    mPlugin->SetFilename(url);
 
395
    return NS_OK;
 
396
}
 
397
 
 
398
/* string GetURL (); */
 
399
NS_IMETHODIMP nsScriptablePeer::GetURL(char **_retval)
 
400
{
 
401
    printf("JS filename issued\n");
 
402
    mPlugin->GetFilename(_retval);
 
403
    return NS_OK;
 
404
}
 
405
 
 
406
/* string GetMIMEType (); */
 
407
NS_IMETHODIMP nsScriptablePeer::GetMIMEType(char **_retval)
 
408
{
 
409
    printf("JS GetMIMEType issued\n");
 
410
    mPlugin->GetMIMEType(_retval);
 
411
    return NS_OK;
 
412
}
 
413
 
 
414
NS_IMETHODIMP nsScriptablePeer::GetShowControls(PRBool * aShowControls)
 
415
{
 
416
    printf("JS GetShowControls issued\n");
 
417
    mPlugin->GetShowControls(aShowControls);
 
418
    return NS_OK;
 
419
}
 
420
 
 
421
NS_IMETHODIMP nsScriptablePeer::SetShowControls(PRBool aShowControls)
 
422
{
 
423
    printf("JS SetShowControls issued\n");
 
424
    mPlugin->SetShowControls(aShowControls);
 
425
    return NS_OK;
 
426
}
 
427
 
 
428
NS_IMETHODIMP nsScriptablePeer::GetFullscreen(PRBool * aFullscreen)
 
429
{
 
430
    printf("JS GetFullscreen issued\n");
 
431
    mPlugin->GetFullScreen(aFullscreen);
 
432
    return NS_OK;
 
433
}
 
434
 
 
435
NS_IMETHODIMP nsScriptablePeer::SetFullscreen(PRBool aFullscreen)
 
436
{
 
437
    printf("JS SetFullscreen issued\n");
 
438
    mPlugin->SetFullScreen(aFullscreen);
 
439
    return NS_OK;
 
440
}
 
441
 
 
442
NS_IMETHODIMP nsScriptablePeer::GetShowlogo(PRBool * aShowlogo)
 
443
{
 
444
    printf("JS GetShowlogo issued\n");
 
445
    // mPlugin->GetShowlogo(aShowlogo);
 
446
    return NS_OK;
 
447
}
 
448
 
 
449
NS_IMETHODIMP nsScriptablePeer::SetShowlogo(PRBool aShowlogo)
 
450
{
 
451
    printf("JS SetShowlogo issued\n");
 
452
    // mPlugin->SetShowlogo(aShowlogo);
 
453
    return NS_OK;
 
454
}
 
455
 
 
456
NS_IMETHODIMP nsScriptablePeer::OnClick(const char *event)
 
457
{
 
458
    mPlugin->SetOnClick(event);
 
459
    return NS_OK;
 
460
}
 
461
 
 
462
NS_IMETHODIMP nsScriptablePeer::OnMediaComplete(const char *event)
 
463
{
 
464
    mPlugin->SetOnMediaComplete(event);
 
465
    return NS_OK;
 
466
}
 
467
 
 
468
NS_IMETHODIMP nsScriptablePeer::OnMouseUp(const char *event)
 
469
{
 
470
    mPlugin->SetOnMouseUp(event);
 
471
    return NS_OK;
 
472
}
 
473
 
 
474
NS_IMETHODIMP nsScriptablePeer::OnMouseDown(const char *event)
 
475
{
 
476
    mPlugin->SetOnMouseDown(event);
 
477
    return NS_OK;
 
478
}
 
479
 
 
480
NS_IMETHODIMP nsScriptablePeer::OnMouseOut(const char *event)
 
481
{
 
482
    mPlugin->SetOnMouseOut(event);
 
483
    return NS_OK;
 
484
}
 
485
 
 
486
NS_IMETHODIMP nsScriptablePeer::OnMouseOver(const char *event)
 
487
{
 
488
    mPlugin->SetOnMouseOver(event);
 
489
    return NS_OK;
 
490
}
 
491
 
 
492
NS_IMETHODIMP nsScriptablePeer::OnDestroy(const char *event)
 
493
{
 
494
    mPlugin->SetOnDestroy(event);
 
495
    return NS_OK;
 
496
}
 
497
 
 
498
// WMP Controls subset
 
499
 
 
500
NS_IMETHODIMP nsScriptablePeer::GetControls(nsIScriptableGeckoMediaPlayerControls * *aControls)
 
501
{
 
502
    *aControls = mControls;
 
503
    if (mControls == NULL)
 
504
        return NS_ERROR_NULL_POINTER;
 
505
    else
 
506
        return NS_OK;
 
507
}
 
508
 
 
509
 
 
510
nsControlsScriptablePeer::nsControlsScriptablePeer(nsPluginInstance * aPlugin)
 
511
{
 
512
    mPlugin = aPlugin;
 
513
    mRefCnt = 0;
 
514
}
 
515
 
 
516
nsControlsScriptablePeer::~nsControlsScriptablePeer()
 
517
{
 
518
    //printf("~nsScriptablePeer called\n");
 
519
}
 
520
 
 
521
// AddRef, Release and QueryInterface are common methods and must
 
522
// be implemented for any interface
 
523
NS_IMETHODIMP_(nsrefcnt) nsControlsScriptablePeer::AddRef()
 
524
{
 
525
    ++mRefCnt;
 
526
    return mRefCnt;
 
527
}
 
528
 
 
529
NS_IMETHODIMP_(nsrefcnt) nsControlsScriptablePeer::Release()
 
530
{
 
531
    --mRefCnt;
 
532
    if (mRefCnt == 0) {
 
533
        //delete this;
 
534
        return 0;
 
535
    }
 
536
    return mRefCnt;
 
537
}
 
538
 
 
539
// here nsScriptablePeer should return three interfaces it can be asked for by their iid's
 
540
// static casts are necessary to ensure that correct pointer is returned
 
541
NS_IMETHODIMP nsControlsScriptablePeer::QueryInterface(const nsIID & aIID, void **aInstancePtr)
 
542
{
 
543
    if (!aInstancePtr)
 
544
        return NS_ERROR_NULL_POINTER;
 
545
 
 
546
    if (aIID.Equals(kIScriptableControlIID)) {
 
547
        *aInstancePtr = NS_STATIC_CAST(nsIScriptableGeckoMediaPlayerControls *, this);
 
548
        AddRef();
 
549
        return NS_OK;
 
550
    }
 
551
 
 
552
    if (aIID.Equals(kIClassInfoIID)) {
 
553
        *aInstancePtr = NS_STATIC_CAST(nsIClassInfo *, this);
 
554
        AddRef();
 
555
        return NS_OK;
 
556
    }
 
557
 
 
558
    if (aIID.Equals(kISupportsIID)) {
 
559
        *aInstancePtr =
 
560
            NS_STATIC_CAST(nsISupports *,
 
561
                           (NS_STATIC_CAST(nsIScriptableGeckoMediaPlayerControls *, this)));
 
562
        AddRef();
 
563
        return NS_OK;
 
564
    }
 
565
 
 
566
    return NS_NOINTERFACE;
 
567
}
 
568
 
 
569
void nsControlsScriptablePeer::SetInstance(nsPluginInstance * plugin)
 
570
{
 
571
    mPlugin = plugin;
 
572
}
 
573
 
 
574
NS_IMETHODIMP nsControlsScriptablePeer::Play(void)
 
575
{
 
576
    printf("JS Play issued\n");
 
577
    mPlugin->Play();
 
578
    return NS_OK;
 
579
}
 
580
 
 
581
NS_IMETHODIMP nsControlsScriptablePeer::Pause(void)
 
582
{
 
583
    printf("JS Pause issued\n");
 
584
    mPlugin->Pause();
 
585
    return NS_OK;
 
586
}
 
587
 
 
588
NS_IMETHODIMP nsControlsScriptablePeer::Stop(void)
 
589
{
 
590
    printf("JS Stop issued\n");
 
591
    mPlugin->Stop();
 
592
    return NS_OK;
 
593
}
 
594
 
 
595
NS_IMETHODIMP nsControlsScriptablePeer::FastForward(void)
 
596
{
 
597
    printf("JS ff issued\n");
 
598
    mPlugin->FastForward();
 
599
    return NS_OK;
 
600
}
 
601
 
 
602
NS_IMETHODIMP nsControlsScriptablePeer::FastReverse(void)
 
603
{
 
604
    printf("JS rew issued\n");
 
605
    mPlugin->FastReverse();
 
606
    return NS_OK;
 
607
}
 
608
 
 
609
NS_IMETHODIMP nsControlsScriptablePeer::Step(void)
 
610
{
 
611
    mPlugin->Play();
 
612
    mPlugin->Pause();
 
613
    return NS_OK;
 
614
}
 
615
 
 
616
NS_IMETHODIMP nsControlsScriptablePeer::GetCurrentPosition(double *aCurrentPosition)
 
617
{
 
618
    mPlugin->GetTime(aCurrentPosition);
 
619
    return NS_OK;
 
620
}
 
621
 
 
622
NS_IMETHODIMP nsControlsScriptablePeer::SetCurrentPosition(double aCurrentPosition)
 
623
{
 
624
    mPlugin->Seek(aCurrentPosition);
 
625
    return NS_OK;
 
626
}
 
627
 
 
628