protected override void OnCreate (Bundle icicle) { //base.OnCreate(icicle); if (!LibsChecker.CheckVitamioLibs (this)) return; SetContentView (Resource.Layout.videobuffer); mVideoView = FindViewById<VideoView> (Resource.Id.buffer); pb = FindViewById<ProgressBar> (Resource.Id.probar); downloadRateView = FindViewById<TextView> (Resource.Id.download_rate); loadRateView = FindViewById<TextView> (Resource.Id.load_rate); if (path == "") { // Tell the user to provide a media file URL/path. Toast.MakeText (this, "Please edit VideoBuffer Activity, and set path" + " variable to your media file URL/path", ToastLength.Long).Show (); return; } else { // // * Alternatively,for streaming media you can use // * mVideoView.setVideoURI(Uri.parse(URLstring)); // uri = Android.Net.Uri.Parse (path); mVideoView.SetVideoURI (uri); mVideoView.SetMediaController (new MediaController (this)); mVideoView.RequestFocus (); mVideoView.SetOnInfoListener (this); mVideoView.SetOnBufferingUpdateListener (this); mVideoView.Prepared += (object sender, MediaPlayer.PreparedEventArgs e) => { e.P0.SetPlaybackSpeed(1.0f); }; } }
private void SetSource() { try { if (string.IsNullOrWhiteSpace(Element.Source)) { return; } _prepared = false; if (Element.Source.StartsWith("http://", StringComparison.CurrentCultureIgnoreCase) || Element.Source.StartsWith("https://", StringComparison.CurrentCultureIgnoreCase)) { _videoView.SetVideoURI(Android.Net.Uri.Parse(Element.Source)); } else { _videoView.SetVideoPath(Element.Source); } _videoView.RequestFocus(); // _videoView.SetOnPreparedListener(new VideoLoop()); //_videoView.SetOnPreparedListener(new OnPreparedListener()); } catch (Java.Lang.Exception e) { System.Diagnostics.Debug.WriteLine(e); Element.OnError(e.Message); } }
protected override void OnCreate(Bundle bundle) { base.OnCreate (bundle); // Set our view from the "main" layout resource SetContentView (Resource.Layout.upload_video_layout); context = this; Button buttonSelect = FindViewById<Button> (Resource.Id.button2); Button buttonUpload = FindViewById<Button> (Resource.Id.button); videoView = FindViewById<VideoView> (Resource.Id.videoView); videoView.SetMediaController (new Android.Widget.MediaController (this)); videoView.RequestFocus (); buttonSelect.Click += delegate { if(videoView != null) videoView.Pause(); Intent intent = new Intent (Intent.ActionPick, Android.Provider.MediaStore.Video.Media.ExternalContentUri); StartActivityForResult (intent, 0); }; buttonUpload.Click += delegate { if(videoView != null) { if(videoView.IsPlaying) { videoView.Pause(); } new UploadTask(context).Execute(new Java.Lang.Object[]{GetPathFromUri(uri)}); } }; }
void CamStartPlay_Click(object sender, EventArgs e) { var uri = Android.Net.Uri.Parse("rtsp://*****:*****@192.168.1.34/media/video1"); //Camrender.SetMediaController(new MediaController(this)); Camrender.RequestFocus(); Camrender.SetVideoURI(uri); Camrender.Start(); }
/// <summary> /// Load video /// </summary> void LoadVideo() { try { Galeria galeria = service.HttpGet <Galeria>(constants.Url, constants.GaleriaController, constants.GaleriaMethod, "code=05"); var uri = Android.Net.Uri.Parse(galeria.Url); VideoViewMain.SetVideoURI(uri); VideoViewMain.RequestFocus(); VideoViewMain.Start(); mediaController = new Android.Widget.MediaController(this); mediaController.SetMediaPlayer(VideoViewMain); VideoViewMain.SetMediaController(mediaController); VideoViewMain.RequestFocus(); } catch (Exception) { AlertDialog("Alerta", "Ha ocurrido un error al intentar cargar el video, intente de nuevo mas tarde"); } }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View v = inflater.Inflate(Resource.Layout.fragment_hello_moon, container, false); mPlayButton = (Button)v.FindViewById(Resource.Id.hellomoon_playButton); mPlayButton.Click += (object sender, EventArgs e) => { mPlayer.Play(Activity); }; mStopButton = (Button)v.FindViewById(Resource.Id.hellomoon_stopButton); mStopButton.Click += (object sender, EventArgs e) => { mPlayer.Stop(); }; mPauseButton = (Button)v.FindViewById(Resource.Id.hellomoon_pauseButton); mPauseButton.Click += (object sender, EventArgs e) => { mPlayer.Pause(); }; // string fileName = "http://johnnygold.com/PigsInAPolka1943.mp4"; //Works from web string fileName = "android.resource://" + Activity.PackageName + "/" + Resource.Raw.apollo_17_strollnexus; // Now works from device. Activity.Window.SetFormat(Android.Graphics.Format.Translucent); mVideoView = (VideoView)v.FindViewById(Resource.Id.videoView); MediaController controller = new MediaController(Activity); mVideoView.SetMediaController(controller); mVideoView.RequestFocus(); Android.Net.Uri uri = Android.Net.Uri.Parse(fileName); mVideoView.SetVideoURI(uri); // mVideoView.Start(); // Not needed with MediaController // vPlayButton = (Button)v.FindViewById(Resource.Id.hellomoon_vPlayButton); // vPlayButton.Click += (object sender, EventArgs e) => { // mVideoView.Start(); // vPauseButton.Enabled = true; // }; // // vStopButton = (Button)v.FindViewById(Resource.Id.hellomoon_vStopButton); // vStopButton.Click += (object sender, EventArgs e) => { // mVideoView.StopPlayback(); // vPauseButton.Enabled = false; // mVideoView.SetVideoURI(Android.Net.Uri.Parse(fileName)); // }; // // vPauseButton = (Button)v.FindViewById(Resource.Id.hellomoon_vPauseButton); // vPauseButton.Click += (object sender, EventArgs e) => { // vPauseButton.Enabled = false; // mVideoView.Pause(); // }; return(v); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Set our view from the "main" layout resource SetContentView(Resource.Layout.VideoActivity); videoView = FindViewById <VideoView> (Resource.Id.SampleVideoView); videoView.SetMediaController(new MediaController(this)); videoView.SetVideoPath($"android.resource://{PackageName}/{Resource.Raw.bunny}"); videoView.RequestFocus(); videoView.Start(); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View v = inflater.Inflate(Resource.Layout.fragment_hello_moon, container, false); mPlayButton = (Button)v.FindViewById(Resource.Id.hellomoon_playButton); mPlayButton.Click += (object sender, EventArgs e) => { mPlayer.Play(Activity); }; mStopButton = (Button)v.FindViewById(Resource.Id.hellomoon_stopButton); mStopButton.Click += (object sender, EventArgs e) => { mPlayer.Stop(); }; mPauseButton = (Button)v.FindViewById(Resource.Id.hellomoon_pauseButton); mPauseButton.Click += (object sender, EventArgs e) => { mPlayer.Pause(); }; // string fileName = "http://johnnygold.com/PigsInAPolka1943.mp4"; //Works from web string fileName = "android.resource://" + Activity.PackageName + "/" + Resource.Raw.apollo_17_strollnexus; // Now works from device. Activity.Window.SetFormat(Android.Graphics.Format.Translucent); mVideoView = (VideoView)v.FindViewById(Resource.Id.videoView); MediaController controller = new MediaController(Activity); mVideoView.SetMediaController(controller); mVideoView.RequestFocus(); Android.Net.Uri uri = Android.Net.Uri.Parse(fileName); mVideoView.SetVideoURI(uri); // mVideoView.Start(); // Not needed with MediaController // vPlayButton = (Button)v.FindViewById(Resource.Id.hellomoon_vPlayButton); // vPlayButton.Click += (object sender, EventArgs e) => { // mVideoView.Start(); // vPauseButton.Enabled = true; // }; // // vStopButton = (Button)v.FindViewById(Resource.Id.hellomoon_vStopButton); // vStopButton.Click += (object sender, EventArgs e) => { // mVideoView.StopPlayback(); // vPauseButton.Enabled = false; // mVideoView.SetVideoURI(Android.Net.Uri.Parse(fileName)); // }; // // vPauseButton = (Button)v.FindViewById(Resource.Id.hellomoon_vPauseButton); // vPauseButton.Click += (object sender, EventArgs e) => { // vPauseButton.Enabled = false; // mVideoView.Pause(); // }; return v; }
public static void SetPlayerView(this IMediaPlayer mediaPlayer, VideoView videoView) { if (mediaPlayer is IVideoPlayer <SimpleExoPlayer, PlayerView> videoPlayer) { videoPlayer.PlayerView = videoView; videoView.RequestFocus(); videoView.Player = videoPlayer.Player; } else { throw new ArgumentException("MediaPlayer needs to be of type IMediaPlayer<SimpleExoPlayer> to use this extension", nameof(mediaPlayer)); } }
void OnVideoViewPrepared(object sender, EventArgs args) { isPrepared = true; ((IVideoPlayerController)Element).Duration = TimeSpan.FromMilliseconds(videoView.Duration); //mediaPlayer = sender as MediaPlayer; //int videoWidth = mediaPlayer.VideoWidth; //int videoHeight = mediaPlayer.VideoHeight; //DisplayMetrics displayMetrics = new DisplayMetrics(); //IWindowManager windowManager = Context.GetSystemService(Context.WindowService).JavaCast<IWindowManager>(); //windowManager.DefaultDisplay.GetMetrics(displayMetrics); //int screenWidth = displayMetrics.WidthPixels; //int screenHeight = displayMetrics.HeightPixels; //float scaleY = 1.0f; //float scaleX = (videoWidth * screenHeight / videoHeight) / screenWidth; //int pivotPointX = (int)(screenWidth / 2); //int pivotPointY = (int)(screenHeight / 2); //surfaceView.setScaleX(scaleX); //surfaceView.setScaleY(scaleY); //surfaceView.setPivotX(pivotPointX); //surfaceView.setPivotY(pivotPointY); if (Element.AutoPlay && hasSetSource) { if (videoView.IsPlaying) { videoView.StopPlayback(); } videoView.RequestFocus(); videoView.Start(); videoView.SeekTo(0); } }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.splash_activity); VideoView mVideoView = FindViewById <VideoView>(Resource.Id.splash_video); string uripath = "android.resource://com.ewin.clatest/" + Resource.Raw.splash; Uri uri2 = Uri.Parse(uripath); mVideoView.SetVideoURI(uri2); mVideoView.RequestFocus(); mVideoView.Start(); }
private void PostVideoViewOnPrepared(object sender, EventArgs e) { try { PostVideoView.RequestFocus(); PostVideoView.Start(); ProgressBar.Visibility = ViewStates.Invisible; PostVideoView.Visibility = ViewStates.Visible; } catch (Exception exception) { Console.WriteLine(exception); } }
private void VideoPlayerMain() { var mediaController = new MediaController(this); previewVideoPlayer.SetVideoURI(Android.Net.Uri.Parse("http://xonshiz.heliohost.org/unitedhcl/streams/preview_video.mp4")); mediaController.SetAnchorView(previewVideoPlayer); previewVideoPlayer.SetMediaController(mediaController); previewVideoPlayer.RequestFocus(); Console.WriteLine("Got the focus"); //this.RequestedOrientation = ScreenOrientation.Landscape; //previewVideoPlayer.Visibility = ViewStates.Visible; Console.WriteLine("Starting the video"); previewVideoPlayer.Start(); Console.WriteLine("Done!"); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.OurVideoPlayer); // Create your application here string videoUrl = Intent.GetStringExtra("videoUrl") ?? "Data not available";; VideoPlayer = FindViewById <VideoView>(Resource.Id.LiveVideoMain); var mediaController = new MediaController(this); VideoPlayer.SetVideoURI(Android.Net.Uri.Parse(videoUrl)); mediaController.SetAnchorView(VideoPlayer); VideoPlayer.SetMediaController(mediaController); VideoPlayer.RequestFocus(); VideoPlayer.Start(); }
private void SetSource() { try { if (string.IsNullOrWhiteSpace(Element.Source)) { return; } _prepared = false; progressBar.Visibility = Android.Views.ViewStates.Visible; _videoView.SetVideoURI(Android.Net.Uri.Parse(Element.Source)); _videoView.RequestFocus(); } catch (Java.Lang.Exception e) { System.Diagnostics.Debug.WriteLine(e); Element.OnError(e.Message); } }
private void ButtonClick(string file) { var uri = Android.Net.Uri.Parse($"content://{ZipFileContentProvider.ContentProviderAuthority}/{file}"); video.SetVideoURI(uri); // add the start/pause controls var controller = new MediaController(this); controller.SetMediaPlayer(video); video.SetMediaController(controller); video.Prepared += delegate { // play the video video.Start(); }; video.RequestFocus(); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); Window.AddFlags(WindowManagerFlags.Fullscreen); Window.ClearFlags(WindowManagerFlags.ForceNotFullscreen); ActionBar.Hide(); SetContentView(Resource.Layout.video_fragment); int id = Intent.GetIntExtra(Constants.VIDEO_ID, 0); vv = (VideoView)FindViewById(Resource.Id.video); MediaController mediaController = new MediaController(this, true); vv.SetMediaController(mediaController); String uriPath = "android.resource://AlgeTiles.AlgeTiles/" + id; var uri = Android.Net.Uri.Parse(uriPath); mediaController.SetAnchorView(vv); //mediaController.Show(2000); vv.SetVideoURI(uri); vv.RequestFocus(); vv.Start(); // Create your application here }
public void YoutubeVideo(string id) { string link = "https://www.youtube.com/watch?v=" + id; IEnumerable <VideoInfo> videosInfors = DownloadUrlResolver.GetDownloadUrls(link); VideoInfo video = videosInfors.First(infor => infor.VideoType == VideoType.Mp4); video_url = video.DownloadUrl; video_title = video.Title; video_extension = video.VideoExtension; video_view.SetVideoURI(Android.Net.Uri.Parse(video.DownloadUrl)); media_controller = new Android.Widget.MediaController(this); media_controller.SetMediaPlayer(video_view); video_view.SetMediaController(media_controller); video_view.RequestFocus(); video_view.Start(); }
protected override void OnCreate(Bundle icicle) { //base.OnCreate(icicle); if (!LibsChecker.CheckVitamioLibs(this)) { return; } SetContentView(Resource.Layout.videobuffer); mVideoView = FindViewById <VideoView> (Resource.Id.buffer); pb = FindViewById <ProgressBar> (Resource.Id.probar); downloadRateView = FindViewById <TextView> (Resource.Id.download_rate); loadRateView = FindViewById <TextView> (Resource.Id.load_rate); if (path == "") { // Tell the user to provide a media file URL/path. Toast.MakeText(this, "Please edit VideoBuffer Activity, and set path" + " variable to your media file URL/path", ToastLength.Long).Show(); return; } else { // // * Alternatively,for streaming media you can use // * mVideoView.setVideoURI(Uri.parse(URLstring)); // uri = Android.Net.Uri.Parse(path); mVideoView.SetVideoURI(uri); mVideoView.SetMediaController(new MediaController(this)); mVideoView.RequestFocus(); mVideoView.SetOnInfoListener(this); mVideoView.SetOnBufferingUpdateListener(this); mVideoView.Prepared += (object sender, MediaPlayer.PreparedEventArgs e) => { e.P0.SetPlaybackSpeed(1.0f); }; } }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); Xamarin.Essentials.Platform.Init(this, savedInstanceState); SetContentView(Resource.Layout.activity_main); Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar); SetSupportActionBar(toolbar); DrawerLayout drawer = FindViewById <DrawerLayout>(Resource.Id.drawer_layout); ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, drawer, toolbar, Resource.String.navigation_drawer_open, Resource.String.navigation_drawer_close); drawer.AddDrawerListener(toggle); toggle.SyncState(); NavigationView navigationView = FindViewById <NavigationView>(Resource.Id.nav_view); navigationView.SetNavigationItemSelectedListener(this); BottomNavigationView navigation = FindViewById <BottomNavigationView>(Resource.Id.navigation); navigation.SetOnNavigationItemSelectedListener(this); AssetManager assets = this.Assets; using (StreamReader sr = new StreamReader(assets.Open("special.json"))) { var json = sr.ReadToEnd(); var rootobject_special = JsonConvert.DeserializeObject <SpecialDefualt.Rootobject>(json); special = rootobject_special.special; } using (StreamReader sr = new StreamReader(assets.Open("perks.json"))) { var json = sr.ReadToEnd(); var rootobject_perks = JsonConvert.DeserializeObject <PerksDefualt.Rootobject>(json); perks = rootobject_perks.perks; } using (var writer = new System.IO.StringWriter()) { //count_special int c_s = 0; foreach (var c in special) { var layout_main = FindViewById <LinearLayout>(Resource.Id.add_layout_special); CardView.LayoutParams layout_card_par = new CardView.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent); layout_card_par.SetMargins(30, 30, 30, 30); LinearLayout layout_card = new LinearLayout(this) { Orientation = Android.Widget.Orientation.Vertical, LayoutParameters = layout_card_par }; CardView.LayoutParams card_par = new CardView.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent); card_par.SetMargins(30, 30, 30, 30); CardView card = new CardView(this) { LayoutParameters = card_par, }; card.SetCardBackgroundColor(Android.Graphics.Color.Black); var special_name = new TextView(this) { Text = special[c_s].Info[0].ToString() }; special_name.SetTextColor(Android.Graphics.Color.LimeGreen); special_name.SetTextSize(ComplexUnitType.Px, 100); var special_description = new TextView(this) { Text = special[c_s].ToString() }; special_description.SetTextColor(Android.Graphics.Color.LimeGreen); LinearLayout.LayoutParams par_layout_buttons = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent) { Gravity = GravityFlags.Right }; LinearLayout layout_buttons = new LinearLayout(this) { Orientation = Android.Widget.Orientation.Horizontal, LayoutParameters = par_layout_buttons }; var button1 = new ImageButton(this) { ContentDescription = c_s.ToString() }; button1.SetImageResource(Resource.Drawable.arrow_left); button1.SetBackgroundColor(Android.Graphics.Color.LimeGreen); var button2 = new ImageButton(this) { }; button2.SetImageResource(Resource.Drawable.arrow_right); button2.SetBackgroundColor(Android.Graphics.Color.LimeGreen); var editText1 = new EditText(this) { Text = special[c_s].Data[0].ToString() }; editText1.SetTextColor(Android.Graphics.Color.LimeGreen); layout_card.AddView(special_name); layout_card.AddView(special_description); layout_buttons.AddView(button1); layout_buttons.AddView(editText1); layout_buttons.AddView(button2); layout_card.AddView(layout_buttons); card.AddView(layout_card); layout_main.AddView(card); button1.Click += (o, e) => { var current = Int32.Parse(button1.ContentDescription); if (2 <= Int32.Parse(editText1.Text)) { editText1.Text = (Int32.Parse(editText1.Text) - 1).ToString(); special[current].assignedPoints -= 1; } }; button2.Click += (o, e) => { var current = Int32.Parse(button1.ContentDescription.ToString()); if (Int32.Parse(editText1.Text) <= 14) { editText1.Text = (Int32.Parse(editText1.Text) + 1).ToString(); special[current].assignedPoints += 1; } }; c_s += 1; } } using (var writer = new System.IO.StringWriter()) { //count_perks int c_p = 0; foreach (var c in perks) { var layout_main = FindViewById <LinearLayout>(Resource.Id.add_layout_special); CardView.LayoutParams layout_card_par = new CardView.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent); layout_card_par.SetMargins(30, 30, 30, 30); LinearLayout layout_card = new LinearLayout(this) { Orientation = Android.Widget.Orientation.Vertical, LayoutParameters = layout_card_par }; CardView.LayoutParams card_par = new CardView.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent); card_par.SetMargins(50, 0, 60, 60); CardView card = new CardView(this) { LayoutParameters = card_par }; card.SetCardBackgroundColor(Android.Graphics.Color.Black); var perk_name = new TextView(this) { Text = perks[c_p].Info[0][0].ToString() }; perk_name.SetTextColor(Android.Graphics.Color.LimeGreen); perk_name.SetTextSize(ComplexUnitType.Px, 100); var perk_description = new TextView(this) { Text = perks[c_p].Info[1][0].ToString() }; perk_description.SetTextColor(Android.Graphics.Color.LimeGreen); LinearLayout.LayoutParams par_layout_buttons = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent) { Gravity = GravityFlags.Right }; LinearLayout layout_buttons = new LinearLayout(this) { Orientation = Android.Widget.Orientation.Horizontal, LayoutParameters = par_layout_buttons }; var button1 = new ImageButton(this) { ContentDescription = perks[c_p].Data[1].ToString() + c_p.ToString() }; button1.SetImageResource(Resource.Drawable.arrow_left); button1.SetBackgroundColor(Android.Graphics.Color.LimeGreen); var button2 = new ImageButton(this) { ContentDescription = perks[c_p].Data[1].ToString() + c_p.ToString() }; button2.SetImageResource(Resource.Drawable.arrow_right); button2.SetBackgroundColor(Android.Graphics.Color.LimeGreen); var editText1 = new EditText(this) { Text = perks[c_p].Data[1].ToString() }; editText1.SetTextColor(Android.Graphics.Color.LimeGreen); var layoutParams = FindViewById <LinearLayout>(Resource.Id.add_layout_perks); layout_card.AddView(perk_name); layout_card.AddView(perk_description); layout_buttons.AddView(button1); layout_buttons.AddView(editText1); layout_buttons.AddView(button2); layout_card.AddView(layout_buttons); card.AddView(layout_card); layoutParams.AddView(card); var maxCardLevel = perks[c_p].Data[2]; var description = ""; foreach (int desc in perks[c_p].Info[1].ToString()) { description += desc; } button1.Click += (o, e) => { //count name and description var count = Int32.Parse(button1.ContentDescription[0].ToString()); var current = Int32.Parse(button1.ContentDescription[1].ToString()); if (1 <= Int32.Parse(editText1.Text)) { editText1.Text = (Int32.Parse(editText1.Text) - 1).ToString(); count -= 1; try { perk_name.Text = perks[current].Info[0][count].ToString(); perk_description.Text = perks[current].Info[1][count].ToString(); perks[current].assignedLevel -= 1; } catch { perk_name.Text = perks[current].Info[0][0].ToString(); perk_description.Text = perks[current].Info[1][count].ToString(); perks[current].assignedLevel -= 1; } button1.ContentDescription = count.ToString() + current.ToString(); } }; button2.Click += (o, e) => { //count name and description var count = Int32.Parse(button1.ContentDescription[0].ToString()); var current = Int32.Parse(button1.ContentDescription[1].ToString()); if (Int32.Parse(editText1.Text) <= maxCardLevel - 1) { editText1.Text = (Int32.Parse(editText1.Text) + 1).ToString(); try { perk_name.Text = perks[current].Info[0][count].ToString(); perk_description.Text = perks[current].Info[1][count].ToString(); perks[current].assignedLevel += 1; } catch { perk_name.Text = perks[current].Info[0][0].ToString(); perk_description.Text = perks[current].Info[1][count].ToString(); perks[current].assignedLevel += 1; } count += 1; button1.ContentDescription = count.ToString() + current.ToString(); } }; c_p += 1; } } videoView = FindViewById <VideoView>(Resource.Id.videoView1); var uri = Android.Net.Uri.Parse("android.resource://" + PackageName + "/" + Resource.Raw.fallout_76_video); videoView.SetVideoURI(uri); videoView.Visibility = ViewStates.Visible; MediaController media_controller = new Android.Widget.MediaController(this); //videoView.SetOnPreparedListener(new VideoLoop()); media_controller.SetMediaPlayer(videoView); videoView.SetMediaController(media_controller); videoView.RequestFocus(); var play_button = FindViewById <Button>(Resource.Id.play_button); var pause_button = FindViewById <Button>(Resource.Id.pause_button); var mute_button = FindViewById <Button>(Resource.Id.mute_button); var volume_seekBar = FindViewById <SeekBar>(Resource.Id.seek_bar); MediaPlayer player = MediaPlayer.Create(this, Resource.Raw.fallout_76_music); play_button.Click += (o, e) => { player.Start(); }; pause_button.Click += (o, e) => { player.Pause(); }; mute_button.Click += (o, e) => { player.SetVolume(0f, 0f); }; volume_seekBar.ProgressChanged += (o, e) => { float vol = (float)(Math.Log(volume_seekBar.Progress) / Math.Log(50)); player.SetVolume(vol, vol); }; var showPopupMenu = FindViewById <Button>(Resource.Id.popupButton); showPopupMenu.Click += (o, e) => { RelativeLayout layout_status = FindViewById <RelativeLayout>(Resource.Id.content_status); RelativeLayout layout_splash = FindViewById <RelativeLayout>(Resource.Id.content_splash); RelativeLayout layout_navigation = FindViewById <RelativeLayout>(Resource.Id.content_main); layout_splash.Visibility = ViewStates.Gone; layout_status.Visibility = ViewStates.Visible; layout_navigation.Visibility = ViewStates.Visible; }; /*var image_splash = FindViewById<ImageView>(Resource.Id.splash_image); * var Image = FindViewById<Image>(Resource.Raw.Fallout_76); * image_splash(Image);*/ Update_status(); }