-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWatchFootballActivity.java
37 lines (27 loc) · 1.09 KB
/
WatchFootballActivity.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package com.example.carltonapp;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.media.MediaPlayer;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.MediaController;
import android.widget.TextView;
import android.widget.VideoView;
import com.google.android.youtube.player.YouTubePlayerView;
public class WatchFootballActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_watch_football);
VideoView mVideoView = (VideoView) findViewById(R.id.videoview);
String mediaName = "carltonvid";
Uri videoUri = Uri.parse("android.resource://" + getPackageName() + "/raw/" + mediaName);
mVideoView.setVideoURI(videoUri);
MediaController controller = new MediaController(this);
controller.setMediaPlayer(mVideoView);
mVideoView.setMediaController(controller);
mVideoView.start();
}
}