Example #1
0
        public static MediaAttribute Create(string Param)
        {
            MediaAttribute attribute = null;
            string[] splits = Param.Split(':');
            if (splits.Count() == 2)
            {
                string name = splits[0];
                string value = splits[1];

                attribute = new MediaAttribute(name, value);
            }
            else if (splits.Count() == 1)
            {
                string name = splits[0];
                attribute = new MediaAttribute(name);
            }
            return attribute;
        }
Example #2
0
        public static MediaAttribute Create(string Param)
        {
            MediaAttribute attribute = null;

            string[] splits = Param.Split(':');
            if (splits.Count() == 2)
            {
                string name  = splits[0];
                string value = splits[1];

                attribute = new MediaAttribute(name, value);
            }
            else if (splits.Count() == 1)
            {
                string name = splits[0];
                attribute = new MediaAttribute(name);
            }
            return(attribute);
        }
Example #3
0
        public void Add(string type, string value)
        {
            switch (type)
            {
            case "i=":
                this.MediaTitle = value;
                break;

            case "c=":
                this.ConnectionInformation = value;
                break;

            case "b=":
                this.BandwidthInformation = value;
                break;

            case "k=":

                this.EncryptionKey = value;
                break;

            case "a=":
                //MediaAttribute attribute = MediaAttributeFactory.Create(value);
                //if(attribute!=null)
                //    this.MediaAttributes.Add(attribute);
                this.MediaAttributes.Add(MediaAttribute.Create(value));
                break;

            case "m=":
            {
                this.MediaNameAndTransportAddress = value;
                break;
            }

            default:
                //...
                break;
            }
        }