[DllImport(Libraries.Player, EntryPoint = "player_get_track_language_code")]
internal static extern PlayerErrorCode GetTrackLanguageCode(IntPtr player, StreamType type,
int index, out IntPtr code);
+
+ [DllImport(Libraries.Player, EntryPoint = "player_set_audio_only")]
+ internal static extern PlayerErrorCode SetAudioOnly(IntPtr player, bool audioOnly);
+
+ [DllImport(Libraries.Player, EntryPoint = "player_is_audio_only")]
+ internal static extern PlayerErrorCode IsAudioOnly(IntPtr player, out bool audioOnly);
}
internal class PlayerHandle : SafeHandle
ThrowIfFailed(this, "Failed to set the volume of the player");
}
}
+
+ /// <summary>
+ /// Gets or sets the audio-only state.
+ /// </summary>
+ /// <value>true if the playback is audio-only mode; otherwise, false. The default value is false.</value>
+ /// The <see cref="Player"/> must be in the <see cref="PlayerState.Ready"/>,
+ /// <see cref="PlayerState.Playing"/>, or <see cref="PlayerState.Paused"/> state.
+ /// <exception cref="InvalidOperationException">The player is not in the valid state.</exception>
+ /// <exception cref="ObjectDisposedException">The player has already been disposed of.</exception>
+ /// <since_tizen> 5 </since_tizen>
+ public bool IsAudioOnly
+ {
+ get
+ {
+ ValidatePlayerState(PlayerState.Ready, PlayerState.Playing, PlayerState.Paused);
+ NativePlayer.IsAudioOnly(Handle, out var value).
+ ThrowIfFailed(this, "Failed to get the audio-only state of the player");
+ return value;
+ }
+ set
+ {
+ ValidateNotDisposed();
+ ValidatePlayerState(PlayerState.Ready, PlayerState.Playing, PlayerState.Paused);
+ NativePlayer.SetAudioOnly(Handle, value).
+ ThrowIfFailed(this, "Failed to set the audio-only state of the player");
+ }
+ }
}
}