diff --git a/trunk/research/players/js/flv-1.5.0.min.js.map b/trunk/research/players/js/flv.min.js.map
similarity index 100%
rename from trunk/research/players/js/flv-1.5.0.min.js.map
rename to trunk/research/players/js/flv.min.js.map
diff --git a/trunk/research/players/js/hls-0.14.17.min.js.map b/trunk/research/players/js/hls.min.js.map
similarity index 100%
rename from trunk/research/players/js/hls-0.14.17.min.js.map
rename to trunk/research/players/js/hls.min.js.map
diff --git a/trunk/research/players/rtc_player.html b/trunk/research/players/rtc_player.html
index 3cc526c82..1e7db005f 100644
--- a/trunk/research/players/rtc_player.html
+++ b/trunk/research/players/rtc_player.html
@@ -49,7 +49,7 @@
-
+
SessionID:
@@ -312,10 +312,16 @@
var query = parse_query_string();
srs_init_rtc("#txt_url", query);
- $("#btn_play").click(startPlay);
+ $("#btn_play").click(function() {
+ $('#rtc_media_player').prop('muted', false);
+ startPlay();
+ });
+
if (query.autostart === 'true') {
- // For autostart, we should mute it, see https://www.jianshu.com/p/c3c6944eed5a
$('#rtc_media_player').prop('muted', true);
+ console.warn('For autostart, we should mute it, see https://www.jianshu.com/p/c3c6944eed5a ' +
+ 'or https://developers.google.com/web/updates/2017/09/autoplay-policy-changes#audiovideo_elements');
+
startPlay();
}
});
diff --git a/trunk/research/players/srs_player.html b/trunk/research/players/srs_player.html
index bd24d1ed1..719d28aff 100755
--- a/trunk/research/players/srs_player.html
+++ b/trunk/research/players/srs_player.html
@@ -122,12 +122,25 @@
var flvPlayer = null;
var hlsPlayer = null;
+ var stopPlayers = function () {
+ if (flvPlayer) {
+ flvPlayer.destroy();
+ flvPlayer = null;
+ }
+ if (hlsPlayer) {
+ hlsPlayer.destroy();
+ hlsPlayer = null;
+ }
+ };
+
var hide_for_error = function () {
$('#main_flash_alert').show();
$('#main_info').hide();
$('#main_tips').hide();
$('#video_player').hide();
//$('#btn_play').hide();
+
+ stopPlayers();
};
var show_for_ok = function () {
@@ -142,11 +155,11 @@
var r = parse_rtmp_url($("#txt_url").val());
var url = window.location.protocol + "//" + query.host + query.pathname + "?autostart=true"
+ "&app=" + r.app + "&stream=" + r.stream + "&server=" + r.server + "&port=" + r.port;
- url += (query.shp_identify)? "&shp_identify=" + query.shp_identify : '';
- url += (r.vhost === "__defaultVhost__")? "&vhost=" + r.server : "&vhost=" + r.vhost;
- url += (r.schema !== "rtmp")? "&schema=" + r.schema : '';
- url += (query.buffer)? "&buffer=" + query.buffer : '';
- url += (query.api_port)? "&api_port=" + query.api_port : '';
+ url += (query.shp_identify) ? "&shp_identify=" + query.shp_identify : '';
+ url += (r.vhost === "__defaultVhost__") ? "&vhost=" + r.server : "&vhost=" + r.vhost;
+ url += (r.schema !== "rtmp") ? "&schema=" + r.schema : '';
+ url += (query.buffer) ? "&buffer=" + query.buffer : '';
+ url += (query.api_port) ? "&api_port=" + query.api_port : '';
var queries = user_extra_params(query);
queries = user_extra_params(r, queries);
@@ -157,20 +170,18 @@
$("#player_url").text($("#txt_url").val()).attr("href", url);
$("#link_url").attr("href", url);
- // Stop players.
- if (flvPlayer) {
- flvPlayer.destroy();
- }
- if (hlsPlayer) {
- hlsPlayer.destroy();
- }
-
// For RTMP, not support.
if (r.schema === 'rtmp') {
hide_for_error();
return;
}
+ return r;
+ };
+
+ var start_play = function (r) {
+ stopPlayers();
+
// Start play HTTP-FLV.
if (r.stream.indexOf('.flv') > 0) {
if (!flvjs.isSupported()) {
@@ -211,7 +222,9 @@
});
$("#btn_play").click(function(){
- apply_url_change();
+ $('#video_player').prop('muted', false);
+ var r = apply_url_change();
+ start_play(r);
});
/****
@@ -238,7 +251,12 @@
srs_init_rtmp("#txt_url");
if (query.autostart === "true") {
- apply_url_change();
+ $('#video_player').prop('muted', true);
+ console.warn('For autostart, we should mute it, see https://www.jianshu.com/p/c3c6944eed5a ' +
+ 'or https://developers.google.com/web/updates/2017/09/autoplay-policy-changes#audiovideo_elements');
+
+ var r = apply_url_change();
+ start_play(r);
}