Ejemplo n.º 1
0
void TextTrack::setKind(const AtomicString& newKind)
{
    String oldKind = kind();

#if ENABLE(MEDIA_SOURCE)
    // 10.1 kind, on setting:
    // 1. If the value being assigned to this attribute does not match one of the text track kinds,
    // then abort these steps.
    if (!isValidKindKeyword(newKind))
        return;

    // 2. Update this attribute to the new value.
    setKindInternal(newKind);

    // 3. If the sourceBuffer attribute on this track is not null, then queue a task to fire a simple
    // event named change at sourceBuffer.textTracks.
    if (m_sourceBuffer)
        m_sourceBuffer->textTracks()->scheduleChangeEvent();

    // 4. Queue a task to fire a simple event named change at the TextTrackList object referenced by
    // the textTracks attribute on the HTMLMediaElement.
    if (mediaElement())
        mediaElement()->textTracks()->scheduleChangeEvent();
#else
    TrackBase::setKind(newKind);
#endif

    if (m_client && oldKind != kind())
        m_client->textTrackKindChanged(this);
}
Ejemplo n.º 2
0
TextTrack::TextTrack(ScriptExecutionContext* context, TextTrackClient* client, const AtomicString& kind, const AtomicString& id, const AtomicString& label, const AtomicString& language, TextTrackType type)
    : TrackBase(TrackBase::TextTrack, id, label, language)
    , m_cues(0)
    , m_regions(0)
    , m_scriptExecutionContext(context)
    , m_mode(disabledKeyword().string())
    , m_client(client)
    , m_trackType(type)
    , m_readinessState(NotLoaded)
    , m_trackIndex(invalidTrackIndex)
    , m_renderedTrackIndex(invalidTrackIndex)
    , m_hasBeenConfigured(false)
{
    setKindInternal(kind);
}
Ejemplo n.º 3
0
void TrackBase::setKind(const AtomicString& kind)
{
    setKindInternal(kind);
}