Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

再请教一下,还是那个多视频地址翻页播放的问题 #9

Open
1214658495 opened this issue Dec 12, 2017 · 5 comments
Open

Comments

@1214658495
Copy link

我改了 private void generateUrls() {
mVideoUrls.add("http://192.168.42.1/SD0/EVENT/2017-11-28-19-11-56.MP4");
mVideoUrls.add("http://192.168.42.1/SD0/EVENT/2017-11-28-19-13-56.MP4");
mVideoUrls.add("http://192.168.42.1/SD0/EVENT/2017-11-28-19-15-56.MP4");
mVideoUrls.add("http://192.168.42.1/SD0/EVENT/2017-11-28-19-17-56.MP4");
mVideoUrls.add("http://192.168.42.1/SD0/EVENT/2017-11-28-19-19-56.MP4");
}。添加了多个地址播放。但实际情况还是一样,翻页时还是只能播放第一个视频。请问你有测试过吗?谢谢指导,感激不尽

@sunkeding
Copy link

表示遇到了同样的问题呢,虽然视频地址改了,但是永远都只会播放第一个视频

@Zhangxd77
Copy link

请问各位解决了吗这个问题?

@qq787207389
Copy link

我也是这个情况,坑啊、

@qq787207389
Copy link

终于解决了只播放一个的问题,把mVideoView.setVideoPath(mVideoPath);这句写在这里面 mViewPager.setOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() {
@OverRide
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
Log.e(TAG, "mCurrentId == " + position + ", positionOffset == " + positionOffset +
", positionOffsetPixels == " + positionOffsetPixels);
mCurrentItem = position;
mVideoView.setVideoPath(mVideoUrls.get(mCurrentItem));
}
});
}
还有个坑就是这句在MediaController里面的show方法里面的mWindow.showAtLocation(mAnchor, Gravity.BOTTOM,anchorRect.left, 0);把这个改成
this.post(new Runnable() {
@OverRide
public void run() {
mWindow.showAtLocation(mAnchor, Gravity.BOTTOM,
anchorRect.left, 0);
}
});

@xingstarx
Copy link
Owner

@qq787207389 厉害了,这个好久都没有维护了,post可以让方法体等会再执行,赞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants