Exemplo n.º 1
0
        public void Update(Client[] clients)
        {
            if(Video.Tags.Count > tagId && timer.ElapsedMilliseconds >= SendRate)
            {
                timer.Restart();

                for(uint count = 0; tagId < Video.Tags.Count && count < TagsPerMessage; tagId++, count++)
                {
                    //Console.WriteLine(tagId);
                    sendTags.Add(Video.Tags[(int)tagId]);
                }

                for (var i = 0; i < clients.Length; i++)
                    if(clients[i].CurrentState == Client.ClientStates.Streaming)
                        clients[i].SendFlv(sendTags.ToArray());
                sendTags.Clear();
            }
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            FlvStreamer streamer = new FlvStreamer();

            var client = new Client();

            client.PublisherId = "live_YourStreamID";
            client.Connect("199.9.255.53");
            client.Start();

            var vclient = new VideoClient();
            vclient.GrabVideo("http://www.youtube.com/watch?v=at68PMbgyhw");
            vclient.AddedTag += delegate(FlvTag tag)
                                    {
                                        client.SendFlv(new FlvTag[1] {tag});
                                    };

            while(true)
            {
                client.Update();
                if(client.CurrentState == Client.ClientStates.Streaming)
                    vclient.Update();
            }
        }
Exemplo n.º 3
0
 public void Update(Client client)
 {
     Update(new Client[1] {client});
 }