Example #1
0
        protected static void 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)
                {
                    pcm.ShowFullscreenContent(true);
                }
            }
        }
Example #2
0
 protected static void 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)
       pcm.ShowFullscreenContent(true);
   }
 }