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


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

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


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

示例1: jsHTMLMediaElementEnded

JSValue jsHTMLMediaElementEnded(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 = jsBoolean(imp->ended());
    return result;
}
开发者ID:13W,项目名称:phantomjs,代码行数:8,代码来源:JSHTMLMediaElement.cpp

示例2: canControlControlsManager

bool MediaElementSession::canControlControlsManager(const HTMLMediaElement& element) const
{
    if (!element.hasAudio()) {
        LOG(Media, "MediaElementSession::canControlControlsManager - returning FALSE: No audio");
        return false;
    }

    if (element.muted()) {
        LOG(Media, "MediaElementSession::canControlControlsManager - returning FALSE: Muted");
        return false;
    }

    if (element.ended()) {
        LOG(Media, "MediaElementSession::canControlControlsManager - returning FALSE: Ended");
        return false;
    }

    if (element.document().activeDOMObjectsAreSuspended()) {
        LOG(Media, "MediaElementSession::canControlControlsManager - returning FALSE: activeDOMObjectsAreSuspended()");
        return false;
    }

    if (!playbackPermitted(element)) {
        LOG(Media, "MediaElementSession::canControlControlsManager - returning FALSE: Playback not permitted");
        return false;
    }

    if (element.isVideo()) {
        if (!element.renderer()) {
            LOG(Media, "MediaElementSession::canControlControlsManager - returning FALSE: No renderer");
            return false;
        }

        if (!element.hasVideo()) {
            LOG(Media, "MediaElementSession::canControlControlsManager - returning FALSE: No video");
            return false;
        }

        if (isElementLargeEnoughForMainContent(element)) {
            LOG(Media, "MediaElementSession::canControlControlsManager - returning TRUE: Is main content");
            return true;
        }
    }

    if (m_restrictions & RequireUserGestureToControlControlsManager && !ScriptController::processingUserGestureForMedia()) {
        LOG(Media, "MediaElementSession::canControlControlsManager - returning FALSE: No user gesture");
        return false;
    }

    LOG(Media, "MediaElementSession::canControlControlsManager - returning TRUE: All criteria met");
    return true;
}
开发者ID:,项目名称:,代码行数:52,代码来源:

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