[MediaPlayer] add missing error code (#1781)
authornam <36914158+aferin@users.noreply.github.com>
Thu, 9 Jul 2020 03:42:33 +0000 (12:42 +0900)
committerGitHub <noreply@github.com>
Thu, 9 Jul 2020 03:42:33 +0000 (12:42 +0900)
* [MediaPlayer] add missing error code

* add exception method

* add other missing descriptions and change version

* remove typo

* fix wrong description

* Update src/Tizen.Multimedia.MediaPlayer/Player/Player.cs

Co-authored-by: Marcin Macias <40991900+m-macias@users.noreply.github.com>
Co-authored-by: Marcin Macias <40991900+m-macias@users.noreply.github.com>
src/Tizen.Multimedia.MediaPlayer/Player/Player.cs
src/Tizen.Multimedia.MediaPlayer/Player/PlayerError.cs

index 331962c..71433a5 100644 (file)
@@ -548,6 +548,8 @@ namespace Tizen.Multimedia
         ///     -or-<br/>
         ///     It is not able to assign the source to the player.
         ///     </exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when the permission is denied.</exception>
+        /// <exception cref="NotSupportedFormatException">The format is not supported. (Since tizen 6.0, C# API8)</exception>
         /// <seealso cref="PrepareAsync()"/>
         /// <seealso cref="PrepareAsync(CancellationToken)"/>
         /// <since_tizen> 3 </since_tizen>
index 996a8b0..15c4499 100644 (file)
@@ -49,6 +49,7 @@ namespace Tizen.Multimedia
         NotSupportedAudioCodec = PlayerErrorClass | 0x0e,
         NotSupportedVideoCodec = PlayerErrorClass | 0x0f,
         NotSupportedSubtitle = PlayerErrorClass | 0x10,
+        NotSupportedFormat = PlayerErrorClass | 0x11,
         NotAvailable = PlayerErrorClass | 0x12
     }
 
@@ -131,6 +132,9 @@ namespace Tizen.Multimedia
                 case PlayerErrorCode.NotSupportedVideoCodec:
                     throw new CodecNotSupportedException(CodecKind.Video);
 
+                case PlayerErrorCode.NotSupportedFormat:
+                    throw new NotSupportedFormatException(msg);
+
                 case PlayerErrorCode.NotAvailable:
                     throw new NotAvailableException(msg);
             }
@@ -172,7 +176,7 @@ namespace Tizen.Multimedia
     }
 
     /// <summary>
-    /// The exception that is thrown when there it is not available.
+    /// The exception that is thrown when it is not available.
     /// </summary>
     /// <since_tizen> 6 </since_tizen>
     public class NotAvailableException : Exception
@@ -186,5 +190,21 @@ namespace Tizen.Multimedia
         {
         }
     }
+
+    /// <summary>
+    /// The exception that is thrown when it is not supported format.
+    /// </summary>
+    /// <since_tizen> 8 </since_tizen>
+    public class NotSupportedFormatException : Exception
+    {
+        /// <summary>
+        /// Initializes a new instance of the NotSupportedFormatException class with a specified error message.
+        /// </summary>
+        /// <param name="message">Error description.</param>
+        /// <since_tizen> 8 </since_tizen>
+        public NotSupportedFormatException(string message) : base(message)
+        {
+        }
+    }
 }