コード例 #1
0
        public static string GetErrorMessage(AVErrorCode code)
        {
            string result = string.Empty;

            switch (code)
            {
            case AVErrorCode.None:
                result = "No Error";
                break;

            case AVErrorCode.LoadFailed:
                result = "Loading failed.  File not found, codec not supported, video resolution too high or insufficient system resources.";
#if UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN
                // Add extra information for older Windows versions that don't have support for modern codecs
                if (SystemInfo.operatingSystem.StartsWith("Windows XP") ||
                    SystemInfo.operatingSystem.StartsWith("Windows Vista"))
                {
                    result += " NOTE: Windows XP and Vista don't have native support for H.264 codec.  Consider using an older codec such as DivX or installing 3rd party codecs such as LAV Filters.";
                }
#endif
                break;

            case AVErrorCode.DecodeFailed:
                result = "Decode failed.  Possible codec not supported, video resolution/bit-depth too high, or insufficient system resources.";
#if UNITY_ANDROID
                result += " On Android this is generally due to the hardware not having enough resources to decode the video. Most Android devices can only handle a maximum of one 4K video at once.";
#endif
                break;
            }
            return(result);
        }
コード例 #2
0
ファイル: MediaPlayer.cs プロジェクト: wangjie0707/Temp_01
 private void UpdateErrors()
 {
     AVErrorCode errorCode = m_Control.GetLastError();
     if (AVErrorCode.None != errorCode)
     {
         Debug.LogError("[AVProVideo] Error: " + DBD.Moudle.AVPro.Helper.GetErrorMessage(errorCode));
     }
 }
コード例 #3
0
 public void OnMediaPlayerEvent(MediaPlayer mp, MediaPlayerEvent.EventType et, AVErrorCode errorCode)
 {
     switch (et)
     {
     case MediaPlayerEvent.EventType.FinishedPlaying:
         FinishedPlaying?.Invoke(this);
         break;
     }
 }