本文整理汇总了C++中TextTrack::removeCue方法的典型用法代码示例。如果您正苦于以下问题:C++ TextTrack::removeCue方法的具体用法?C++ TextTrack::removeCue怎么用?C++ TextTrack::removeCue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextTrack
的用法示例。
在下文中一共展示了TextTrack::removeCue方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addCue
void TextTrack::addCue(PassRefPtr<TextTrackCue> prpCue)
{
if (!prpCue)
return;
RefPtr<TextTrackCue> cue = prpCue;
// TODO(93143): Add spec-compliant behavior for negative time values.
if (std::isnan(cue->startTime()) || std::isnan(cue->endTime()) || cue->startTime() < 0 || cue->endTime() < 0)
return;
// 4.8.10.12.5 Text track API
// The addCue(cue) method of TextTrack objects, when invoked, must run the following steps:
// 1. If the given cue is in a text track list of cues, then remove cue from that text track
// list of cues.
TextTrack* cueTrack = cue->track();
if (cueTrack && cueTrack != this)
cueTrack->removeCue(cue.get(), ASSERT_NO_EXCEPTION);
// 2. Add cue to the method's TextTrack object's text track's text track list of cues.
cue->setTrack(this);
ensureTextTrackCueList()->add(cue);
if (m_client)
m_client->textTrackAddCue(this, cue.get());
}
示例2: throwNotEnoughArgumentsError
static v8::Handle<v8::Value> removeCueCallback(const v8::Arguments& args)
{
if (args.Length() < 1)
return throwNotEnoughArgumentsError(args.GetIsolate());
TextTrack* imp = V8TextTrack::toNative(args.Holder());
ExceptionCode ec = 0;
{
V8TRYCATCH(TextTrackCue*, cue, V8TextTrackCue::HasInstance(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)) ? V8TextTrackCue::toNative(v8::Handle<v8::Object>::Cast(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined))) : 0);
imp->removeCue(cue, ec);
if (UNLIKELY(ec))
goto fail;
return v8Undefined();
}
fail:
return setDOMException(ec, args.GetIsolate());
}
示例3: addCue
void TextTrack::addCue(PassRefPtr<TextTrackCue> prpCue, ExceptionCode& ec)
{
if (!prpCue)
return;
RefPtr<TextTrackCue> cue = prpCue;
// 4.7.10.12.6 Text tracks exposing in-band metadata
// The UA will use DataCue to expose only text track cue objects that belong to a text track that has a text
// track kind of metadata.
// If a DataCue is added to a TextTrack via the addCue() method but the text track does not have its text
// track kind set to metadata, throw a InvalidNodeTypeError exception and don't add the cue to the TextTrackList
// of the TextTrack.
if (cue->cueType() == TextTrackCue::Data && kind() != metadataKeyword()) {
ec = INVALID_NODE_TYPE_ERR;
return;
}
// TODO(93143): Add spec-compliant behavior for negative time values.
if (!cue->startMediaTime().isValid() || !cue->endMediaTime().isValid() || cue->startMediaTime() < MediaTime::zeroTime() || cue->endMediaTime() < MediaTime::zeroTime())
return;
// 4.8.10.12.5 Text track API
// The addCue(cue) method of TextTrack objects, when invoked, must run the following steps:
// 1. If the given cue is in a text track list of cues, then remove cue from that text track
// list of cues.
TextTrack* cueTrack = cue->track();
if (cueTrack && cueTrack != this)
cueTrack->removeCue(cue.get(), ASSERT_NO_EXCEPTION);
// 2. Add cue to the method's TextTrack object's text track's text track list of cues.
cue->setTrack(this);
ensureTextTrackCueList()->add(cue);
if (m_client)
m_client->textTrackAddCue(this, cue.get());
}