2016-09-02 106 views

回答

0
var folder = await StorageFolder.GetFolderFromPathAsync("ms-appx:///Assets/Media"); 
if(folder != null) 
{ 
    var file = await folder.GetFileAsync("backgroundtrack.mp3"); 
    if(file != null) 
    { 
     var stream = await file.OpenReadAsync(); 
     mediaElement.SetSource(stream, file.ContentType); 
     player.Volume = 100; 
     player.Play(); 
    } 
} 
相關問題