protected override void OnCreate (Bundle icicle) { base.OnCreate (icicle); if (!LibsChecker.CheckVitamioLibs (this)) return; SetContentView (Resource.Layout.subtitle2); mVideoView = FindViewById<VideoView> (Resource.Id.surface_view); mSubtitleView = FindViewById<TextView> (Resource.Id.subtitle_view); if (path == "") { // Tell the user to provide a media file URL/path. Toast.MakeText (this, "Please edit VideoViewSubtitle 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)); // mVideoView.SetVideoPath (path); // mVideoView.setMediaController(new MediaController(this)); mVideoView.RequestFocus (); mVideoView.Prepared += (object sender, MediaPlayer.PreparedEventArgs e) => { // optional need Vitamio 4.0 e.P0.SetPlaybackSpeed (1.0f); mVideoView.AddTimedTextSource (subtitle_path); mVideoView.SetTimedTextShown (true); }; mVideoView.SetOnTimedTextListener (this); } }
protected override void OnElementChanged(ElementChangedEventArgs <Page> e) { base.OnElementChanged(e); if (e.OldElement != null || this.Element == null) { return; } activity = this.Context as Activity; videoView = new IO.Vov.Vitamio.Widget.VideoView(Forms.Context); videoView.SetVideoPath(UrlCamera.Url); videoView.SetMediaController(new IO.Vov.Vitamio.Widget.MediaController(activity)); videoView.RequestFocus(); var ll = new LinearLayout(Forms.Context); ll.LayoutParameters = new LayoutParams(LayoutParams.MatchParent, LayoutParams.MatchParent); ll.SetPadding(10, 50, 10, 50); videoView.Start(); ll.AddView(videoView); AddView(ll); NativeView = ll; }
protected override void OnCreate(Bundle icicle) { base.OnCreate(icicle); if (!LibsChecker.CheckVitamioLibs(this)) { return; } SetContentView(Resource.Layout.subtitle2); mVideoView = FindViewById <VideoView> (Resource.Id.surface_view); mSubtitleView = FindViewById <TextView> (Resource.Id.subtitle_view); if (path == "") { // Tell the user to provide a media file URL/path. Toast.MakeText(this, "Please edit VideoViewSubtitle 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)); // mVideoView.SetVideoPath(path); // mVideoView.setMediaController(new MediaController(this)); mVideoView.RequestFocus(); mVideoView.Prepared += (object sender, MediaPlayer.PreparedEventArgs e) => { // optional need Vitamio 4.0 e.P0.SetPlaybackSpeed(1.0f); mVideoView.AddTimedTextSource(subtitle_path); mVideoView.SetTimedTextShown(true); }; mVideoView.SetOnTimedTextListener(this); } }