Example #1
0
        public bool Play()
        {
            if (isPrepared)
            {
                isPaused = false;
                if (enabled)
                {
                    player.resume();
                }
                return(true);
            }
            var path = FilePath;

            if (FilePathType == WritablePathType.PersistentDataPath)
            {
                path = Application.persistentDataPath + "/" + path;
            }
            isPrepared = player.start(path);
            isPaused   = false;
            if (isPrepared)
            {
                display = new DisplayEmulator();
                display.EmulateRotation(player.initalScreenRotation());
            }
            else
            {
                GUIPopup.EnqueueMessage(typeof(FramePlayer) + " fail to start with file: " + path, 5);
            }
            if (enabled)
            {
                OnEnable();
            }
            return(isPrepared);
        }
Example #2
0
 public void Stop()
 {
     isPrepared = false;
     isPaused   = false;
     display    = null;
     OnDisable();
     if (player != null)
     {
         player.stop();
     }
 }