Example #1
0
        /// <summary>
        /// 进入影院模式
        /// </summary>
        /// <param name="isCinema">是否为影院模式</param>
        public void PlayVideoCinema(bool isCinema)
        {
            IPlayerHost hostPage = App._isTabletMode ? TabletMainPage.Current as IPlayerHost : DesktopMainPage.Current as IPlayerHost;
            IPlayerHost host     = App._isTabletMode ? GetCurrentPlayerBlock() : GetCurrentPlayerPage();

            if (isCinema)
            {
                host.RemovePlayer();
                hostPage.InsertPlayer();
            }
            else
            {
                if (!CurrentVideoPlayer.MTC.IsFullWindow)
                {
                    hostPage.RemovePlayer();
                    host.InsertPlayer();
                }
            }
        }
Example #2
0
        /// <summary>
        /// 进入全屏模式
        /// </summary>
        /// <param name="isFull">是否为全屏模式</param>
        public void PlayVideoFullScreen(bool isFull)
        {
            IPlayerHost hostPage = App._isTabletMode ? TabletMainPage.Current as IPlayerHost : DesktopMainPage.Current as IPlayerHost;
            IPlayerHost host     = App._isTabletMode ? GetCurrentPlayerBlock() : GetCurrentPlayerPage();

            if (isFull)
            {
                host.RemovePlayer();
                hostPage.InsertPlayer();
                ApplicationView.GetForCurrentView().TryEnterFullScreenMode();
            }
            else
            {
                ApplicationView.GetForCurrentView().ExitFullScreenMode();
                if (!CurrentVideoPlayer.MTC.IsCinema)
                {
                    hostPage.RemovePlayer();
                    host.InsertPlayer();
                }
            }
        }
Example #3
0
        /// <summary>
        /// 进入小窗模式
        /// </summary>
        /// <param name="isCompact">是否为影院模式</param>
        public async void PlayVideoCompactOverlay(bool isCompact)
        {
            IPlayerHost hostPage = App._isTabletMode ? TabletMainPage.Current as IPlayerHost : DesktopMainPage.Current as IPlayerHost;
            IPlayerHost host     = App._isTabletMode ? GetCurrentPlayerBlock() : GetCurrentPlayerPage();

            if (isCompact)
            {
                host.RemovePlayer();
                hostPage.InsertPlayer();
                await ApplicationView.GetForCurrentView().TryEnterViewModeAsync(ApplicationViewMode.CompactOverlay);
            }
            else
            {
                if (!CurrentVideoPlayer.MTC.IsCompactOverlay)
                {
                    hostPage.RemovePlayer();
                    host.InsertPlayer();
                    CurrentVideoPlayer.DanmakuBarVisibility = Visibility.Visible;
                    await ApplicationView.GetForCurrentView().TryEnterViewModeAsync(ApplicationViewMode.Default);
                }
            }
        }