Exemple #1
0
EncodedJSValue JSC_HOST_CALL jsHTMLMediaElementPrototypeFunctionPlay(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->play(processingUserGesture());
    return JSValue::encode(jsUndefined());
}
JSValue* jsHTMLMediaElementPrototypeFunctionPlay(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->play(ec);
    setDOMException(exec, ec);
    return jsUndefined();
}
Exemple #3
0
void MediaPlayerPrivate::onStopFullscreen(bool stillPlaying)
{
    if (m_player && m_player->mediaPlayerClient()) {
        Document* doc = m_player->mediaPlayerClient()->mediaPlayerOwningDocument();
        if (doc) {
            HTMLMediaElement* element =
                static_cast<HTMLMediaElement*>(doc->webkitCurrentFullScreenElement());
            element->exitFullscreen();
            doc->webkitDidExitFullScreenForElement(element);

            if (stillPlaying)
                element->play(true);
        }
    }
}
Exemple #4
0
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();
    }
}