我尝试用 Vitamio 播放直播。我解决了一些问题,但是我无法解决这个问题。视频无法全屏播放。这些是我的代码。我希望你能帮帮我!谢谢你,对不起我的英语不好。
package com.uusoftware.tvizle;
import io.vov.vitamio.widget.MediaController;
import io.vov.vitamio.widget.VideoView;
import android.app.Activity;
import android.net.Uri;
import android.os.Bundle;
import android.view.WindowManager;
public class Trt extends Activity{
VideoView videoView;
private void Trt1(){
String httpLiveUrl = "rtmp://trt-i.mncdn.com/trt1/trt15";
videoView = (VideoView) findViewById(R.id.VideoView);
videoView.setVideoURI(Uri.parse(httpLiveUrl));
MediaController mediaController = new MediaController(this);
videoView.setMediaController(mediaController);
videoView.requestFocus();
videoView.start();
}
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.videolayout);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
Trt1();
}
}
<?xml version="1.0" encoding="utf-8"?>`
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<io.vov.vitamio.widget.CenterLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<io.vov.vitamio.widget.VideoView
android:id="@+id/VideoView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true" />
</io.vov.vitamio.widget.CenterLayout>
</LinearLayout>