From a3038b12745162bf96342e8dcf88d6a478194da3 Mon Sep 17 00:00:00 2001 From: winlin Date: Thu, 10 Mar 2016 12:16:51 +0800 Subject: [PATCH] fix the rtmp url parse bug. --- trunk/research/players/js/winlin.utility.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/trunk/research/players/js/winlin.utility.js b/trunk/research/players/js/winlin.utility.js index 00920f24e..7dbc9a026 100644 --- a/trunk/research/players/js/winlin.utility.js +++ b/trunk/research/players/js/winlin.utility.js @@ -5,7 +5,7 @@ * depends: jquery1.10 * https://code.csdn.net/snippets/147103 * @see: http://blog.csdn.net/win_lin/article/details/17994347 - * v 1.0.14 + * v 1.0.15 */ /** @@ -306,10 +306,16 @@ function parse_rtmp_url(rtmp_url) { vhost = "__defaultVhost__"; } } + + // parse the schema + var schema = "rtmp"; + if (rtmp_url.indexOf("://") > 0) { + schema = rtmp_url.substr(0, rtmp_url.indexOf("://")); + } var ret = { url: rtmp_url, - schema: a.protocol.replace(":", ""), + schema: schema, server: a.hostname, port: port, vhost: vhost, app: app, stream: stream };