DesenvolvedorAdr / BBB24

0 stars 0 forks source link

BBB24 #1

Open DesenvolvedorAdr opened 5 months ago

DesenvolvedorAdr commented 5 months ago

bbb.com

import androidx.appcompat.app.AppCompatActivity import bbb.com.databinding.ActivityMainBinding import android.os.Bundle

class MainActivity : AppCompatActivity() {

private lateinit var binding: ActivityMainBinding

override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    binding = ActivityMainBinding.inflate(layoutInflater)
    setContentView(binding.root)

    val videoUrl = "https://tvembed.net/bbb/tracks-v1a1/mono.m3u8?remote=45.181.33.136&token=35e8f3d3664018af14d0ab90385545164a3920ab-49f6ed248d4ed4f44b59a0f1dcd3331e-1706807503-1706800303"
    binding.videoView.setVideoPath(videoUrl)

    binding.btnUm.setOnClickListener {
        binding.videoView.start()
    }

    binding.btnDois.setOnClickListener {
        // Lógica para o segundo botão, se necessário
    }
}

override fun onResume() {
    super.onResume()
    binding.videoView.start()
}

}

DesenvolvedorAdr commented 5 months ago

<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center_vertical|center|center_horizontal" android:orientation="vertical" android:padding="12dp" >

<VideoView
    android:id="@+id/videoView"
    android:layout_width="match_parent"
    android:layout_height="230dp" />

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal" >

    <Button
        android:id="@+id/btnUm"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:text="Button 1"
        android:background="@android:color/darker_gray" />

    <Button
        android:id="@+id/btnDois"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:text="Button 2"
        android:background="@android:color/darker_gray" />

    <Button
        android:id="@+id/btnTres"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:text="Button 3"
        android:background="@android:color/darker_gray" />

    <Button
        android:id="@+id/btnQuatro"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:text="Button 4"
        android:background="@android:color/darker_gray" />
</LinearLayout>