Playing works when ran with mono debug
This commit is contained in:
@ -4,7 +4,6 @@ using System.Collections.ObjectModel;
|
||||
using System.IO;
|
||||
using Aurora.Backend.Models;
|
||||
using Aurora.Backend.Utils;
|
||||
using NAudio.Wave;
|
||||
|
||||
namespace Aurora.Backend.Services
|
||||
{
|
||||
|
34
Aurora/Backend/Services/PlayerService.cs
Normal file
34
Aurora/Backend/Services/PlayerService.cs
Normal file
@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using Aurora.Backend.Models;
|
||||
using LibVLCSharp.Shared;
|
||||
|
||||
namespace Aurora.Backend.Services
|
||||
{
|
||||
public class PlayerService : BaseService<PlayerService>
|
||||
{
|
||||
public PlayerService()
|
||||
{
|
||||
}
|
||||
|
||||
public void Play(BaseSong song)
|
||||
{
|
||||
Core.Initialize();
|
||||
using (var libVLC = new LibVLC())
|
||||
{
|
||||
song.Load();
|
||||
var media = new Media(libVLC, song.DataStream);
|
||||
using (var mp = new MediaPlayer(media))
|
||||
{
|
||||
media.Dispose();
|
||||
mp.Play();
|
||||
Console.ReadKey();
|
||||
}
|
||||
|
||||
song.Unload();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user