package com.example.shorti;

import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.VideoView;

import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;

// access
// eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIzOWI5OTk3MS00ODg2LTRjNmYtYjM3MS1mYTYyOWQ3ODQwZTEiLCJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiMTIzMTIzIiwiaHR0cDovL3NjaGVtYXMueG1sc29hcC5vcmcvd3MvMjAwNS8wNS9pZGVudGl0eS9jbGFpbXMvbmFtZWlkZW50aWZpZXIiOiI3NzI4NmVjZi1hNjZhLTQyY2YtYjczNy0zMmU0Njc5Mjg0ZGIiLCJleHAiOjE3MTA0NTA3MzYsImlzcyI6Imh0dHA6Ly9sb2NhbGhvc3Q6NTA2NCIsImF1ZCI6Imh0dHA6Ly9sb2NhbGhvc3Q6NTI4MyJ9.uaz5TbetYj4V-gdxl0vH1RwX2PI6w_5EwdZ3TI_nwME

// QdJo+Mj09J9a0wnvV4xtShtP/qN2p5cBlVREa4YCShA=

public class MainActivity extends AppCompatActivity {
    VideoView player;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        EdgeToEdge.enable(this);
        setContentView(R.layout.activity_main);
        ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
            Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
            v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
            return insets;
        });

        player = findViewById(R.id.videoView);
        player.setVideoPath("http://212.109.198.242:5171/shorts/7bac3a7e-b435-4f3b-b522-294e8a6be416.mp4");
    }

    public void play(View view) {
        player.start();
    }

    public void pause(View view) {
        player.pause();
    }

    public void stop(View view) {
        player.stopPlayback();
        player.resume();
    }

    public void next(View view) {
        player.stopPlayback();
        player.setVideoPath("http://212.109.198.242:5171/shorts/dadfe258-fa3d-468f-bac8-99a44a3a777a.mp4");
        player.start();
    }
}





// Authorization: Bearer eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiI2OTk1NmJhYy0wNjc0LTQxYTEtYWVlNS1jMzU3NzY4ZTdlYWIiLCJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiMTIzMTIzIiwiaHR0cDovL3NjaGVtYXMueG1sc29hcC5vcmcvd3MvMjAwNS8wNS9pZGVudGl0eS9jbGFpbXMvbmFtZWlkZW50aWZpZXIiOiI3NzI4NmVjZi1hNjZhLTQyY2YtYjczNy0zMmU0Njc5Mjg0ZGIiLCJleHAiOjE3MTA0NTIwMDEsImlzcyI6Imh0dHA6Ly9sb2NhbGhvc3Q6NTA2NCIsImF1ZCI6Imh0dHA6Ly9sb2NhbGhvc3Q6NTI4MyJ9.CS_21DR36vyzzlK7BRt_7dRhVxyCfS5eBd2tWzozayk