Esempio n. 1
0
        public RtmpStream CreateDrNuRtmpStream(Uri rtmpUri)
        {
            if (rtmpUri == null)
            {
                throw new ArgumentNullException("rtmpUri");
            }

            // TODO: Some of the values below should be parsed from rtmpUri while others should be extracted to app.config.
            IUriData uriData = _uriDataFactory(rtmpUri, false);

            uriData.App          = "cms";                       // TODO: App should be parsed from rtmpUri.
            uriData.TcUri        = "rtmp://vod.dr.dk:1935/cms"; // TODO: TcUri should be parsed from rtmpUri.
            uriData.SwfUri       = "http://www.dr.dk/NU/assets/swf/NetTVPlayer.swf";
            uriData.FlashVersion = "LNX 10,1,102,64";
            uriData.VerifySwf    = true;

            var regex = new Regex("(?<playpath>mp4:CMS.*)");
            var match = regex.Match(rtmpUri.AbsoluteUri);

            if (!match.Success)
            {
                throw new ScraperException("Error parsing RTMP URI.");
            }
            uriData.PlayPath = match.Groups["playpath"].Value;

            uriData.Buffer  = TimeSpan.FromMilliseconds(36000000);
            uriData.Timeout = TimeSpan.FromSeconds(30);

            return(new RtmpStream(_libRtmpWrapper, uriData));
        }
Esempio n. 2
0
        public RtmpStream(ILibRtmpWrapper libRtmpWrapper, IUriData uriData)
        {
            if (libRtmpWrapper == null)
            {
                throw new ArgumentNullException("libRtmpWrapper");
            }
            if (uriData == null)
            {
                throw new ArgumentNullException("uriData");
            }

            _libRtmpWrapper = libRtmpWrapper;
            _uriData        = uriData;
            _canRead        = true;
            _isOpen         = false;
            _position       = 0;
        }
Esempio n. 3
0
        public RtmpStream(ILibRtmpWrapper libRtmpWrapper, IUriData uriData)
        {
            if (libRtmpWrapper == null) throw new ArgumentNullException("libRtmpWrapper");
            if (uriData == null) throw new ArgumentNullException("uriData");

            _libRtmpWrapper = libRtmpWrapper;
            _uriData = uriData;
            _canRead = true;
            _isOpen = false;
            _position = 0;
        }