summaryrefslogtreecommitdiff
path: root/src/3rdparty/webkit/WebCore/generated/JSHTMLMediaElement.cpp
blob: 765dea8a29fb9d90743931aa08c196e66a7e93e8 (plain)
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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
/*
    This file is part of the WebKit open source project.
    This file has been generated by generate-bindings.pl. DO NOT MODIFY!

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License as published by the Free Software Foundation; either
    version 2 of the License, or (at your option) any later version.

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Library General Public License for more details.

    You should have received a copy of the GNU Library General Public License
    along with this library; see the file COPYING.LIB.  If not, write to
    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
    Boston, MA 02110-1301, USA.
*/

#include "config.h"


#if ENABLE(VIDEO)

#include "JSHTMLMediaElement.h"

#include <wtf/GetPtr.h>

#include "HTMLMediaElement.h"
#include "JSMediaError.h"
#include "JSTimeRanges.h"
#include "KURL.h"
#include "MediaError.h"
#include "TimeRanges.h"

#include <runtime/Error.h>
#include <runtime/JSNumberCell.h>
#include <runtime/JSString.h>

using namespace JSC;

namespace WebCore {

ASSERT_CLASS_FITS_IN_CELL(JSHTMLMediaElement)

/* Hash table */

static const HashTableValue JSHTMLMediaElementTableValues[28] =
{
    { "error", DontDelete|ReadOnly, (intptr_t)jsHTMLMediaElementError, (intptr_t)0 },
    { "src", DontDelete, (intptr_t)jsHTMLMediaElementSrc, (intptr_t)setJSHTMLMediaElementSrc },
    { "currentSrc", DontDelete|ReadOnly, (intptr_t)jsHTMLMediaElementCurrentSrc, (intptr_t)0 },
    { "networkState", DontDelete|ReadOnly, (intptr_t)jsHTMLMediaElementNetworkState, (intptr_t)0 },
    { "bufferingRate", DontDelete|ReadOnly, (intptr_t)jsHTMLMediaElementBufferingRate, (intptr_t)0 },
    { "buffered", DontDelete|ReadOnly, (intptr_t)jsHTMLMediaElementBuffered, (intptr_t)0 },
    { "readyState", DontDelete|ReadOnly, (intptr_t)jsHTMLMediaElementReadyState, (intptr_t)0 },
    { "seeking", DontDelete|ReadOnly, (intptr_t)jsHTMLMediaElementSeeking, (intptr_t)0 },
    { "currentTime", DontDelete, (intptr_t)jsHTMLMediaElementCurrentTime, (intptr_t)setJSHTMLMediaElementCurrentTime },
    { "duration", DontDelete|ReadOnly, (intptr_t)jsHTMLMediaElementDuration, (intptr_t)0 },
    { "paused", DontDelete|ReadOnly, (intptr_t)jsHTMLMediaElementPaused, (intptr_t)0 },
    { "defaultPlaybackRate", DontDelete, (intptr_t)jsHTMLMediaElementDefaultPlaybackRate, (intptr_t)setJSHTMLMediaElementDefaultPlaybackRate },
    { "playbackRate", DontDelete, (intptr_t)jsHTMLMediaElementPlaybackRate, (intptr_t)setJSHTMLMediaElementPlaybackRate },
    { "played", DontDelete|ReadOnly, (intptr_t)jsHTMLMediaElementPlayed, (intptr_t)0 },
    { "seekable", DontDelete|ReadOnly, (intptr_t)jsHTMLMediaElementSeekable, (intptr_t)0 },
    { "ended", DontDelete|ReadOnly, (intptr_t)jsHTMLMediaElementEnded, (intptr_t)0 },
    { "autoplay", DontDelete, (intptr_t)jsHTMLMediaElementAutoplay, (intptr_t)setJSHTMLMediaElementAutoplay },
    { "start", DontDelete, (intptr_t)jsHTMLMediaElementStart, (intptr_t)setJSHTMLMediaElementStart },
    { "end", DontDelete, (intptr_t)jsHTMLMediaElementEnd, (intptr_t)setJSHTMLMediaElementEnd },
    { "loopStart", DontDelete, (intptr_t)jsHTMLMediaElementLoopStart, (intptr_t)setJSHTMLMediaElementLoopStart },
    { "loopEnd", DontDelete, (intptr_t)jsHTMLMediaElementLoopEnd, (intptr_t)setJSHTMLMediaElementLoopEnd },
    { "playCount", DontDelete, (intptr_t)jsHTMLMediaElementPlayCount, (intptr_t)setJSHTMLMediaElementPlayCount },
    { "currentLoop", DontDelete, (intptr_t)jsHTMLMediaElementCurrentLoop, (intptr_t)setJSHTMLMediaElementCurrentLoop },
    { "controls", DontDelete, (intptr_t)jsHTMLMediaElementControls, (intptr_t)setJSHTMLMediaElementControls },
    { "volume", DontDelete, (intptr_t)jsHTMLMediaElementVolume, (intptr_t)setJSHTMLMediaElementVolume },
    { "muted", DontDelete, (intptr_t)jsHTMLMediaElementMuted, (intptr_t)setJSHTMLMediaElementMuted },
    { "constructor", DontEnum|ReadOnly, (intptr_t)jsHTMLMediaElementConstructor, (intptr_t)0 },
    { 0, 0, 0, 0 }
};

static const HashTable JSHTMLMediaElementTable =
#if ENABLE(PERFECT_HASH_SIZE)
    { 127, JSHTMLMediaElementTableValues, 0 };
#else
    { 67, 63, JSHTMLMediaElementTableValues, 0 };
#endif

/* Hash table for constructor */

static const HashTableValue JSHTMLMediaElementConstructorTableValues[10] =
{
    { "EMPTY", DontDelete|ReadOnly, (intptr_t)jsHTMLMediaElementEMPTY, (intptr_t)0 },
    { "LOADING", DontDelete|ReadOnly, (intptr_t)jsHTMLMediaElementLOADING, (intptr_t)0 },
    { "LOADED_METADATA", DontDelete|ReadOnly, (intptr_t)jsHTMLMediaElementLOADED_METADATA, (intptr_t)0 },
    { "LOADED_FIRST_FRAME", DontDelete|ReadOnly, (intptr_t)jsHTMLMediaElementLOADED_FIRST_FRAME, (intptr_t)0 },
    { "LOADED", DontDelete|ReadOnly, (intptr_t)jsHTMLMediaElementLOADED, (intptr_t)0 },
    { "DATA_UNAVAILABLE", DontDelete|ReadOnly, (intptr_t)jsHTMLMediaElementDATA_UNAVAILABLE, (intptr_t)0 },
    { "CAN_SHOW_CURRENT_FRAME", DontDelete|ReadOnly, (intptr_t)jsHTMLMediaElementCAN_SHOW_CURRENT_FRAME, (intptr_t)0 },
    { "CAN_PLAY", DontDelete|ReadOnly, (intptr_t)jsHTMLMediaElementCAN_PLAY, (intptr_t)0 },
    { "CAN_PLAY_THROUGH", DontDelete|ReadOnly, (intptr_t)jsHTMLMediaElementCAN_PLAY_THROUGH, (intptr_t)0 },
    { 0, 0, 0, 0 }
};

static const HashTable JSHTMLMediaElementConstructorTable =
#if ENABLE(PERFECT_HASH_SIZE)
    { 63, JSHTMLMediaElementConstructorTableValues, 0 };
#else
    { 33, 31, JSHTMLMediaElementConstructorTableValues, 0 };
#endif

class JSHTMLMediaElementConstructor : public DOMObject {
public:
    JSHTMLMediaElementConstructor(ExecState* exec)
        : DOMObject(JSHTMLMediaElementConstructor::createStructure(exec->lexicalGlobalObject()->objectPrototype()))
    {
        putDirect(exec->propertyNames().prototype, JSHTMLMediaElementPrototype::self(exec), None);
    }
    virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
    virtual const ClassInfo* classInfo() const { return &s_info; }
    static const ClassInfo s_info;

    static PassRefPtr<Structure> createStructure(JSValuePtr proto) 
    { 
        return Structure::create(proto, TypeInfo(ObjectType, ImplementsHasInstance)); 
    }
};

const ClassInfo JSHTMLMediaElementConstructor::s_info = { "HTMLMediaElementConstructor", 0, &JSHTMLMediaElementConstructorTable, 0 };

bool JSHTMLMediaElementConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
{
    return getStaticValueSlot<JSHTMLMediaElementConstructor, DOMObject>(exec, &JSHTMLMediaElementConstructorTable, this, propertyName, slot);
}

/* Hash table for prototype */

static const HashTableValue JSHTMLMediaElementPrototypeTableValues[13] =
{
    { "EMPTY", DontDelete|ReadOnly, (intptr_t)jsHTMLMediaElementEMPTY, (intptr_t)0 },
    { "LOADING", DontDelete|ReadOnly, (intptr_t)jsHTMLMediaElementLOADING, (intptr_t)0 },
    { "LOADED_METADATA", DontDelete|ReadOnly, (intptr_t)jsHTMLMediaElementLOADED_METADATA, (intptr_t)0 },
    { "LOADED_FIRST_FRAME", DontDelete|ReadOnly, (intptr_t)jsHTMLMediaElementLOADED_FIRST_FRAME, (intptr_t)0 },
    { "LOADED", DontDelete|ReadOnly, (intptr_t)jsHTMLMediaElementLOADED, (intptr_t)0 },
    { "DATA_UNAVAILABLE", DontDelete|ReadOnly, (intptr_t)jsHTMLMediaElementDATA_UNAVAILABLE, (intptr_t)0 },
    { "CAN_SHOW_CURRENT_FRAME", DontDelete|ReadOnly, (intptr_t)jsHTMLMediaElementCAN_SHOW_CURRENT_FRAME, (intptr_t)0 },
    { "CAN_PLAY", DontDelete|ReadOnly, (intptr_t)jsHTMLMediaElementCAN_PLAY, (intptr_t)0 },
    { "CAN_PLAY_THROUGH", DontDelete|ReadOnly, (intptr_t)jsHTMLMediaElementCAN_PLAY_THROUGH, (intptr_t)0 },
    { "load", DontDelete|Function, (intptr_t)jsHTMLMediaElementPrototypeFunctionLoad, (intptr_t)0 },
    { "play", DontDelete|Function, (intptr_t)jsHTMLMediaElementPrototypeFunctionPlay, (intptr_t)0 },
    { "pause", DontDelete|Function, (intptr_t)jsHTMLMediaElementPrototypeFunctionPause, (intptr_t)0 },
    { 0, 0, 0, 0 }
};

static const HashTable JSHTMLMediaElementPrototypeTable =
#if ENABLE(PERFECT_HASH_SIZE)
    { 127, JSHTMLMediaElementPrototypeTableValues, 0 };
#else
    { 34, 31, JSHTMLMediaElementPrototypeTableValues, 0 };
#endif

const ClassInfo JSHTMLMediaElementPrototype::s_info = { "HTMLMediaElementPrototype", 0, &JSHTMLMediaElementPrototypeTable, 0 };

JSObject* JSHTMLMediaElementPrototype::self(ExecState* exec)
{
    return getDOMPrototype<JSHTMLMediaElement>(exec);
}

bool JSHTMLMediaElementPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
{
    return getStaticPropertySlot<JSHTMLMediaElementPrototype, JSObject>(exec, &JSHTMLMediaElementPrototypeTable, this, propertyName, slot);
}

const ClassInfo JSHTMLMediaElement::s_info = { "HTMLMediaElement", &JSHTMLElement::s_info, &JSHTMLMediaElementTable, 0 };

JSHTMLMediaElement::JSHTMLMediaElement(PassRefPtr<Structure> structure, PassRefPtr<HTMLMediaElement> impl)
    : JSHTMLElement(structure, impl)
{
}

JSObject* JSHTMLMediaElement::createPrototype(ExecState* exec)
{
    return new (exec) JSHTMLMediaElementPrototype(JSHTMLMediaElementPrototype::createStructure(JSHTMLElementPrototype::self(exec)));
}

bool JSHTMLMediaElement::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
{
    return getStaticValueSlot<JSHTMLMediaElement, Base>(exec, &JSHTMLMediaElementTable, this, propertyName, slot);
}

JSValuePtr jsHTMLMediaElementError(ExecState* exec, const Identifier&, const PropertySlot& slot)
{
    HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(static_cast<JSHTMLMediaElement*>(asObject(slot.slotBase()))->impl());
    return toJS(exec, WTF::getPtr(imp->error()));
}

JSValuePtr jsHTMLMediaElementSrc(ExecState* exec, const Identifier&, const PropertySlot& slot)
{
    HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(static_cast<JSHTMLMediaElement*>(asObject(slot.slotBase()))->impl());
    return jsString(exec, imp->src());
}

JSValuePtr jsHTMLMediaElementCurrentSrc(ExecState* exec, const Identifier&, const PropertySlot& slot)
{
    HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(static_cast<JSHTMLMediaElement*>(asObject(slot.slotBase()))->impl());
    return jsString(exec, imp->currentSrc());
}

JSValuePtr jsHTMLMediaElementNetworkState(ExecState* exec, const Identifier&, const PropertySlot& slot)
{
    HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(static_cast<JSHTMLMediaElement*>(asObject(slot.slotBase()))->impl());
    return jsNumber(exec, imp->networkState());
}

JSValuePtr jsHTMLMediaElementBufferingRate(ExecState* exec, const Identifier&, const PropertySlot& slot)
{
    HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(static_cast<JSHTMLMediaElement*>(asObject(slot.slotBase()))->impl());
    return jsNumber(exec, imp->bufferingRate());
}

JSValuePtr jsHTMLMediaElementBuffered(ExecState* exec, const Identifier&, const PropertySlot& slot)
{
    HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(static_cast<JSHTMLMediaElement*>(asObject(slot.slotBase()))->impl());
    return toJS(exec, WTF::getPtr(imp->buffered()));
}

JSValuePtr jsHTMLMediaElementReadyState(ExecState* exec, const Identifier&, const PropertySlot& slot)
{
    HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(static_cast<JSHTMLMediaElement*>(asObject(slot.slotBase()))->impl());
    return jsNumber(exec, imp->readyState());
}

JSValuePtr jsHTMLMediaElementSeeking(ExecState* exec, const Identifier&, const PropertySlot& slot)
{
    HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(static_cast<JSHTMLMediaElement*>(asObject(slot.slotBase()))->impl());
    return jsBoolean(imp->seeking());
}

JSValuePtr jsHTMLMediaElementCurrentTime(ExecState* exec, const Identifier&, const PropertySlot& slot)
{
    HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(static_cast<JSHTMLMediaElement*>(asObject(slot.slotBase()))->impl());
    return jsNumber(exec, imp->currentTime());
}

JSValuePtr jsHTMLMediaElementDuration(ExecState* exec, const Identifier&, const PropertySlot& slot)
{
    HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(static_cast<JSHTMLMediaElement*>(asObject(slot.slotBase()))->impl());
    return jsNumber(exec, imp->duration());
}

JSValuePtr jsHTMLMediaElementPaused(ExecState* exec, const Identifier&, const PropertySlot& slot)
{
    HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(static_cast<JSHTMLMediaElement*>(asObject(slot.slotBase()))->impl());
    return jsBoolean(imp->paused());
}

JSValuePtr jsHTMLMediaElementDefaultPlaybackRate(ExecState* exec, const Identifier&, const PropertySlot& slot)
{
    HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(static_cast<JSHTMLMediaElement*>(asObject(slot.slotBase()))->impl());
    return jsNumber(exec, imp->defaultPlaybackRate());
}

JSValuePtr jsHTMLMediaElementPlaybackRate(ExecState* exec, const Identifier&, const PropertySlot& slot)
{
    HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(static_cast<JSHTMLMediaElement*>(asObject(slot.slotBase()))->impl());
    return jsNumber(exec, imp->playbackRate());
}

JSValuePtr jsHTMLMediaElementPlayed(ExecState* exec, const Identifier&, const PropertySlot& slot)
{
    HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(static_cast<JSHTMLMediaElement*>(asObject(slot.slotBase()))->impl());
    return toJS(exec, WTF::getPtr(imp->played()));
}

JSValuePtr jsHTMLMediaElementSeekable(ExecState* exec, const Identifier&, const PropertySlot& slot)
{
    HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(static_cast<JSHTMLMediaElement*>(asObject(slot.slotBase()))->impl());
    return toJS(exec, WTF::getPtr(imp->seekable()));
}

JSValuePtr jsHTMLMediaElementEnded(ExecState* exec, const Identifier&, const PropertySlot& slot)
{
    HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(static_cast<JSHTMLMediaElement*>(asObject(slot.slotBase()))->impl());
    return jsBoolean(imp->ended());
}

JSValuePtr jsHTMLMediaElementAutoplay(ExecState* exec, const Identifier&, const PropertySlot& slot)
{
    HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(static_cast<JSHTMLMediaElement*>(asObject(slot.slotBase()))->impl());
    return jsBoolean(imp->autoplay());
}

JSValuePtr jsHTMLMediaElementStart(ExecState* exec, const Identifier&, const PropertySlot& slot)
{
    HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(static_cast<JSHTMLMediaElement*>(asObject(slot.slotBase()))->impl());
    return jsNumber(exec, imp->start());
}

JSValuePtr jsHTMLMediaElementEnd(ExecState* exec, const Identifier&, const PropertySlot& slot)
{
    HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(static_cast<JSHTMLMediaElement*>(asObject(slot.slotBase()))->impl());
    return jsNumber(exec, imp->end());
}

JSValuePtr jsHTMLMediaElementLoopStart(ExecState* exec, const Identifier&, const PropertySlot& slot)
{
    HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(static_cast<JSHTMLMediaElement*>(asObject(slot.slotBase()))->impl());
    return jsNumber(exec, imp->loopStart());
}

JSValuePtr jsHTMLMediaElementLoopEnd(ExecState* exec, const Identifier&, const PropertySlot& slot)
{
    HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(static_cast<JSHTMLMediaElement*>(asObject(slot.slotBase()))->impl());
    return jsNumber(exec, imp->loopEnd());
}

JSValuePtr jsHTMLMediaElementPlayCount(ExecState* exec, const Identifier&, const PropertySlot& slot)
{
    HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(static_cast<JSHTMLMediaElement*>(asObject(slot.slotBase()))->impl());
    return jsNumber(exec, imp->playCount());
}

JSValuePtr jsHTMLMediaElementCurrentLoop(ExecState* exec, const Identifier&, const PropertySlot& slot)
{
    HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(static_cast<JSHTMLMediaElement*>(asObject(slot.slotBase()))->impl());
    return jsNumber(exec, imp->currentLoop());
}

JSValuePtr jsHTMLMediaElementControls(ExecState* exec, const Identifier&, const PropertySlot& slot)
{
    HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(static_cast<JSHTMLMediaElement*>(asObject(slot.slotBase()))->impl());
    return jsBoolean(imp->controls());
}

JSValuePtr jsHTMLMediaElementVolume(ExecState* exec, const Identifier&, const PropertySlot& slot)
{
    HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(static_cast<JSHTMLMediaElement*>(asObject(slot.slotBase()))->impl());
    return jsNumber(exec, imp->volume());
}

JSValuePtr jsHTMLMediaElementMuted(ExecState* exec, const Identifier&, const PropertySlot& slot)
{
    HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(static_cast<JSHTMLMediaElement*>(asObject(slot.slotBase()))->impl());
    return jsBoolean(imp->muted());
}

JSValuePtr jsHTMLMediaElementConstructor(ExecState* exec, const Identifier&, const PropertySlot& slot)
{
    return static_cast<JSHTMLMediaElement*>(asObject(slot.slotBase()))->getConstructor(exec);
}
void JSHTMLMediaElement::put(ExecState* exec, const Identifier& propertyName, JSValuePtr value, PutPropertySlot& slot)
{
    lookupPut<JSHTMLMediaElement, Base>(exec, propertyName, value, &JSHTMLMediaElementTable, this, slot);
}

void setJSHTMLMediaElementSrc(ExecState* exec, JSObject* thisObject, JSValuePtr value)
{
    HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(static_cast<JSHTMLMediaElement*>(thisObject)->impl());
    imp->setSrc(value->toString(exec));
}

void setJSHTMLMediaElementCurrentTime(ExecState* exec, JSObject* thisObject, JSValuePtr value)
{
    HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(static_cast<JSHTMLMediaElement*>(thisObject)->impl());
    ExceptionCode ec = 0;
    imp->setCurrentTime(value->toFloat(exec), ec);
    setDOMException(exec, ec);
}

void setJSHTMLMediaElementDefaultPlaybackRate(ExecState* exec, JSObject* thisObject, JSValuePtr value)
{
    HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(static_cast<JSHTMLMediaElement*>(thisObject)->impl());
    ExceptionCode ec = 0;
    imp->setDefaultPlaybackRate(value->toFloat(exec), ec);
    setDOMException(exec, ec);
}

void setJSHTMLMediaElementPlaybackRate(ExecState* exec, JSObject* thisObject, JSValuePtr value)
{
    HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(static_cast<JSHTMLMediaElement*>(thisObject)->impl());
    ExceptionCode ec = 0;
    imp->setPlaybackRate(value->toFloat(exec), ec);
    setDOMException(exec, ec);
}

void setJSHTMLMediaElementAutoplay(ExecState* exec, JSObject* thisObject, JSValuePtr value)
{
    HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(static_cast<JSHTMLMediaElement*>(thisObject)->impl());
    imp->setAutoplay(value->toBoolean(exec));
}

void setJSHTMLMediaElementStart(ExecState* exec, JSObject* thisObject, JSValuePtr value)
{
    HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(static_cast<JSHTMLMediaElement*>(thisObject)->impl());
    imp->setStart(value->toFloat(exec));
}

void setJSHTMLMediaElementEnd(ExecState* exec, JSObject* thisObject, JSValuePtr value)
{
    HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(static_cast<JSHTMLMediaElement*>(thisObject)->impl());
    imp->setEnd(value->toFloat(exec));
}

void setJSHTMLMediaElementLoopStart(ExecState* exec, JSObject* thisObject, JSValuePtr value)
{
    HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(static_cast<JSHTMLMediaElement*>(thisObject)->impl());
    imp->setLoopStart(value->toFloat(exec));
}

void setJSHTMLMediaElementLoopEnd(ExecState* exec, JSObject* thisObject, JSValuePtr value)
{
    HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(static_cast<JSHTMLMediaElement*>(thisObject)->impl());
    imp->setLoopEnd(value->toFloat(exec));
}

void setJSHTMLMediaElementPlayCount(ExecState* exec, JSObject* thisObject, JSValuePtr value)
{
    HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(static_cast<JSHTMLMediaElement*>(thisObject)->impl());
    ExceptionCode ec = 0;
    imp->setPlayCount(value->toInt32(exec), ec);
    setDOMException(exec, ec);
}

void setJSHTMLMediaElementCurrentLoop(ExecState* exec, JSObject* thisObject, JSValuePtr value)
{
    HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(static_cast<JSHTMLMediaElement*>(thisObject)->impl());
    imp->setCurrentLoop(value->toInt32(exec));
}

void setJSHTMLMediaElementControls(ExecState* exec, JSObject* thisObject, JSValuePtr value)
{
    HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(static_cast<JSHTMLMediaElement*>(thisObject)->impl());
    imp->setControls(value->toBoolean(exec));
}

void setJSHTMLMediaElementVolume(ExecState* exec, JSObject* thisObject, JSValuePtr value)
{
    HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(static_cast<JSHTMLMediaElement*>(thisObject)->impl());
    ExceptionCode ec = 0;
    imp->setVolume(value->toFloat(exec), ec);
    setDOMException(exec, ec);
}

void setJSHTMLMediaElementMuted(ExecState* exec, JSObject* thisObject, JSValuePtr value)
{
    HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(static_cast<JSHTMLMediaElement*>(thisObject)->impl());
    imp->setMuted(value->toBoolean(exec));
}

JSValuePtr JSHTMLMediaElement::getConstructor(ExecState* exec)
{
    return getDOMConstructor<JSHTMLMediaElementConstructor>(exec);
}

JSValuePtr jsHTMLMediaElementPrototypeFunctionLoad(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args)
{
    if (!thisValue->isObject(&JSHTMLMediaElement::s_info))
        return throwError(exec, TypeError);
    JSHTMLMediaElement* castedThisObj = static_cast<JSHTMLMediaElement*>(asObject(thisValue));
    HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(castedThisObj->impl());
    ExceptionCode ec = 0;

    imp->load(ec);
    setDOMException(exec, ec);
    return jsUndefined();
}

JSValuePtr jsHTMLMediaElementPrototypeFunctionPlay(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args)
{
    if (!thisValue->isObject(&JSHTMLMediaElement::s_info))
        return throwError(exec, TypeError);
    JSHTMLMediaElement* castedThisObj = static_cast<JSHTMLMediaElement*>(asObject(thisValue));
    HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(castedThisObj->impl());
    ExceptionCode ec = 0;

    imp->play(ec);
    setDOMException(exec, ec);
    return jsUndefined();
}

JSValuePtr jsHTMLMediaElementPrototypeFunctionPause(ExecState* exec, JSObject*, JSValuePtr thisValue, const ArgList& args)
{
    if (!thisValue->isObject(&JSHTMLMediaElement::s_info))
        return throwError(exec, TypeError);
    JSHTMLMediaElement* castedThisObj = static_cast<JSHTMLMediaElement*>(asObject(thisValue));
    HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(castedThisObj->impl());
    ExceptionCode ec = 0;

    imp->pause(ec);
    setDOMException(exec, ec);
    return jsUndefined();
}

// Constant getters

JSValuePtr jsHTMLMediaElementEMPTY(ExecState* exec, const Identifier&, const PropertySlot&)
{
    return jsNumber(exec, static_cast<int>(0));
}

JSValuePtr jsHTMLMediaElementLOADING(ExecState* exec, const Identifier&, const PropertySlot&)
{
    return jsNumber(exec, static_cast<int>(1));
}

JSValuePtr jsHTMLMediaElementLOADED_METADATA(ExecState* exec, const Identifier&, const PropertySlot&)
{
    return jsNumber(exec, static_cast<int>(2));
}

JSValuePtr jsHTMLMediaElementLOADED_FIRST_FRAME(ExecState* exec, const Identifier&, const PropertySlot&)
{
    return jsNumber(exec, static_cast<int>(3));
}

JSValuePtr jsHTMLMediaElementLOADED(ExecState* exec, const Identifier&, const PropertySlot&)
{
    return jsNumber(exec, static_cast<int>(4));
}

JSValuePtr jsHTMLMediaElementDATA_UNAVAILABLE(ExecState* exec, const Identifier&, const PropertySlot&)
{
    return jsNumber(exec, static_cast<int>(0));
}

JSValuePtr jsHTMLMediaElementCAN_SHOW_CURRENT_FRAME(ExecState* exec, const Identifier&, const PropertySlot&)
{
    return jsNumber(exec, static_cast<int>(1));
}

JSValuePtr jsHTMLMediaElementCAN_PLAY(ExecState* exec, const Identifier&, const PropertySlot&)
{
    return jsNumber(exec, static_cast<int>(2));
}

JSValuePtr jsHTMLMediaElementCAN_PLAY_THROUGH(ExecState* exec, const Identifier&, const PropertySlot&)
{
    return jsNumber(exec, static_cast<int>(3));
}


}

#endif // ENABLE(VIDEO)