winlin

fix the rtmp url parse bug.

@@ -5,7 +5,7 @@ @@ -5,7 +5,7 @@
5 * depends: jquery1.10 5 * depends: jquery1.10
6 * https://code.csdn.net/snippets/147103 6 * https://code.csdn.net/snippets/147103
7 * @see: http://blog.csdn.net/win_lin/article/details/17994347 7 * @see: http://blog.csdn.net/win_lin/article/details/17994347
8 - * v 1.0.14 8 + * v 1.0.15
9 */ 9 */
10 10
11 /** 11 /**
@@ -306,10 +306,16 @@ function parse_rtmp_url(rtmp_url) { @@ -306,10 +306,16 @@ function parse_rtmp_url(rtmp_url) {
306 vhost = "__defaultVhost__"; 306 vhost = "__defaultVhost__";
307 } 307 }
308 } 308 }
  309 +
  310 + // parse the schema
  311 + var schema = "rtmp";
  312 + if (rtmp_url.indexOf("://") > 0) {
  313 + schema = rtmp_url.substr(0, rtmp_url.indexOf("://"));
  314 + }
309 315
310 var ret = { 316 var ret = {
311 url: rtmp_url, 317 url: rtmp_url,
312 - schema: a.protocol.replace(":", ""), 318 + schema: schema,
313 server: a.hostname, port: port, 319 server: a.hostname, port: port,
314 vhost: vhost, app: app, stream: stream 320 vhost: vhost, app: app, stream: stream
315 }; 321 };