Beispiel #1
0
        /// <summary>
        /// Sets the offset for the subtitle.
        /// </summary>
        /// <param name="offset">The value indicating a desired offset in milliseconds.</param>
        /// <remarks>The player must be in the <see cref="PlayerState.Playing"/> or <see cref="PlayerState.Paused"/> state.</remarks>
        /// <exception cref="ObjectDisposedException">The player has already been disposed of.</exception>
        /// <exception cref="InvalidOperationException">
        ///     The player is not in the valid state.<br/>
        ///     -or-<br/>
        ///     No subtitle is set.
        /// </exception>
        /// <seealso cref="SetSubtitle(string)"/>
        /// <since_tizen> 3 </since_tizen>
        public void SetSubtitleOffset(int offset)
        {
            ValidatePlayerState(PlayerState.Playing, PlayerState.Paused);

            var err = NativePlayer.SetSubtitlePositionOffset(Handle, offset);

            if (err == PlayerErrorCode.FeatureNotSupported)
            {
                throw new InvalidOperationException("No subtitle set");
            }

            err.ThrowIfFailed(this, "Failed to the subtitle offset of the player");
        }