From a95301196f556c5fc5e10be010e1c28599338958 Mon Sep 17 00:00:00 2001 From: ne0rrmatrix Date: Sun, 21 Jul 2024 00:52:46 -0700 Subject: [PATCH 1/3] Full Screen Events Initial Commit --- docs/maui/views/MediaElement.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/docs/maui/views/MediaElement.md b/docs/maui/views/MediaElement.md index 7b4068ef..feaf633c 100644 --- a/docs/maui/views/MediaElement.md +++ b/docs/maui/views/MediaElement.md @@ -279,6 +279,33 @@ The `Aspect` property determines how video media will be scaled to fit the displ - `AspectFill` indicates that the video will be clipped so that it fills the display area, while preserving the aspect ratio. - `Fill` indicates that the video will be stretched to fill the display area. +## Determine Media Screen status + +The `mediaElement` class defines a read-only bindable property named `FullScreenState` of type `MediaElementScreenState`. This property indicates the current status of the control, such as whether the player is in full screen or default state. + +The `MediaElementScreenState` enumeration defines the following members: +- `FullScreen` indicates the `MediaElement` is in full screen mode. +- `Default` indicates the `MediaElement` is in default mode. + +## Implement Media Screen status controls + +To retrieve the current `MediaElement` screen status, you can use the `FullScreenState` property. The screen status is a read-only property. You cannot enter or exit full screen mode programmatically. To track the change in `MediaElementScreenState`, you can use the `MediaElement.FullScreenStateChanged` event. The Following XAML shows a page that contains a `MediaElement` and an event handler that is invoked when the `MediaElement` enters or exits full screen mode. + +``xaml + +``` + +The code-behind file has the handlers for the `MediaElement` events. + +```csharp +void MediaElement_FullScreenStateChanged(object? sender, FullScreenStateChangedEventArgs e) => + logger.LogInformation("FullScreen State Changed. Old State: {PreviousState}, New State: {NewState}", e.PreviousState, e.NewState); +``` + ## Determine `MediaElement` status The `MediaElement` class defines a read-only bindable property named `CurrentState`, of type `MediaElementState`. This property indicates the current status of the control, such as whether the media is playing or paused, or if it's not yet ready to play the media. @@ -295,6 +322,7 @@ The `MediaElementState` enumeration defines the following members: It's generally not necessary to examine the `CurrentState` property when using the `MediaElement` transport controls. However, this property becomes important when implementing your own transport controls. + ## Implement custom transport controls The transport controls of a media player include the buttons that perform the functions **Play**, **Pause**, and **Stop**. These buttons are generally identified with familiar icons rather than text, and the **Play** and **Pause** functions are generally combined into one button. @@ -466,6 +494,7 @@ To read more about handlers, please see the .NET MAUI documentation on [Handlers | MediaFailed | Occurs when there's an error associated with the media source. | | PositionChanged | Occurs when the `Position` property value has changed. | | SeekCompleted | Occurs when the seek point of a requested seek operation is ready for playback. | +| FullScreenStateChanged | Occurs when entering or exiting full screen mode. | ## Methods From 95f94864f3f5ca48b9a889cfd0f2a6c81e595c30 Mon Sep 17 00:00:00 2001 From: ne0rrmatrix Date: Sun, 21 Jul 2024 01:01:17 -0700 Subject: [PATCH 2/3] fix empty line --- docs/maui/views/MediaElement.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/maui/views/MediaElement.md b/docs/maui/views/MediaElement.md index 164ff5d4..4473938e 100644 --- a/docs/maui/views/MediaElement.md +++ b/docs/maui/views/MediaElement.md @@ -322,7 +322,6 @@ The `MediaElementState` enumeration defines the following members: It's generally not necessary to examine the `CurrentState` property when using the `MediaElement` transport controls. However, this property becomes important when implementing your own transport controls. - ## Implement custom transport controls The transport controls of a media player include the buttons that perform the functions **Play**, **Pause**, and **Stop**. These buttons are generally identified with familiar icons rather than text, and the **Play** and **Pause** functions are generally combined into one button. From 1a6f7ec47490a8f94c236c738a0b645aa1350bf6 Mon Sep 17 00:00:00 2001 From: ne0rrmatrix Date: Sun, 21 Jul 2024 01:04:00 -0700 Subject: [PATCH 3/3] missing character --- docs/maui/views/MediaElement.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/maui/views/MediaElement.md b/docs/maui/views/MediaElement.md index 4473938e..d388ec01 100644 --- a/docs/maui/views/MediaElement.md +++ b/docs/maui/views/MediaElement.md @@ -291,7 +291,7 @@ The `MediaElementScreenState` enumeration defines the following members: To retrieve the current `MediaElement` screen status, you can use the `FullScreenState` property. The screen status is a read-only property. You cannot enter or exit full screen mode programmatically. To track the change in `MediaElementScreenState`, you can use the `MediaElement.FullScreenStateChanged` event. The Following XAML shows a page that contains a `MediaElement` and an event handler that is invoked when the `MediaElement` enters or exits full screen mode. -``xaml +```xaml