Ok, So im trying to build a simple test app to play videos, Im building out a video player fragment, but when the video plays I can only hear the audio. It seems like the elements are there but are invisible for some reason.
Heres my fragment:
package ***
import android.os.Bundle;
import android.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;
import ***.R;
import io.vov.vitamio.MediaPlayer;
import io.vov.vitamio.widget.MediaController;
import io.vov.vitamio.widget.VideoView;
/**
* A simple {@link Fragment} subclass.
*
*/
public class VideoPlayerFragment extends Fragment {
private String path = "http://www.modrails.com/videos/passenger_nginx.mov";
private VideoView mVideoView;
public VideoPlayerFragment() {
// Required empty public constructor
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View rootView = inflater.inflate(R.layout.fragment_video_player, container, false);
mVideoView = (VideoView) rootView.findViewById(R.id.surface_view);
if (!io.vov.vitamio.LibsChecker.checkVitamioLibs(getActivity())){
Log.d("TAG", "Could not load");
}
if (path.equals("")) {
// Tell the user to provide a media file URL/path.
Toast.makeText(getActivity(), "Please edit VideoViewDemo Activity, and set path" + " variable to your media file URL/path", Toast.LENGTH_LONG).show();
// return;
} else {
/*
* Alternatively,for streaming media you can use
* mVideoView.setVideoURI(Uri.parse(URLstring));
*/
mVideoView.setVideoPath(path);
mVideoView.setMediaController(new MediaController(getActivity()));
mVideoView.requestFocus();
mVideoView.bringToFront();
mVideoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
@Override
public void onPrepared(MediaPlayer mediaPlayer) {
// optional need Vitamio 4.0
mediaPlayer.setPlaybackSpeed(1.0f);
}
});
}
return rootView;
}
}
Ok, So im trying to build a simple test app to play videos, Im building out a video player fragment, but when the video plays I can only hear the audio. It seems like the elements are there but are invisible for some reason.
Heres my fragment:
and my layout
Here is a screenshot with layout bounds shown of what I see
Any hints to what I'm doing wrong?
PS: I just imported vitamio as an android library project to use it