简体   繁体   中英

UWP new MediaPlayerElement questions

Actually i am updating my App to Windows 10 version 1607, for using all the new APIs. Before i used a MediaElement for playing audio and video. Now i moved to the new MediaPlayer and MediaPlayerElement. Now i have two questions about them:

  1. Is it no more possible to stop playing media? The "old" MediaElement had a method "Stop()", but this is missing on the MediaPlayerElement and also on the MediaPlayer instance itself.

  2. When i play a video and then change the source of the MediaPlayer to an audio file, i see the video for about 1-2s, until the audio file starts playing. Is it possible to clear the showing video? Set the source to null does not work.

Best Regards

Ok i found it by myself. After Setting my MediaPlayer instance to "null", the Playback is stopping and it disappears also from the SystemMediaTransportControls. This resolves also my second question, there is no more "video-preview" from the last source. After making a new instance of MediaPlayer, i can set a new source.

Best Regards

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM