Пример #1
0
        public async Task DoStreaming(int roomId, bool ismusic)
        {
            var s = RoomFFmpeg[roomId];

            if (s.IsStreaming)
            {
                return;
            }
            s.IsStreaming = true;
            while (true)
            {
                StreamingInfo info = DeQue(roomId);
                if (info == null)
                {
                    s.IsStreaming = false;
                    await httpclient.PostAsync(@$ "streaming/streaminginfo/{roomId}", null);

                    return;
                }
                s.Info = info;
                await httpclient.PostAsync(@$ "streaming/{roomId}", null);

                await httpclient.PostAsync(@$ "streaming/streaminginfo/{roomId}", null);

                if (ismusic)
                {
                    await s.DoStreaming("musicstreaming");
                }
                else
                {
                    await s.DoStreaming("videostreaming");
                }
                await Task.Delay(10);
            }
        }
Пример #2
0
 public async Task EnQue(int roomID, StreamingInfo info, bool isMusic)
 {
     StreamingQue[roomID].Enqueue(info);
     DoStreaming(roomID, isMusic);
 }