public override object instantiateItem(ViewGroup container, int position)
            {
                MySubscriber p = outerInstance.mSubscribers[position];

                container.addView(p.View);
                return(p);
            }
        protected internal override void onStreamDropped(Stream stream)
        {
            MySubscriber p = mSubscriberStream[stream];

            if (p != null)
            {
                mSubscribers.Remove(p);
                mSubscriberStream.Remove(stream);
                mSubscriberConnection.Remove(stream.Connection.ConnectionId);
                mPagerAdapter.notifyDataSetChanged();

                presentText("\n" + p.Name + " has left the chat");
            }
        }
 protected internal override void onSignalReceived(string type, string data, Connection connection)
 {
     if (type != null && "chat".Equals(type))
     {
         string mycid = this.Connection.ConnectionId;
         string cid   = connection.ConnectionId;
         if (!cid.Equals(mycid))
         {
             MySubscriber p = mSubscriberConnection[cid];
             if (p != null)
             {
                 presentMessage(p.Name, data);
             }
         }
     }
 }
        protected internal override void onStreamReceived(Stream stream)
        {
            MySubscriber p = new MySubscriber(mContext, stream);

            // we can use connection data to obtain each user id
            p.UserId = stream.Connection.Data;

            // Subscribe audio only if we have more than one player
            if (mSubscribers.Count != 0)
            {
                p.SubscribeToVideo = false;
            }

            // Subscribe to this player
            this.subscribe(p);

            mSubscribers.Add(p);
            mSubscriberStream[stream] = p;
            mSubscriberConnection[stream.Connection.ConnectionId] = p;
            mPagerAdapter.notifyDataSetChanged();

            presentText("\n" + p.Name + " has joined the chat");
        }
Esempio n. 5
0
		protected internal override void onStreamReceived(Stream stream)
		{
			MySubscriber p = new MySubscriber(mContext, stream);

			// we can use connection data to obtain each user id
			p.UserId = stream.Connection.Data;

			// Subscribe audio only if we have more than one player
			if (mSubscribers.Count != 0)
			{
				p.SubscribeToVideo = false;
			}

			// Subscribe to this player
			this.subscribe(p);

			mSubscribers.Add(p);
			mSubscriberStream[stream] = p;
			mSubscriberConnection[stream.Connection.ConnectionId] = p;
			mPagerAdapter.notifyDataSetChanged();

			presentText("\n" + p.Name + " has joined the chat");
		}
            public override void destroyItem(ViewGroup container, int position, object @object)
            {
                MySubscriber p = (MySubscriber)@object;

                container.removeView(p.View);
            }