Skip to content

Commit b14a0cc

Browse files
committed
fix 播放器
1 parent 9a9a9ae commit b14a0cc

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

VideoOS/VenvyLibrary/src/main/java/cn/com/venvy/common/media/view/CustomVideoView.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,9 @@ public void startPlay(String url) {
211211
stopPlay();
212212
initPlayer(url);
213213
}
214+
if (TextUtils.isEmpty(mCurrentUrl)) {
215+
initPlayer(url);
216+
}
214217
mCurrentUrl = url;
215218
}
216219

@@ -501,16 +504,17 @@ public boolean onTouchEvent(MotionEvent event) {
501504
}
502505

503506
private volatile boolean isStatistic = true;
507+
504508
@Override
505509
public void onCacheAvailable(File cacheFile, String url, int percentsAvailable) {
506-
if(isStatistic && cacheFile != null && cacheFile.exists() && cacheFile.getAbsolutePath().endsWith(".download")){
510+
if (isStatistic && cacheFile != null && cacheFile.exists() && cacheFile.getAbsolutePath().endsWith(".download")) {
507511
isStatistic = false;
508512
statisticVideoFileSize();
509513
}
510514
}
511515

512516
private void statisticVideoFileSize() {
513-
if(TextUtils.isEmpty(mCurrentUrl)){
517+
if (TextUtils.isEmpty(mCurrentUrl)) {
514518
return;
515519
}
516520
ThreadManager.getInstance().createShortPool().execute(new Runnable() {

0 commit comments

Comments
 (0)