示例#1
0
        void Attach()
        {
            _awindow = new AWindow(new SurfaceCallback(_mediaPlayer));
            _awindow.AddCallback(this);
            _awindow.SetVideoView(this);
            _awindow.AttachViews();

            _mediaPlayer.SetAndroidContext(_awindow.Handle);

            _layoutListener = new LayoutChangeListener(_awindow);
            AddOnLayoutChangeListener(_layoutListener);
        }
示例#2
0
        void Detach()
        {
            _awindow.RemoveCallback(this);
            _awindow.DetachViews();

            _mediaPlayer.SetAndroidContext(IntPtr.Zero);

            RemoveOnLayoutChangeListener(_layoutListener);
            _layoutListener.Dispose();
            _layoutListener = null;

            _awindow.Dispose();
            _awindow = null;
        }