简体   繁体   中英

Fenster FensterVideoView Android is only playing sound, no video

I'm trying to display a video in Android using Fenster and i only get audio so far. The video does not play but i can hear the audio.

My xml file is:

<?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>

My .java file is:

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);
     }
});;

Does anyone know why this isn't playing video and only playing audio? Thanks in advance for the help!

Turns out the emulator has trouble playing videos. I tested it on my Samsung and it worked perfectly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM