IMediaPlayerExtension.cs 4.2 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#nullable enable

using System;
using Windows.Media.Core;
using Windows.Storage;
using Windows.Foundation;
using Windows.Storage.Streams;
using Windows.Media.Playback;

namespace Uno.Media.Playback
{
	/// <summary>
	/// Extension definition for the <see cref="MediaPlayer"/> class
	/// </summary>
	public interface IMediaPlayerExtension : IDisposable
	{
		/// <summary>
		/// Provides access to the ability to raise MediaPlayer events
		/// </summary>
20
		IMediaPlayerEventsExtension? Events { get; set; }
21 22 23 24 25 26 27 28 29 30 31

		/// <summary>
		/// Gets or sets the playback rate
		/// </summary>
		double PlaybackRate { get; set; }

		/// <summary>
		/// Gets or sets the looping mode
		/// </summary>
		bool IsLoopingEnabled { get; set; }

32 33 34 35 36
		/// <summary>
		/// Gets or sets the looping all mode
		/// </summary>
		bool IsLoopingAllEnabled { get; set; }

37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
		/// <summary>
		/// Gets the current player state
		/// </summary>
		MediaPlayerState CurrentState { get; }

		/// <summary>
		/// Gets the natural duration of the current media
		/// </summary>
		TimeSpan NaturalDuration { get; }

		/// <summary>
		/// Gets the protected state of the current media
		/// </summary>
		bool IsProtected { get; }

		/// <summary>
		/// Gets the buffering progress state of the current media
		/// </summary>
		double BufferingProgress { get; }

		/// <summary>
		/// Determines if the current media can be paused
		/// </summary>
		bool CanPause { get; }

		/// <summary>
		/// Determines if the current media can be seeked
		/// </summary>
		bool CanSeek { get; }

		/// <summary>
		/// Gets the audio device type
		/// </summary>
		MediaPlayerAudioDeviceType AudioDeviceType { get; set; }

		/// <summary>
		/// Gets the audio category
		/// </summary>
		MediaPlayerAudioCategory AudioCategory { get; set; }

		/// <summary>
		///	Gets position offset
		/// </summary>
		TimeSpan TimelineControllerPositionOffset { get; set; }

		/// <summary>
		/// Determines if the current media is playing in real time
		/// </summary>
		bool RealTimePlayback { get; set; }

		/// <summary>
		/// Gets or sets the audio balance
		/// </summary>
		double AudioBalance { get; set; }

		/// <summary>
		/// Gets or sets the current position in the media
		/// </summary>
		TimeSpan Position { get; set; }

97 98 99 100 101
		/// <summary>
		/// Determines if the current media content is video
		/// </summary>
		bool? IsVideo { get; }

102 103 104 105 106
		/// <summary>
		/// Sets the transport controls bounds so that video can be displayed around controls
		/// </summary>
		void SetTransportControlsBounds(Rect bounds);

107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175
		/// <summary>
		/// Sets the source from a Uri
		/// </summary>
		void SetUriSource(Uri value);

		/// <summary>
		/// Sets the source from a storage file
		/// </summary>
		void SetFileSource(IStorageFile file);

		/// <summary>
		/// Sets the source from a stream
		/// </summary>
		void SetStreamSource(IRandomAccessStream stream);

		/// <summary>
		/// Sets the source from a media source
		/// </summary>
		void SetMediaSource(IMediaSource source);

		/// <summary>
		/// Steps the media forward one frame
		/// </summary>
		void StepForwardOneFrame();

		/// <summary>
		/// Steps the media backward one frame
		/// </summary>
		void StepBackwardOneFrame();

		/// <summary>
		/// Sets the surface size
		/// </summary>
		void SetSurfaceSize(Size size);

		/// <summary>
		/// Plays the current media
		/// </summary>
		void Play();

		/// <summary>
		/// Pauses the current media
		/// </summary>
		void Pause();

		/// <summary>
		/// Stops the current media
		/// </summary>
		void Stop();

		/// <summary>
		/// Initialize the source
		/// </summary>
		void InitializeSource();

		/// <summary>
		/// Toggles the mute state
		/// </summary>
		void ToggleMute();

		/// <summary>
		/// Notifies the extension that the volume has changed
		/// </summary>
		void OnVolumeChanged();

		/// <summary>
		/// Initializes the extension
		/// </summary>
		void Initialize();
176 177 178 179 180

		/// <summary>
		/// Notifies the extension that an option has changed
		/// </summary>
		void OnOptionChanged(string name, object value);
181 182 183 184 185 186 187 188 189 190

		/// <summary>
		/// Previous Track on a Playlist
		/// </summary>
		void PreviousTrack();

		/// <summary>
		/// Next Track on a Playlist
		/// </summary>
		void NextTrack();
191 192
	}
}