本文整理汇总了C++中HTMLMediaElement::setPlaybackRate方法的典型用法代码示例。如果您正苦于以下问题:C++ HTMLMediaElement::setPlaybackRate方法的具体用法?C++ HTMLMediaElement::setPlaybackRate怎么用?C++ HTMLMediaElement::setPlaybackRate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTMLMediaElement
的用法示例。
在下文中一共展示了HTMLMediaElement::setPlaybackRate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: putValueProperty
void JSHTMLMediaElement::putValueProperty(ExecState* exec, int token, JSValue* value)
{
switch (token) {
case SrcAttrNum: {
HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(impl());
imp->setSrc(value->toString(exec));
break;
}
case CurrentTimeAttrNum: {
HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(impl());
ExceptionCode ec = 0;
imp->setCurrentTime(value->toFloat(exec), ec);
setDOMException(exec, ec);
break;
}
case DefaultPlaybackRateAttrNum: {
HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(impl());
ExceptionCode ec = 0;
imp->setDefaultPlaybackRate(value->toFloat(exec), ec);
setDOMException(exec, ec);
break;
}
case PlaybackRateAttrNum: {
HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(impl());
ExceptionCode ec = 0;
imp->setPlaybackRate(value->toFloat(exec), ec);
setDOMException(exec, ec);
break;
}
case AutoplayAttrNum: {
HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(impl());
imp->setAutoplay(value->toBoolean(exec));
break;
}
case StartAttrNum: {
HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(impl());
imp->setStart(value->toFloat(exec));
break;
}
case EndAttrNum: {
HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(impl());
imp->setEnd(value->toFloat(exec));
break;
}
case LoopStartAttrNum: {
HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(impl());
imp->setLoopStart(value->toFloat(exec));
break;
}
case LoopEndAttrNum: {
HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(impl());
imp->setLoopEnd(value->toFloat(exec));
break;
}
case PlayCountAttrNum: {
HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(impl());
ExceptionCode ec = 0;
imp->setPlayCount(value->toInt32(exec), ec);
setDOMException(exec, ec);
break;
}
case CurrentLoopAttrNum: {
HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(impl());
imp->setCurrentLoop(value->toInt32(exec));
break;
}
case ControlsAttrNum: {
HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(impl());
imp->setControls(value->toBoolean(exec));
break;
}
case VolumeAttrNum: {
HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(impl());
ExceptionCode ec = 0;
imp->setVolume(value->toFloat(exec), ec);
setDOMException(exec, ec);
break;
}
case MutedAttrNum: {
HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(impl());
imp->setMuted(value->toBoolean(exec));
break;
}
}
}
示例2: setJSHTMLMediaElementPlaybackRate
void setJSHTMLMediaElementPlaybackRate(ExecState* exec, JSObject* thisObject, JSValue value)
{
JSHTMLMediaElement* castedThis = static_cast<JSHTMLMediaElement*>(thisObject);
HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(castedThis->impl());
imp->setPlaybackRate(value.toFloat(exec));
}