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


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

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


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

示例1: HTMLDivElement

MediaControls::MediaControls(HTMLMediaElement& mediaElement)
    : HTMLDivElement(mediaElement.document()),
      m_mediaElement(&mediaElement),
      m_overlayEnclosure(nullptr),
      m_overlayPlayButton(nullptr),
      m_overlayCastButton(nullptr),
      m_enclosure(nullptr),
      m_panel(nullptr),
      m_playButton(nullptr),
      m_timeline(nullptr),
      m_currentTimeDisplay(nullptr),
      m_durationDisplay(nullptr),
      m_muteButton(nullptr),
      m_volumeSlider(nullptr),
      m_toggleClosedCaptionsButton(nullptr),
      m_textTrackList(nullptr),
      m_overflowList(nullptr),
      m_castButton(nullptr),
      m_fullscreenButton(nullptr),
      m_downloadButton(nullptr),
      m_mediaEventListener(new MediaControlsMediaEventListener(this)),
      m_windowEventListener(MediaControlsWindowEventListener::create(
          this,
          WTF::bind(&MediaControls::hideAllMenus, wrapWeakPersistent(this)))),
      m_hideMediaControlsTimer(this,
                               &MediaControls::hideMediaControlsTimerFired),
      m_hideTimerBehaviorFlags(IgnoreNone),
      m_isMouseOverControls(false),
      m_isPausedForScrubbing(false),
      m_panelWidthChangedTimer(this,
                               &MediaControls::panelWidthChangedTimerFired),
      m_panelWidth(0),
      m_keepShowingUntilTimerFires(false) {}
开发者ID:,项目名称:,代码行数:33,代码来源:

示例2: HTMLDivElement

MediaControls::MediaControls(HTMLMediaElement& mediaElement)
    : HTMLDivElement(mediaElement.document())
    , m_mediaElement(&mediaElement)
    , m_overlayEnclosure(nullptr)
    , m_overlayPlayButton(nullptr)
    , m_overlayCastButton(nullptr)
    , m_enclosure(nullptr)
    , m_panel(nullptr)
    , m_playButton(nullptr)
    , m_timeline(nullptr)
    , m_currentTimeDisplay(nullptr)
    , m_durationDisplay(nullptr)
    , m_muteButton(nullptr)
    , m_volumeSlider(nullptr)
    , m_toggleClosedCaptionsButton(nullptr)
    , m_castButton(nullptr)
    , m_fullScreenButton(nullptr)
    , m_hideMediaControlsTimer(this, &MediaControls::hideMediaControlsTimerFired)
    , m_hideTimerBehaviorFlags(IgnoreNone)
    , m_isMouseOverControls(false)
    , m_isPausedForScrubbing(false)
    , m_panelWidthChangedTimer(this, &MediaControls::panelWidthChangedTimerFired)
    , m_panelWidth(0)
    , m_allowHiddenVolumeControls(RuntimeEnabledFeatures::newMediaPlaybackUiEnabled())
    , m_keepMuteButton(false)
{
}
开发者ID:Pluto-tv,项目名称:blink-crosswalk,代码行数:27,代码来源:MediaControls.cpp

示例3: showPlaybackTargetPicker

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

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

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

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

示例4: initEngine

void WebMediaPlayerProxy::initEngine()
{
    HTMLMediaElement* element = static_cast<HTMLMediaElement*>(m_mediaPlayer->mediaPlayerClient());
    String url = element->initialURL();

    if (url.isEmpty())
        return;

    Frame* frame = element->document()->frame();
    Vector<String> paramNames;
    Vector<String> paramValues;
    String serviceType;

    // add all attributes set on the embed object
    if (NamedNodeMap* attributes = element->attributes()) {
        for (unsigned i = 0; i < attributes->length(); ++i) {
            Attribute* it = attributes->attributeItem(i);
            paramNames.append(it->name().localName().string());
            paramValues.append(it->value().string());
        }
    }
    serviceType = "application/x-mplayer2";
    frame->loader()->requestObject(static_cast<RenderPartObject*>(element->renderer()), url, nullAtom, serviceType, paramNames, paramValues);
    m_init = true;

}
开发者ID:flwh,项目名称:Alcatel_OT_985_kernel,代码行数:26,代码来源:MediaPlayerProxy.cpp

示例5: wirelessVideoPlaybackDisabled

bool MediaElementSession::wirelessVideoPlaybackDisabled(const HTMLMediaElement& element) const
{
    Settings* settings = element.document().settings();
    if (!settings || !settings->allowsAirPlayForMediaPlayback()) {
        LOG(Media, "MediaElementSession::wirelessVideoPlaybackDisabled - returning TRUE because of settings");
        return true;
    }

    if (element.fastHasAttribute(HTMLNames::webkitwirelessvideoplaybackdisabledAttr)) {
        LOG(Media, "MediaElementSession::wirelessVideoPlaybackDisabled - returning TRUE because of attribute");
        return true;
    }

#if PLATFORM(IOS)
    String legacyAirplayAttributeValue = element.fastGetAttribute(HTMLNames::webkitairplayAttr);
    if (equalLettersIgnoringASCIICase(legacyAirplayAttributeValue, "deny")) {
        LOG(Media, "MediaElementSession::wirelessVideoPlaybackDisabled - returning TRUE because of legacy attribute");
        return true;
    }
    if (equalLettersIgnoringASCIICase(legacyAirplayAttributeValue, "allow")) {
        LOG(Media, "MediaElementSession::wirelessVideoPlaybackDisabled - returning FALSE because of legacy attribute");
        return false;
    }
#endif

    MediaPlayer* player = element.player();
    if (!player)
        return true;

    bool disabled = player->wirelessVideoPlaybackDisabled();
    LOG(Media, "MediaElementSession::wirelessVideoPlaybackDisabled - returning %s because media engine says so", disabled ? "TRUE" : "FALSE");
    
    return disabled;
}
开发者ID:edcwconan,项目名称:webkit,代码行数:34,代码来源:MediaElementSession.cpp

示例6: unregisterWithDocument

void HTMLMediaSession::unregisterWithDocument(const HTMLMediaElement& element)
{
#if ENABLE(WIRELESS_PLAYBACK_TARGET)
    element.document().removePlaybackTargetPickerClient(*this);
#else
    UNUSED_PARAM(element);
#endif
}
开发者ID:,项目名称:,代码行数:8,代码来源:

示例7: addWebVTTCue

void InbandTextTrack::addWebVTTCue(double start, double end, const WebString& id, const WebString& content, const WebString& settings)
{
    HTMLMediaElement* owner = mediaElement();
    ASSERT(owner);
    RefPtrWillBeRawPtr<VTTCue> cue = VTTCue::create(owner->document(), start, end, content);
    cue->setId(id);
    cue->parseSettings(settings);
    addCue(cue);
}
开发者ID:335969568,项目名称:Blink-1,代码行数:9,代码来源:InbandTextTrack.cpp

示例8: pageAllowsPlaybackAfterResuming

bool MediaElementSession::pageAllowsPlaybackAfterResuming(const HTMLMediaElement& element) const
{
    Page* page = element.document().page();
    if (m_restrictions & RequirePageConsentToResumeMedia && page && !page->canStartMedia()) {
        LOG(Media, "MediaElementSession::pageAllowsPlaybackAfterResuming - returning FALSE");
        return false;
    }

    return true;
}
开发者ID:edcwconan,项目名称:webkit,代码行数:10,代码来源:MediaElementSession.cpp

示例9: pageAllowsDataLoading

bool HTMLMediaSession::pageAllowsDataLoading(const HTMLMediaElement& element) const
{
    Page* page = element.document().page();
    if (m_restrictions & RequirePageConsentToLoadMedia && page && !page->canStartMedia()) {
        LOG(Media, "HTMLMediaSession::pageAllowsDataLoading - returning FALSE");
        return false;
    }

    return true;
}
开发者ID:,项目名称:,代码行数:10,代码来源:

示例10: userAgent

// This function returns the user agent string associated with the
// frame loader client of our HTMLMediaElement. The call below will
// end up in FrameLoaderClientBlackBerry::userAgent().
String MediaPlayerPrivate::userAgent(const String& url) const
{
    HTMLMediaElement* element = static_cast<HTMLMediaElement*>(m_webCorePlayer->mediaPlayerClient());
    Document* topdoc = element->document()->topDocument();
    ASSERT(topdoc->frame());
    ASSERT(topdoc->frame()->loader());
    if (topdoc->frame())
        return topdoc->frame()->loader()->userAgent(KURL(KURL(), url));
    return String();
}
开发者ID:,项目名称:,代码行数:13,代码来源:

示例11: allowsAutomaticMediaDataLoading

bool MediaElementSession::allowsAutomaticMediaDataLoading(const HTMLMediaElement& element) const
{
    if (pageExplicitlyAllowsElementToAutoplayInline(element))
        return true;

    Settings* settings = element.document().settings();
    if (settings && settings->mediaDataLoadsAutomatically())
        return true;

    return false;
}
开发者ID:edcwconan,项目名称:webkit,代码行数:11,代码来源:MediaElementSession.cpp

示例12: showPlaybackTargetPicker

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

    if (!showingPlaybackTargetPickerPermitted(element))
        return;

#if PLATFORM(IOS)
    element.document().frame()->page()->chrome().client().showPlaybackTargetPicker(element.hasVideo());
#endif
}
开发者ID:houzhenggang,项目名称:webkit,代码行数:11,代码来源:HTMLMediaSession.cpp

示例13: frameView

FrameView* MediaPlayerPrivate::frameView() const
{
    // We previously used m_webCorePlayer->frameView(), but this method returns
    // a null frameView until quite late in the media player initialization,
    // and starting quite early in the media player destruction (because
    // it may be set to zero by the destructor in RenderVideo.cpp before
    // our destructor is called, leaving us unable to clean up child windows
    // in mmrDisconnect).
    HTMLMediaElement* element = static_cast<HTMLMediaElement*>(m_webCorePlayer->mediaPlayerClient());
    return element->document()->view();
}
开发者ID:,项目名称:,代码行数:11,代码来源:

示例14: 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,代码来源:

示例15: setHasPlaybackTargetAvailabilityListeners

void MediaElementSession::setHasPlaybackTargetAvailabilityListeners(const HTMLMediaElement& element, bool hasListeners)
{
    LOG(Media, "MediaElementSession::setHasPlaybackTargetAvailabilityListeners - hasListeners %s", hasListeners ? "TRUE" : "FALSE");

#if PLATFORM(IOS)
    UNUSED_PARAM(element);
    m_hasPlaybackTargetAvailabilityListeners = hasListeners;
    PlatformMediaSessionManager::sharedManager().configureWireLessTargetMonitoring();
#else
    UNUSED_PARAM(hasListeners);
    element.document().playbackTargetPickerClientStateDidChange(*this, element.mediaState());
#endif
}
开发者ID:edcwconan,项目名称:webkit,代码行数:13,代码来源:MediaElementSession.cpp


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