Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Console: Fix stream preview link error #4235

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions trunk/research/console/js/srs.console.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,14 @@ scApp.controller("CSCConnect", ["$scope", "$location", "MSCApi", "$sc_utility",
$scope.server = {
schema: $sc_server.schema,
ip: $sc_server.host,
port: $sc_server.port
port: $sc_server.port,
http: $sc_server.http
};
$scope.connect = function(){
$sc_server.schema = $scope.server.schema;
$sc_server.host = $scope.server.ip;
$sc_server.port = $scope.server.port;
$sc_server.http = $scope.server.http;

MSCApi.versions_get(function(data){
$sc_utility.log("trace", "连接到SRS" + $scope.server.ip + "成功, SRS/" + data.data.version);
Expand Down Expand Up @@ -571,9 +573,8 @@ scApp.filter('sc_filter_style_error', function(){
scApp.filter('sc_filter_preview_url', ['$sc_server', function($sc_server){
return function(v){
var page = $sc_server.schema + `://${$sc_server.host}:${$sc_server.http}/players/srs_player.html`;
var http = $sc_server.http[$sc_server.http.length - 1];
var query = "vhost=" + v.owner.name + "&app=" + v.app + "&stream=" + v.name + ".flv";
query += "&server=" + $sc_server.host +"&port=" + http + "&autostart=true&schema=" + $sc_server.schema;
query += "&server=" + $sc_server.host +"&port=" + $sc_server.http + "&autostart=true&schema=" + $sc_server.schema;
return v? page+"?" + query:"javascript:void(0)";
};
}]);
Expand Down Expand Up @@ -674,6 +675,7 @@ scApp.provider("$sc_server", [function(){
query['schema'] = self.schema;
query['host'] = self.host;
query['port'] = self.port;
query['http'] = self.http;

var queries = [];
for (var key in query) {
Expand Down
6 changes: 6 additions & 0 deletions trunk/research/console/views/connect.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@
<input type="text" id="sscPort" placeholder="SRS API Server Port" ng-model="server.port">
</div>
</div>
<div class="control-group">
<label class="control-label" for="sscPort">HTTP端口</label>
<div class="controls">
<input type="text" id="sscHttp" placeholder="SRS HTTP Server Port" ng-model="server.http">
</div>
</div>
<div class="control-group">
<div class="controls">
<button type="submit" class="btn" ng-click="connect()">连接到SRS</button>
Expand Down
6 changes: 6 additions & 0 deletions trunk/research/console/views/connect_en.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@
<input type="text" id="sscPort" placeholder="SRS API Server Port" ng-model="server.port">
</div>
</div>
<div class="control-group">
<label class="control-label" for="sscPort">SRS HTTP Port</label>
<div class="controls">
<input type="text" id="sscHttp" placeholder="SRS HTTP Server Port" ng-model="server.http">
</div>
</div>
<div class="control-group">
<div class="controls">
<button type="submit" class="btn" ng-click="connect()">Connect</button>
Expand Down
Loading