Successfully playing a song in a party with one member
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Aurora.Models.Media;
|
||||
using LibVLCSharp.Shared;
|
||||
|
||||
@ -37,14 +38,14 @@ namespace Aurora.Services.PlayerService
|
||||
/// Load media into the media player.
|
||||
/// </summary>
|
||||
/// <param name="media">Media to load</param>
|
||||
public void LoadMedia(BaseMedia media)
|
||||
public async Task LoadMedia(BaseMedia media)
|
||||
{
|
||||
if (_state == PlaybackState.Playing || _state == PlaybackState.Buffering)
|
||||
{
|
||||
Unload();
|
||||
}
|
||||
_currentMedia = media;
|
||||
_currentMedia.Load();
|
||||
await _currentMedia.Load();
|
||||
var md = new Media(_libvlc, _currentMedia.DataStream);
|
||||
_mediaPlayer = new MediaPlayer(md);
|
||||
_mediaPlayer.Stopped += OnStopped;
|
||||
|
Reference in New Issue
Block a user