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


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

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


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

示例1: UpdateTimerFired

void MediaPlayerPrivateEA::UpdateTimerFired(Timer<MediaPlayerPrivateEA>*)
{
    // We can use this to control the movie playback and make sure the media player is getting all the info it needs.
    // Currently we just feed it repaint and a pause. This seems to work good enough for basic playback control but
    // we might have to revise this if further synchronization is needed between a movie player and the internal media player system.
    ClientUpdateStates();   

    // Get the natural size here so that we control when it changes (so it does not occur in the paint).
    ClientUpdate(MediaUpdateInfo::kGetNaturalSize);  
    if (mNaturalSize != GetMediaUpdateInfo().mReturnNaturalSize)
    {
        mNaturalSize = GetMediaUpdateInfo().mReturnNaturalSize;  
        mpWebCorePlayer->sizeChanged(); 
    }

    if (mMediaState == MediaUpdateInfo::kFinished)
    {
        mIsFinished = true;
        if(mIsPlaying)    
        {
            mIsPlaying = false;     // This will trigger a play request when calling the play button.

            // Pause if done playing so that the play arrow button shows up for possible replay.
            HTMLMediaElement* element = static_cast<HTMLMediaElement*>(mpWebCorePlayer->mediaPlayerClient());
            element->pause();
        }
    }

    // The movie paint needs to be ticked so that the controls get repainted and the view updated.  
    mpWebCorePlayer->repaint();   
}
开发者ID:Xertz,项目名称:EAWebKit,代码行数:31,代码来源:MediaPlayerPrivateEA.cpp

示例2: jsHTMLMediaElementPrototypeFunctionPause

EncodedJSValue JSC_HOST_CALL jsHTMLMediaElementPrototypeFunctionPause(ExecState* exec)
{
    JSValue thisValue = exec->hostThisValue();
    if (!thisValue.inherits(&JSHTMLMediaElement::s_info))
        return throwVMTypeError(exec);
    JSHTMLMediaElement* castedThis = static_cast<JSHTMLMediaElement*>(asObject(thisValue));
    HTMLMediaElement* imp = static_cast<HTMLMediaElement*>(castedThis->impl());

    imp->pause(processingUserGesture());
    return JSValue::encode(jsUndefined());
}
开发者ID:13W,项目名称:phantomjs,代码行数:11,代码来源:JSHTMLMediaElement.cpp

示例3: jsHTMLMediaElementPrototypeFunctionPause

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

    imp->pause(ec);
    setDOMException(exec, ec);
    return jsUndefined();
}
开发者ID:achellies,项目名称:ISeeBrowser,代码行数:12,代码来源:JSHTMLMediaElement.cpp

示例4: onPauseStateChanged

void MediaPlayerPrivate::onPauseStateChanged()
{
    if (!isFullscreen())
        return;

    HTMLMediaElement* element = static_cast<HTMLMediaElement*>(m_webCorePlayer->mediaPlayerClient());
    // Paused state change not due to local controller.
    if (m_platformPlayer->isPaused())
        element->pause();
    else {
        // The HMI fullscreen widget has resumed play. Check if the
        // pause timeout occurred.
        m_platformPlayer->processPauseTimeoutIfNecessary();
        element->play();
    }
}
开发者ID:,项目名称:,代码行数:16,代码来源:


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