本文整理汇总了C++中TextTrack::removeRegion方法的典型用法代码示例。如果您正苦于以下问题:C++ TextTrack::removeRegion方法的具体用法?C++ TextTrack::removeRegion怎么用?C++ TextTrack::removeRegion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextTrack
的用法示例。
在下文中一共展示了TextTrack::removeRegion方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addRegion
void TextTrack::addRegion(PassRefPtr<VTTRegion> prpRegion)
{
if (!prpRegion)
return;
RefPtr<VTTRegion> region = prpRegion;
VTTRegionList* regionList = ensureVTTRegionList();
// 1. If the given region is in a text track list of regions, then remove
// region from that text track list of regions.
TextTrack* regionTrack = region->track();
if (regionTrack && regionTrack != this)
regionTrack->removeRegion(region.get(), ASSERT_NO_EXCEPTION);
// 2. If the method's TextTrack object's text track list of regions contains
// a region with the same identifier as region replace the values of that
// region's width, height, anchor point, viewport anchor point and scroll
// attributes with those of region.
VTTRegion* existingRegion = regionList->getRegionById(region->id());
if (existingRegion) {
existingRegion->updateParametersFromRegion(region.get());
return;
}
// Otherwise: add region to the method's TextTrack object's text track
// list of regions.
region->setTrack(this);
regionList->add(region);
}