Example #1
0
        /// <summary>
        /// Gets the duration.
        /// </summary>
        /// <returns>The duration of the stream.</returns>
        /// <remarks>
        /// The <see cref="Multimedia.Player"/> that owns this instance must be in the <see cref="PlayerState.Ready"/>,
        /// <see cref="PlayerState.Playing"/>, or <see cref="PlayerState.Paused"/> state.
        /// </remarks>
        /// <exception cref="ObjectDisposedException">
        /// The <see cref="Multimedia.Player"/> that this instance belongs to has been disposed of.
        /// </exception>
        /// <exception cref="InvalidOperationException">
        /// The <see cref="Multimedia.Player"/> that this instance belongs to is not in the valid state.
        /// </exception>
        /// <since_tizen> 3 </since_tizen>
        public int GetDuration()
        {
            Player.ValidatePlayerState(PlayerState.Ready, PlayerState.Playing, PlayerState.Paused);

            NativePlayer.GetDuration(Player.Handle, out var duration).
            ThrowIfFailed(Player, "Failed to get the duration");

            Log.Info(PlayerLog.Tag, "get duration : " + duration);
            return(duration);
        }