本文整理汇总了Java中com.google.android.exoplayer2.source.BehindLiveWindowException类的典型用法代码示例。如果您正苦于以下问题:Java BehindLiveWindowException类的具体用法?Java BehindLiveWindowException怎么用?Java BehindLiveWindowException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BehindLiveWindowException类属于com.google.android.exoplayer2.source包,在下文中一共展示了BehindLiveWindowException类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: isBehindLiveWindow
import com.google.android.exoplayer2.source.BehindLiveWindowException; //导入依赖的package包/类
/***
* 是否TYPE_SOURCE 异常
*
* @param e 异常
* @return boolean boolean
*/
public static boolean isBehindLiveWindow(@NonNull ExoPlaybackException e) {
if (e.type != ExoPlaybackException.TYPE_SOURCE) {
return false;
}
Throwable cause = e.getSourceException();
while (cause != null) {
if (cause instanceof BehindLiveWindowException) {
return true;
}
cause = cause.getCause();
}
return false;
}
开发者ID:yangchaojiang,项目名称:yjPlay,代码行数:20,代码来源:VideoPlayUtils.java
示例2: isBehindLiveWindow
import com.google.android.exoplayer2.source.BehindLiveWindowException; //导入依赖的package包/类
private static boolean isBehindLiveWindow(ExoPlaybackException e) {
if (e.type != ExoPlaybackException.TYPE_SOURCE) {
return false;
}
Throwable cause = e.getSourceException();
while (cause != null) {
if (cause instanceof BehindLiveWindowException) {
return true;
}
cause = cause.getCause();
}
return false;
}
开发者ID:ashwanijanghu,项目名称:ExoPlayer-Offline,代码行数:14,代码来源:PlayerActivity.java
示例3: updateManifest
import com.google.android.exoplayer2.source.BehindLiveWindowException; //导入依赖的package包/类
@Override
public void updateManifest(DashManifest newManifest, int newPeriodIndex) {
try {
manifest = newManifest;
periodIndex = newPeriodIndex;
long periodDurationUs = manifest.getPeriodDurationUs(periodIndex);
List<Representation> representations = getAdaptationSet().representations;
for (int i = 0; i < representationHolders.length; i++) {
Representation representation = representations.get(trackSelection.getIndexInTrackGroup(i));
representationHolders[i].updateRepresentation(periodDurationUs, representation);
}
} catch (BehindLiveWindowException e) {
fatalError = e;
}
}
开发者ID:jcodeing,项目名称:K-Sonic,代码行数:16,代码来源:DefaultDashChunkSource.java
示例4: updateManifest
import com.google.android.exoplayer2.source.BehindLiveWindowException; //导入依赖的package包/类
@Override
public void updateManifest(DashManifest newManifest, int newPeriodIndex) {
try {
manifest = newManifest;
periodIndex = newPeriodIndex;
long periodDurationUs = manifest.getPeriodDurationUs(periodIndex);
List<Representation> representations = getRepresentations();
for (int i = 0; i < representationHolders.length; i++) {
Representation representation = representations.get(trackSelection.getIndexInTrackGroup(i));
representationHolders[i].updateRepresentation(periodDurationUs, representation);
}
} catch (BehindLiveWindowException e) {
fatalError = e;
}
}
开发者ID:zhanglibin123488,项目名称:videoPickPlayer,代码行数:16,代码来源:DefaultDashChunkSource.java
示例5: updateRepresentation
import com.google.android.exoplayer2.source.BehindLiveWindowException; //导入依赖的package包/类
public void updateRepresentation(long newPeriodDurationUs, Representation newRepresentation)
throws BehindLiveWindowException{
DashSegmentIndex oldIndex = representation.getIndex();
DashSegmentIndex newIndex = newRepresentation.getIndex();
periodDurationUs = newPeriodDurationUs;
representation = newRepresentation;
if (oldIndex == null) {
// Segment numbers cannot shift if the index isn't defined by the manifest.
return;
}
segmentIndex = newIndex;
if (!oldIndex.isExplicit()) {
// Segment numbers cannot shift if the index isn't explicit.
return;
}
int oldIndexLastSegmentNum = oldIndex.getLastSegmentNum(periodDurationUs);
long oldIndexEndTimeUs = oldIndex.getTimeUs(oldIndexLastSegmentNum)
+ oldIndex.getDurationUs(oldIndexLastSegmentNum, periodDurationUs);
int newIndexFirstSegmentNum = newIndex.getFirstSegmentNum();
long newIndexStartTimeUs = newIndex.getTimeUs(newIndexFirstSegmentNum);
if (oldIndexEndTimeUs == newIndexStartTimeUs) {
// The new index continues where the old one ended, with no overlap.
segmentNumShift += oldIndex.getLastSegmentNum(periodDurationUs) + 1
- newIndexFirstSegmentNum;
} else if (oldIndexEndTimeUs < newIndexStartTimeUs) {
// There's a gap between the old index and the new one which means we've slipped behind the
// live window and can't proceed.
throw new BehindLiveWindowException();
} else {
// The new index overlaps with the old one.
segmentNumShift += oldIndex.getSegmentNum(newIndexStartTimeUs, periodDurationUs)
- newIndexFirstSegmentNum;
}
}
开发者ID:zhanglibin123488,项目名称:videoPickPlayer,代码行数:38,代码来源:DefaultDashChunkSource.java
示例6: isBehindLiveWindow
import com.google.android.exoplayer2.source.BehindLiveWindowException; //导入依赖的package包/类
private static boolean isBehindLiveWindow(ExoPlaybackException e) {
if (e.type != ExoPlaybackException.TYPE_SOURCE) {
return false;
}
Throwable cause = e.getSourceException();
while (cause != null) {
if (cause instanceof BehindLiveWindowException) {
return true;
}
cause = cause.getCause();
}
return false;
}
开发者ID:y20k,项目名称:transistor,代码行数:14,代码来源:PlayerActivity.java
示例7: updateRepresentation
import com.google.android.exoplayer2.source.BehindLiveWindowException; //导入依赖的package包/类
public void updateRepresentation(long newPeriodDurationUs, Representation newRepresentation)
throws BehindLiveWindowException{
DashSegmentIndex oldIndex = representation.getIndex();
DashSegmentIndex newIndex = newRepresentation.getIndex();
periodDurationUs = newPeriodDurationUs;
representation = newRepresentation;
if (oldIndex == null) {
// Segment numbers cannot shift if the index isn't defined by the manifest.
return;
}
segmentIndex = newIndex;
if (!oldIndex.isExplicit()) {
// Segment numbers cannot shift if the index isn't explicit.
return;
}
int oldIndexSegmentCount = oldIndex.getSegmentCount(periodDurationUs);
if (oldIndexSegmentCount == 0) {
// Segment numbers cannot shift if the old index was empty.
return;
}
int oldIndexLastSegmentNum = oldIndex.getFirstSegmentNum() + oldIndexSegmentCount - 1;
long oldIndexEndTimeUs = oldIndex.getTimeUs(oldIndexLastSegmentNum)
+ oldIndex.getDurationUs(oldIndexLastSegmentNum, periodDurationUs);
int newIndexFirstSegmentNum = newIndex.getFirstSegmentNum();
long newIndexStartTimeUs = newIndex.getTimeUs(newIndexFirstSegmentNum);
if (oldIndexEndTimeUs == newIndexStartTimeUs) {
// The new index continues where the old one ended, with no overlap.
segmentNumShift += oldIndexLastSegmentNum + 1 - newIndexFirstSegmentNum;
} else if (oldIndexEndTimeUs < newIndexStartTimeUs) {
// There's a gap between the old index and the new one which means we've slipped behind the
// live window and can't proceed.
throw new BehindLiveWindowException();
} else {
// The new index overlaps with the old one.
segmentNumShift += oldIndex.getSegmentNum(newIndexStartTimeUs, periodDurationUs)
- newIndexFirstSegmentNum;
}
}
开发者ID:jcodeing,项目名称:K-Sonic,代码行数:43,代码来源:DefaultDashChunkSource.java
示例8: updateRepresentation
import com.google.android.exoplayer2.source.BehindLiveWindowException; //导入依赖的package包/类
void updateRepresentation(long newPeriodDurationUs,
Representation newRepresentation) throws BehindLiveWindowException {
DashSegmentIndex oldIndex = representation.getIndex();
DashSegmentIndex newIndex = newRepresentation.getIndex();
periodDurationUs = newPeriodDurationUs;
representation = newRepresentation;
if (oldIndex == null) {
// Segment numbers cannot shift if the index isn't defined by the manifest.
return;
}
segmentIndex = newIndex;
if (!oldIndex.isExplicit()) {
// Segment numbers cannot shift if the index isn't explicit.
return;
}
int oldIndexSegmentCount = oldIndex.getSegmentCount(periodDurationUs);
if (oldIndexSegmentCount == 0) {
// Segment numbers cannot shift if the old index was empty.
return;
}
int oldIndexLastSegmentNum = oldIndex.getFirstSegmentNum() + oldIndexSegmentCount - 1;
long oldIndexEndTimeUs = oldIndex.getTimeUs(oldIndexLastSegmentNum)
+ oldIndex.getDurationUs(oldIndexLastSegmentNum, periodDurationUs);
int newIndexFirstSegmentNum = newIndex.getFirstSegmentNum();
long newIndexStartTimeUs = newIndex.getTimeUs(newIndexFirstSegmentNum);
if (oldIndexEndTimeUs == newIndexStartTimeUs) {
// The new index continues where the old one ended, with no overlap.
segmentNumShift += oldIndexLastSegmentNum + 1 - newIndexFirstSegmentNum;
} else if (oldIndexEndTimeUs < newIndexStartTimeUs) {
// There's a gap between the old index and the new one which means we've slipped behind the
// live window and can't proceed.
throw new BehindLiveWindowException();
} else {
// The new index overlaps with the old one.
segmentNumShift += oldIndex.getSegmentNum(newIndexStartTimeUs, periodDurationUs)
- newIndexFirstSegmentNum;
}
}
开发者ID:y20k,项目名称:transistor,代码行数:43,代码来源:DefaultDashChunkSource.java
注:本文中的com.google.android.exoplayer2.source.BehindLiveWindowException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论