当前位置: 首页>>代码示例>>C++>>正文


C++ HTMLMediaElement::readyState方法代码示例

本文整理汇总了C++中HTMLMediaElement::readyState方法的典型用法代码示例。如果您正苦于以下问题:C++ HTMLMediaElement::readyState方法的具体用法?C++ HTMLMediaElement::readyState怎么用?C++ HTMLMediaElement::readyState使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在HTMLMediaElement的用法示例。


在下文中一共展示了HTMLMediaElement::readyState方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: mediaElementCanPlay

static bool mediaElementCanPlay(RenderObject* o)
{
    HTMLMediaElement* mediaElement = toParentMediaElement(o);
    if (!mediaElement)
        return false;

    return mediaElement->readyState() > HTMLMediaElement::HAVE_METADATA
           || (mediaElement->readyState() == HTMLMediaElement::HAVE_NOTHING
               && o->style()->appearance() == MediaPlayButtonPart && mediaElement->preload() == "none");
}
开发者ID:antseppa,项目名称:qtwebkit5,代码行数:10,代码来源:RenderThemeQt.cpp

示例2: jsHTMLMediaElementReadyState

JSValue jsHTMLMediaElementReadyState(ExecState* exec, JSValue slotBase, const Identifier&)
{
    JSHTMLMediaElement* castedThis = static_cast<JSHTMLMediaElement*>(asObject(slotBase));
    UNUSED_PARAM(exec);
    HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(castedThis->impl());
    JSValue result = jsNumber(imp->readyState());
    return result;
}
开发者ID:13W,项目名称:phantomjs,代码行数:8,代码来源:JSHTMLMediaElement.cpp

示例3: showPlaybackTargetPicker

void MediaElementSession::showPlaybackTargetPicker(const HTMLMediaElement& element)
{
    LOG(Media, "MediaElementSession::showPlaybackTargetPicker");

    if (m_restrictions & RequireUserGestureToShowPlaybackTargetPicker && !ScriptController::processingUserGestureForMedia()) {
        LOG(Media, "MediaElementSession::showPlaybackTargetPicker - returning early because of permissions");
        return;
    }

    if (!element.document().page()) {
        LOG(Media, "MediaElementSession::showingPlaybackTargetPickerPermitted - returning early because page is NULL");
        return;
    }

#if !PLATFORM(IOS)
    if (element.readyState() < HTMLMediaElementEnums::HAVE_METADATA) {
        LOG(Media, "MediaElementSession::showPlaybackTargetPicker - returning early because element is not playable");
        return;
    }
#endif

    element.document().showPlaybackTargetPicker(*this, is<HTMLVideoElement>(element));
}
开发者ID:edcwconan,项目名称:webkit,代码行数:23,代码来源:MediaElementSession.cpp

示例4: getValueProperty

JSValue* JSHTMLMediaElement::getValueProperty(ExecState* exec, int token) const
{
    switch (token) {
    case ErrorAttrNum: {
        HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(impl());
        return toJS(exec, WTF::getPtr(imp->error()));
    }
    case SrcAttrNum: {
        HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(impl());
        return jsString(exec, imp->src());
    }
    case CurrentSrcAttrNum: {
        HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(impl());
        return jsString(exec, imp->currentSrc());
    }
    case NetworkStateAttrNum: {
        HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(impl());
        return jsNumber(exec, imp->networkState());
    }
    case BufferingRateAttrNum: {
        HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(impl());
        return jsNumber(exec, imp->bufferingRate());
    }
    case BufferedAttrNum: {
        HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(impl());
        return toJS(exec, WTF::getPtr(imp->buffered()));
    }
    case ReadyStateAttrNum: {
        HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(impl());
        return jsNumber(exec, imp->readyState());
    }
    case SeekingAttrNum: {
        HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(impl());
        return jsBoolean(imp->seeking());
    }
    case CurrentTimeAttrNum: {
        HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(impl());
        return jsNumber(exec, imp->currentTime());
    }
    case DurationAttrNum: {
        HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(impl());
        return jsNumber(exec, imp->duration());
    }
    case PausedAttrNum: {
        HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(impl());
        return jsBoolean(imp->paused());
    }
    case DefaultPlaybackRateAttrNum: {
        HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(impl());
        return jsNumber(exec, imp->defaultPlaybackRate());
    }
    case PlaybackRateAttrNum: {
        HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(impl());
        return jsNumber(exec, imp->playbackRate());
    }
    case PlayedAttrNum: {
        HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(impl());
        return toJS(exec, WTF::getPtr(imp->played()));
    }
    case SeekableAttrNum: {
        HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(impl());
        return toJS(exec, WTF::getPtr(imp->seekable()));
    }
    case EndedAttrNum: {
        HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(impl());
        return jsBoolean(imp->ended());
    }
    case AutoplayAttrNum: {
        HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(impl());
        return jsBoolean(imp->autoplay());
    }
    case StartAttrNum: {
        HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(impl());
        return jsNumber(exec, imp->start());
    }
    case EndAttrNum: {
        HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(impl());
        return jsNumber(exec, imp->end());
    }
    case LoopStartAttrNum: {
        HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(impl());
        return jsNumber(exec, imp->loopStart());
    }
    case LoopEndAttrNum: {
        HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(impl());
        return jsNumber(exec, imp->loopEnd());
    }
    case PlayCountAttrNum: {
        HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(impl());
        return jsNumber(exec, imp->playCount());
    }
    case CurrentLoopAttrNum: {
        HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(impl());
        return jsNumber(exec, imp->currentLoop());
    }
    case ControlsAttrNum: {
        HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(impl());
        return jsBoolean(imp->controls());
    }
    case VolumeAttrNum: {
//.........这里部分代码省略.........
开发者ID:achellies,项目名称:ISeeBrowser,代码行数:101,代码来源:JSHTMLMediaElement.cpp


注:本文中的HTMLMediaElement::readyState方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。