2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 using Tizen.Internals.Errors;
19 namespace Tizen.Multimedia
24 /// <seealso cref="Player.ErrorOccurred"/>
25 /// <seealso cref="PlayerErrorOccurredEventArgs"/>
26 public enum PlayerError
29 /// File does not exists.
31 NoSuchFile = ErrorCode.NoSuchFile,
36 InternalError = ErrorCode.InvalidOperation,
41 NoSpaceOnDevice = PlayerErrorCode.NoSpaceOnDevice,
43 //TODO must be removed.
47 FeatureNotSupported = ErrorCode.NotSupported,
49 //TODO must be removed.
51 /// Permission denined.
53 PermissionDenied = ErrorCode.PermissionDenied,
56 /// Not enough buffer.
58 BufferSpace = ErrorCode.BufferSpace,
61 /// <see cref="Player.SetPlayPositionAsync(int, bool)/> failed.
63 SeekFailed = PlayerErrorCode.SeekFailed,
68 InvalidState = PlayerErrorCode.InvalidState,
71 /// Not supported file.
73 NotSupportedFile = PlayerErrorCode.NotSupportedFile,
78 InvalidUri = PlayerErrorCode.InvalidUri,
80 //TODO must be removed.
82 /// Sound policy error.
84 SoundPolicy = PlayerErrorCode.SoundPolicyError,
87 /// Connection to service failed.
89 ConnectionFailed = PlayerErrorCode.ConnectionFailed,
91 // TODO must be removed.
95 VideoCaptureFailed = PlayerErrorCode.VideoCaptureFailed,
97 // TODO must be removed.
101 DrmExpired = PlayerErrorCode.DrmExpired,
103 // TODO must be removed.
105 /// No license of DRM.
107 DrmNoLicense = PlayerErrorCode.DrmNoLicense,
109 // TODO must be removed.
113 DrmFutureUse = PlayerErrorCode.DrmFutureUse,
116 /// Not permitted DRM.
118 DrmNotPermitted = PlayerErrorCode.DrmNotPermitted,
120 // TODO must be removed.
122 /// Not enough resource.
124 ResourceLimit = PlayerErrorCode.ResourceLimit,
127 /// Service disconnected.
129 ServiceDisconnected = PlayerErrorCode.ServiceDisconnected,
132 /// Not supported subtitle file.
134 SubtitleNotSupported = PlayerErrorCode.NotSupportedSubtitle,
138 /// Specifies states that a <see cref="Player"/> can have.
140 public enum PlayerState
143 /// Initial state, unprepared.
145 /// <seealso cref="Player.Unprepare"/>
151 /// <seealso cref="Player.PrepareAsync"/>
157 /// <seealso cref="Player.Start"/>
161 /// Paused while playing media.
163 /// <seealso cref="Player.Pause"/>
167 /// Preparing in progress.
169 /// <seealso cref="Player.PrepareAsync"/>/>
173 internal static class PlayerStateExtensions
175 internal static bool IsAnyOf(this PlayerState thisState, params PlayerState[] states)
177 return Array.IndexOf(states, thisState) != -1;
182 /// Specifies audio latency modes for <see cref="Player"/> .
184 /// <seealso cref="Player.AudioLatencyMode"/>
185 public enum AudioLatencyMode
188 /// Low audio latency mode.
193 /// Middle audio latency mode.
198 /// High audio latency mode.
204 /// Specifies display modes for <see cref="Player"/>
206 /// <seealso cref="Display.Mode"/>
207 public enum PlayerDisplayMode
225 /// Cropped full-screen.
230 /// Origin size (if surface size is larger than video size(width/height)) or
231 /// Letter box (if video size(width/height) is larger than surface size).
236 /// Region of interest, See <see cref="Display.SetRoi(Rectangle)"/>.
241 internal enum StreamType
244 /// Audio element stream type
249 /// Video element stream type
260 /// Specifies the streaming buffer status.
262 /// <seealso cref="MediaStreamConfiguration.BufferStatusChanged"/>
263 /// <seealso cref="MediaStreamBufferStatusChangedEventArgs"/>
264 public enum MediaStreamBufferStatus
278 /// Specifies the reason for the playback interruption.
280 /// <seealso cref="Player.PlaybackInterrupted"/>
281 public enum PlaybackInterruptionReason
284 /// Interrupted by a resource conflict and the <see cref="Player"/> will be unprepared, automatically.
290 /// Specifies keys for the metadata.
292 /// <seealso cref="StreamInfo.GetMetadata(StreamMetadataKey)"/>
293 public enum StreamMetadataKey