示例#1
0
        /* Private members */


        //private void InitializeSocket () {
        //	socket = new Socket();

        //	/* Set the socket background color. If we don't do this, the socket/video
        //	 * area will show a copy of the UI elements (menu, labels, other
        //	 * components) when the video isn't loaded.
        //	 */
        //	RGBA black = new RGBA();
        //	black.Red = 0;
        //	black.Green = 0;
        //	black.Blue = 0;
        //	black.Alpha = 1;
        //	socket.OverrideBackgroundColor(StateFlags.Normal, black);
        //	socket.DoubleBuffered = false;

        //	frame.Child = socket;

        //	socket.Realize();
        //	socket.Show();
        //}

        private void InitializePlaybin()
        {
            playbin = new Playbin();

            if (!playbin.Initiate())
            {
                throw new PlayerCouldNotInitiateEngineException("Unable to initiate the playbin engine");
            }

            Widget videoWidget = playbin.GetVideoWidget();

            if (videoWidget == null)
            {
                throw new PlayerCouldNotInitiateEngineException("Unable to get the video widget from the playbin engine");
            }

            frame.Child = videoWidget;
            videoWidget.Realize();
            videoWidget.Show();

            playbin.Error          += OnPlaybinError;
            playbin.EndOfStream    += OnPlaybinEndOfStream;
            playbin.StateChanged   += OnPlaybinStateChanged;
            playbin.FoundVideoInfo += OnPlaybinFoundVideoInfo;
            playbin.FoundTag       += OnPlaybinFoundTag;
        }
示例#2
0
        private void DisposePlaybin()
        {
            playbin.Error          -= OnPlaybinError;
            playbin.EndOfStream    -= OnPlaybinEndOfStream;
            playbin.StateChanged   -= OnPlaybinStateChanged;
            playbin.FoundVideoInfo -= OnPlaybinFoundVideoInfo;
            playbin.FoundTag       -= OnPlaybinFoundTag;

            Widget videoWidget = playbin.GetVideoWidget();

            frame.Remove(videoWidget);

            playbin.Dispose();
            playbin = null;
        }