void JSHTMLMediaElement::setController(ExecState*, JSValue value)
{
    HTMLMediaElement* imp = toHTMLMediaElement(impl());
    // 4.8.10.11.2 Media controllers: controller attribute.
    // On setting, it must first remove the element's mediagroup attribute, if any, 
    imp->setMediaGroup(String());
    // and then set the current media controller to the given value.
    imp->setController(toMediaController(value));
}
void V8HTMLMediaElement::controllerAttributeSetterCustom(v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<void>& info)
{
    MediaController* controller = 0;
    if (!value->IsNull()) {
        if (!V8MediaController::HasInstance(value, info.GetIsolate(), worldType(info.GetIsolate()))) {
            throwTypeError("Value is not of type MediaController", info.GetIsolate());
            return;
        }
        controller = V8MediaController::toNative(value->ToObject());
    }

    // 4.8.10.11.2 Media controllers: controller attribute.
    // On setting, it must first remove the element's mediagroup attribute, if any,
    HTMLMediaElement* imp = V8HTMLMediaElement::toNative(info.Holder());
    imp->setMediaGroup(String());
    // and then set the current media controller to the given value.
    imp->setController(controller);
}
Exemple #3
0
void V8HTMLMediaElement::controllerAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
{
    HTMLMediaElement* imp = V8HTMLMediaElement::toNative(info.Holder());
    MediaController* controller = 0;
    if (V8MediaController::HasInstance(value))
        controller = V8MediaController::toNative(value->ToObject());
    
    if (!controller) {
        throwTypeError("Value is not of type MediaController", info.GetIsolate());
        return;
    }

    // 4.8.10.11.2 Media controllers: controller attribute.
    // On setting, it must first remove the element's mediagroup attribute, if any, 
    imp->setMediaGroup(String());
    // and then set the current media controller to the given value.
    imp->setController(controller);
}