Skip to content

After making media element static, the binding in the xaml to the media element seems to not do anything anymore when navigating to the other page, but still works on the first page and whenever i go back to it, the audio works fine all over its just the UI...anyone any thoughts of what im missing? #13141

Answered by jedusei
Mashedpoturtles asked this question in Q&A
Discussion options

You must be logged in to vote

In the constructor of the story page, the media element is set to the static one to keep both pages using the same player:
mediaElement = AudioPlayerService.SharedMediaElement;

Here's the problem. Both pages aren't using the same player. That line of code only assigns the shared media element to mediaElement; it doesn't actually replace the story page's media element. The slider and labels on the story page are still bound to the media element on that page, not the shared media element. That's why the labels and slider aren't updating—the story page media element isn't playing.

Here's some quick steps you can follow to make this work:

  • Add a SharedMediaElement property to the story pag…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@Mashedpoturtles
Comment options

@jedusei
Comment options

@Mashedpoturtles
Comment options

Answer selected by Mashedpoturtles
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants