本文整理汇总了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();
}
示例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());
}
示例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();
}
示例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();
}
}