Ejemplo n.º 1
0
VTTCue::~VTTCue()
{
    if (!hasDisplayTree())
        return;

    displayTreeInternal()->remove(ASSERT_NO_EXCEPTION);
}
Ejemplo n.º 2
0
void TextTrackCue::setFontSize(int fontSize, const IntSize&, bool important)
{
    if (!hasDisplayTree() || !fontSize)
        return;
    
    LOG(Media, "TextTrackCue::setFontSize - setting cue font size to %i", fontSize);

    displayTreeInternal()->setInlineStyleProperty(CSSPropertyFontSize, fontSize, CSSPrimitiveValue::CSS_PX, important);
}
Ejemplo n.º 3
0
void VTTCue::setIsActive(bool active)
{
    TextTrackCue::setIsActive(active);

    if (!active) {
        if (!hasDisplayTree())
            return;

        // Remove the display tree as soon as the cue becomes inactive.
        removeDisplayTree();
    }
}
Ejemplo n.º 4
0
void VTTCue::setIsActive(bool active)
{
    TextTrackCue::setIsActive(active);

    if (!active) {
        if (!hasDisplayTree())
            return;

        // Remove the display tree as soon as the cue becomes inactive.
        displayTreeInternal()->remove(ASSERT_NO_EXCEPTION);
    }
}
Ejemplo n.º 5
0
void VTTCue::removeDisplayTree()
{
    // The region needs to be informed about the cue removal.
    if (m_notifyRegion && track()) {
        if (VTTRegionList* regions = track()->regions()) {
            if (VTTRegion* region = regions->getRegionById(m_regionId))
                region->willRemoveTextTrackCueBox(m_displayTree.get());
        }
    }

    if (!hasDisplayTree())
        return;
    displayTreeInternal()->remove(ASSERT_NO_EXCEPTION);
}
Ejemplo n.º 6
0
void TextTrackCueGeneric::setFontSize(int fontSize, const IntSize& videoSize, bool important)
{
    if (!hasDisplayTree() || !fontSize)
        return;
    
    if (important || !baseFontSizeRelativeToVideoHeight()) {
        VTTCue::setFontSize(fontSize, videoSize, important);
        return;
    }

    double size = videoSize.height() * baseFontSizeRelativeToVideoHeight() / 100;
    if (fontSizeMultiplier())
        size *= fontSizeMultiplier() / 100;
    displayTreeInternal()->setInlineStyleProperty(CSSPropertyFontSize, lround(size), CSSPrimitiveValue::CSS_PX);

    LOG(Media, "TextTrackCueGeneric::setFontSize - setting cue font size to %li", lround(size));
}