Skip to content

How to play custom stream #348

Closed Answered by fatihbahceci
fatihbahceci asked this question in Q&A
Discussion options

You must be logged in to vote

Hello, first of all, thank you very much for your response. Based on your answer, I prepared a class as below. This class stores the incoming data and forwards it to the player.

using System.Collections.Concurrent;
using System.Diagnostics;

namespace OnTheFlyTest.Core.Winform.Common
{

    internal class FBCStream : Stream
    {
        private ConcurrentQueue<byte[]> data = new ConcurrentQueue<byte[]>();
        private byte[]? remainingData = null;
        private int remainingDataOffset = 0;
        public event EventHandler<string>? OnTrace;

        protected void trace(string s, params object[] prms)
        {
            if (OnTrace != null)
            {
                //try { s…

Replies: 4 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@airtaxi
Comment options

Answer selected by fatihbahceci
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants