Fenster FensterVideoView Android只播放声音,没有视频
问题描述:
我试图在Android中使用Fenster显示视频,目前为止我只收到音频。视频不播放,但我可以听到音频。Fenster FensterVideoView Android只播放声音,没有视频
我的XML文件是:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:sothree="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/llShowDrop"
android:background="#FFF">
<com.malmstein.fenster.view.FensterVideoView
android:id="@+id/play_video_texture"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:keepScreenOn="true"
android:fitsSystemWindows="true"
android:visibility="visible" />
<com.malmstein.fenster.controller.SimpleMediaFensterPlayerController
android:id="@+id/play_video_controller"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:animateLayoutChanges="true"
android:fitsSystemWindows="true"
android:visibility="visible"
android:layout_above="@+id/llLastComment" />
</RelativeLayout>
我的java文件是:
final FensterVideoView textureView = (FensterVideoView) llShowDrop.findViewById(R.id.play_video_texture);
final SimpleMediaFensterPlayerController playerController = (SimpleMediaFensterPlayerController) llShowDrop.findViewById(R.id.play_video_controller);
textureView.setMediaController(playerController);
textureView.setVideo("http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4", playerController.DEFAULT_VIDEO_START);
textureView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
@Override
public void onPrepared(MediaPlayer mp) {
textureView.start();
}
});
playerController.setVisibilityListener(new FensterPlayerControllerVisibilityListener() {
@Override
public void onControlsVisibilityChange(boolean value) {
setSystemUiVisibility(value, playerController);
}
});;
有谁知道这是为什么不播放视频,只有音频播放? 在此先感谢您的帮助!
答
发现模拟器在播放视频时遇到问题。我在我的三星上测试过它,它工作完美。