Esempio n. 1
0
        protected override void OnPause()
        {
            base.OnPause();

            _videoView.MediaPlayer.Stop();
            _videoView.Dispose();
        }
Esempio n. 2
0
        protected override void OnDestroy()
        {
            base.OnDestroy();

            StopVideoPlayer();

            if (mediaPlayer != null)
            {
                mediaPlayer.SetDisplay(null);
                mediaPlayer.Release();
                mediaPlayer.Dispose();
                mediaPlayer = null;
            }

            if (holder != null)
            {
                holder.Dispose();
                holder = null;
            }

            if (videoView != null)
            {
                videoView.Holder.Dispose();
                videoView.DestroyDrawingCache();
                videoView.Dispose();
                videoView = null;
            }

            CActivityManager.GetInstence().FinishSingleActivity(this);
            Settings.semVideoCompleted.Release();
        }
Esempio n. 3
0
        protected override void OnPause()
        {
            base.OnPause();

            _videoView.Dispose();
            _mediaPlayer.Dispose();
            _libVLC.Dispose();
        }
Esempio n. 4
0
        public static void Main(string[] args)
        {
            Core.Initialize();

            Application.Init();
            using (var libvlc = new LibVLC())
            {
                MainWindow win = new MainWindow();
                win.Fullscreen();

                var  size = win.GetDisplaySize();
                HBox hbox = new HBox();
                hbox.HeightRequest = size.Height;
                // Creates the video view, and adds it to the window
                var       mp        = new MediaPlayer(libvlc);
                VideoView videoView = new VideoView {
                    MediaPlayer = mp
                };
                hbox.PackStart(videoView);
                hbox.Children[0].WidthRequest  = (int)(size.Width * 0.8);
                hbox.Children[0].HeightRequest = size.Height;

                win.Add(hbox);

                win.ShowAll();

                string basePath = Environment.CurrentDirectory + "/../../Media/";
                var    playList = new List <string>()
                {
                    basePath + "SampleVideo_1280x720_1mb.mp4",
                    basePath + "SampleVideo_1280x720_2mb.mp4"
                };

                MediaList mediList = new MediaList(libvlc);
                foreach (var movie in playList)
                {
                    var media = new Media(libvlc, movie, FromType.FromPath);
                    mediList.AddMedia(media);
                }

                var mlp = new MediaListPlayer(libvlc);

                mlp.SetMediaList(mediList);
                mlp.SetMediaPlayer(mp);
                mlp.Play();

                win.DeleteEvent += (sender, a) =>
                {
                    mp.Stop();
                    videoView.Dispose();
                    Application.Quit();
                    a.RetVal = true;
                };

                Application.Run();
            }
        }
Esempio n. 5
0
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                Stop();
                _videoView.Dispose();
            }

            base.Dispose(disposing);
        }
        protected override void Dispose(bool disposing)
        {
            if (Control != null && videoView != null)
            {
                videoView.Prepared -= OnVideoViewPrepared;
            }
            if (Element != null)
            {
                Element.UpdateStatus -= OnUpdateStatus;
            }

            mediaController?.Dispose();
            videoView?.Dispose();

            base.Dispose(disposing);
        }
Esempio n. 7
0
        public void Deactivate()
        {
            win.KeyEvent -= Win_KeyEvent;

            if (camera != null)
            {
                if (camera.State == Tizen.Multimedia.CameraState.Preview)
                {
                    camera.StopPreview();
                }

                camera.Dispose();
            }

            videoView.Dispose();

            tlog.Fatal(tag, $"Deactivate()! cameraView dispsed");
        }
Esempio n. 8
0
        /// <summary>
        /// Closes this instance.
        /// </summary>
        public void Dispose()
        {
            _videoView?.Dispose();
            if (_mediaPlayer != null)
            {
                _mediaPlayer.EndReached       -= VlcOnEndReached;
                _mediaPlayer.EncounteredError -= OnEncounteredError;
                _mediaPlayer.Dispose();
            }
            _libVlc?.Dispose();

            if (_formHost == null)
            {
                return;
            }
            _formHost.Child = null;
            _formHost.Dispose();
        }
        protected virtual void Dispose(bool disposing)
        {
            if (!disposedValue)
            {
                if (disposing)
                {
                    // TODO: dispose managed state (managed objects)
                    mpegTSSettingsDialog?.Dispose();
                    mpegTSSettingsDialog = null;

                    mp4SettingsDialog?.Dispose();
                    mp4SettingsDialog = null;

                    mp4HWSettingsDialog?.Dispose();
                    mp4HWSettingsDialog = null;

                    movSettingsDialog?.Dispose();
                    movSettingsDialog = null;

                    gifSettingsDialog?.Dispose();
                    gifSettingsDialog = null;

                    aviSettingsDialog?.Dispose();
                    aviSettingsDialog = null;

                    wmvSettingsDialog?.Dispose();
                    wmvSettingsDialog = null;

                    tmRecording?.Dispose();
                    tmRecording = null;

                    VideoCapture1?.Dispose();
                    VideoCapture1 = null;

                    VideoView1?.Dispose();
                    VideoView1 = null;
                }

                // TODO: free unmanaged resources (unmanaged objects) and override finalizer
                // TODO: set large fields to null
                disposedValue = true;
            }
        }
Esempio n. 10
0
        public static void Main()
        {
            Core.Initialize();

            // Initializes the GTK# app
            Application.Init();

            using var libvlc      = new LibVLC();
            using var mediaPlayer = new MediaPlayer(libvlc);

            // Create the window in code. This could be done in glade as well, I guess...
            var myWin = new Window("LibVLCSharp.GTK.Sample");

            myWin.Resize(800, 450);

            // Creates the video view, and adds it to the window
            var videoView = new VideoView {
                MediaPlayer = mediaPlayer
            };

            myWin.Add(videoView);

            //Show Everything
            myWin.ShowAll();

            //Starts playing
            using var media = new Media(libvlc,
                                        "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4",
                                        FromType.FromLocation);

            mediaPlayer.Play(media);

            myWin.DeleteEvent += (sender, args) =>
            {
                mediaPlayer.Stop();
                videoView.Dispose();
                Application.Quit();
            };

            Application.Run();
        }
        protected virtual void Dispose(bool disposing)
        {
            if (!disposedValue)
            {
                if (disposing)
                {
                    // TODO: dispose managed state (managed objects)
                }

                _tmPosition?.Dispose();
                _tmPosition = null;

                VideoView1?.Dispose();
                VideoView1 = null;

                _player?.Dispose();
                _player = null;

                disposedValue = true;
            }
        }
Esempio n. 12
0
        public static void Main()
        {
            Core.Initialize();

            // Initializes the GTK# app
            Application.Init();

            using (var libvlc = new LibVLC())
                using (var mediaPlayer = new MediaPlayer(libvlc))
                {
                    // Create the window in code. This could be done in glade as well, I guess...
                    Window myWin = new Window("LibVLCSharp.GTK.Sample");
                    myWin.Resize(800, 450);

                    // Creates the video view, and adds it to the window
                    VideoView videoView = new VideoView {
                        MediaPlayer = mediaPlayer
                    };
                    myWin.Add(videoView);

                    //Show Everything
                    myWin.ShowAll();

                    //Starts playing
                    using (var media = new Media(libvlc,
                                                 "http://www.quirksmode.org/html5/videos/big_buck_bunny.mp4",
                                                 FromType.FromLocation))
                    {
                        mediaPlayer.Play(media);
                    }

                    myWin.DeleteEvent += (sender, args) =>
                    {
                        mediaPlayer.Stop();
                        videoView.Dispose();
                        Application.Quit();
                    };
                    Application.Run();
                }
        }
Esempio n. 13
0
 protected override void OnClosed(EventArgs e)
 {
     VideoView.Dispose();
 }
Esempio n. 14
0
 public void CloseVideoView()
 {
     _videoView.Dispose();
 }
Esempio n. 15
0
 public void Dispose()
 {
     mediaPlayer.Dispose();
     videoView.Dispose();
 }
Esempio n. 16
0
 private void Window1_OnClosed(object sender, EventArgs e)
 {
     _libVlc.Dispose();
     VideoView.Dispose();
     VideoView.MediaPlayer.Dispose();
 }