예제 #1
0
        protected static void CompletePlayOrEnqueue(IPlayerContext pc, bool play)
        {
            IPlayerContextManager pcm      = ServiceRegistration.Get <IPlayerContextManager>();
            MediaModelSettings    settings = ServiceRegistration.Get <ISettingsManager>().Load <MediaModelSettings>();

            pc.CloseWhenFinished = settings.ClosePlayerWhenFinished; // Has to be done before starting the media item, else the slot will not close in case of an error / when the media item cannot be played
            if (play)
            {
                pc.Play();
                if (pc.AVType == AVType.Video)
                {
                    pcm.ShowFullscreenContent(true);
                }
            }
        }
예제 #2
0
        protected static Task CompletePlayOrEnqueue(IPlayerContext pc, bool play, IResumeState resumeState = null)
        {
            IPlayerContextManager pcm      = ServiceRegistration.Get <IPlayerContextManager>();
            MediaModelSettings    settings = ServiceRegistration.Get <ISettingsManager>().Load <MediaModelSettings>();

            pc.CloseWhenFinished = settings.ClosePlayerWhenFinished; // Has to be done before starting the media item, else the slot will not close in case of an error / when the media item cannot be played
            if (play)
            {
                if (resumeState != null)
                {
                    pc.SetContextVariable(PlayerContext.KEY_RESUME_STATE, resumeState);
                }
                pc.Play();
                if (pc.AVType == AVType.Video || pc.AVType == AVType.Audio)
                {
                    pcm.ShowFullscreenContent(true);
                }
            }
            return(Task.CompletedTask);
        }