Skip to content

Commit 281928f

Browse files
authored
Update mediaplayercontrol.md
1 parent 426d17e commit 281928f

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

accelerate/components/media-player/mediaplayercontrol.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,32 +78,33 @@ interface for media playback.
7878
### Basic Usage
7979

8080
```xaml
81-
<MediaPlayerControl Name="mediaPlayer" Source="{Binding MediaSource}"
81+
<MediaPlayerControl Name="mediaPlayerControl" Source="{Binding MediaSource}"
8282
Volume="0.8"
8383
LoadedBehavior="AutoPlay" />
8484
```
8585

8686
### Binding to Commands
8787

8888
```xaml
89-
<Button Command="{Binding #mediaPlayer.PlayPauseCommand}"
89+
<Button Command="{Binding #mediaPlayerControl.PlayPauseCommand}"
9090
Content="Play/Pause" />
9191

92-
<Button Command="{Binding #mediaPlayer.StopCommand}"
92+
<Button Command="{Binding #mediaPlayerControl.StopCommand}"
9393
Content="Stop" />
9494
```
9595

9696
### Error Handling
9797

9898
```csharp
99-
mediaPlayer.ErrorOccurred += (sender, args) =>
99+
mediaPlayerControl.ErrorOccurred += (sender, args) =>
100100
{
101101
Console.WriteLine($"Media error: {args.Message}");
102102
args.Handled = true; // Prevents the exception from being thrown.
103103
};
104104
```
105105

106-
**Note**: This callback gives you the opportunity to reset the state of the `MediaPlayer` gracefully.
106+
**Note**: This callback gives you the opportunity to reset the state of the `MediaPlayerControl` gracefully.
107+
107108

108109
## Template Parts and Customization
109110

@@ -195,7 +196,7 @@ flowchart LR
195196
class Init,Setup,Cleanup phase
196197
```
197198

198-
Here's a more comprehensive graph of `MediaPlayerControl`'s interactions with `MediaPlayer` over the course of its
199+
Here's a more comprehensive graph of `MediaPlayerControl`'s interactions with its internal `MediaPlayer` over the course of its
199200
lifetime:
200201

201202
```mermaid
@@ -251,7 +252,7 @@ flowchart LR
251252
- Set the `Handled` property to true on the `ErrorOccurred` event handler if you've managed the error.
252253

253254
2. **Resource Management**:
254-
- The control manages the `MediaPlayer` lifecycle automatically.
255+
- The control manages the `MediaPlayerControl` lifecycle automatically.
255256

256257
3. **UI Integration**:
257258
- Use the built-in commands for integrating with custom buttons/controls.
@@ -260,4 +261,4 @@ flowchart LR
260261
## Related Components
261262

262263
- [MediaPlayer](mediaplayer.md)
263-
- [MediaSource](mediasource.md)
264+
- [MediaSource](mediasource.md)

0 commit comments

Comments
 (0)