gpt4 book ai didi

fullscreen - Vitamio全屏视频查看

转载 作者:行者123 更新时间:2023-12-01 10:00:14 25 4
gpt4 key购买 nike

我尝试用 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>

最佳答案

VideoView 放在 RelativeLayout 中并将其设置为:

<io.vov.vitamio.widget.VideoView 
android:id="@+id/vitamioView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true" />

关于fullscreen - Vitamio全屏视频查看,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17202603/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com