1.0.0-rc.108

Former-commit-id: b05f73bcb1a75f41c0dc53270ba971b26a3f98d0
TangShanKaiPing
wanggang 6 years ago
parent c6e7e75b57
commit d790591bc3

@ -370,7 +370,7 @@ namespace IoT.Shared.Services
{
var model = message.FromJson<EditDataModel>();
dataService.Edit<Data, EditDataModel>(model);
this.ClientToServer(method, model, null);
this.ClientToServer("EditData", model, null);
}
}
catch (Exception ex)

@ -473,6 +473,38 @@ namespace IoTCenter.Controllers
#region srs callback
public IActionResult OnPublish()
{
try
{
using (var reader = new StreamReader(Request.Body))
{
var json = reader.ReadToEndAsync().Result;
var result = JsonConvert.DeserializeObject<Dictionary<string, string>>(json);
if (result["action"] == "on_publish")
{
var streamId = result["stream"];
var deviceNumber = streamId.StartsWith("main") ? streamId.Substring(4) : streamId.Substring(3);
var device = this._deviceRepo.ReadOnlyTable().Include(o => o.Node).Include(o => o.Data).FirstOrDefault(o => o.Number == deviceNumber);
if (device != null)
{
var data = device.Data.FirstOrDefault(o => o.Name == "录制");
if (data != null)
{
this.CallApi(null, device.Node.Number, $"/Onvif/{(data.Value == "" ? "Start" : "Stop")}Record");
}
}
}
}
}
catch (Exception ex)
{
ex.PrintStack();
}
return Content(string.Empty);
}
/// <summary>
/// 录制完毕事件响应
///{"action":"on_dvr","client_id":107,"ip":"192.168.3.124","vhost":"__defaultVhost__","app":"live","stream":"main0a5d5deee43011b483884cbd8fd2b3dd","param":"","cwd":"/root/publish/apps/srs","file":"./objs/nginx/html/live.main0a5d5deee43011b483884cbd8fd2b3dd.1574832559180.mp4"}

@ -1,5 +1,5 @@
{
"version": "1.0.0-rc.107",
"version": "1.0.0-rc.108",
"Logging": {
"LogLevel": {
"Default": "Warning",

@ -120,7 +120,7 @@ namespace IoTNode.Controllers
{
return this.AsyncAction(() =>
{
this._deviceService.SetRecordStart(number, true);
this._deviceService.SetRecord(number, true);
});
}
@ -129,7 +129,7 @@ namespace IoTNode.Controllers
{
return this.AsyncAction(() =>
{
this._deviceService.SetRecordStart(number, false);
this._deviceService.SetRecord(number, false);
});
}
}

@ -594,7 +594,7 @@ namespace IoTNode.DeviceServices.Onvif
}
}
public void SetRecordStart(string number, bool state)
public void SetRecord(string number, bool state)
{
using (var scope = _applicationServices.CreateScope())
{

@ -1,5 +1,5 @@
{
"version": "1.0.0-rc.106",
"version": "1.0.0-rc.108",
"Logging": {
"LogLevel": {
"Default": "Warning",

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -1,48 +1,51 @@
# main config for srs.
# @see full.conf for detail config.
listen 1935;
daemon off;
max_connections 1000;
srs_log_tank file;
srs_log_file ./objs/srs.log;
listen 1935;
daemon off;
max_connections 1000;
srs_log_tank file;
srs_log_file ./objs/srs.log;
http_api {
enabled on;
listen 1985;
enabled on;
listen 1985;
raw_api {
enabled on;
allow_reload on;
allow_query on;
allow_update on;
}
}
http_server {
enabled on;
listen 8080;
dir ./objs/nginx/html;
enabled on;
listen 8080;
dir ./objs/nginx/html;
}
stats {
network 0;
disk sda sdb xvda xvdb;
network 0;
disk sda sdb xvda xvdb;
}
vhost __defaultVhost__ {
http_remux {
enabled on;
mount [vhost]/[app]/[stream].flv;
hstrs on;
enabled on;
mount [vhost]/[app]/[stream].flv;
}
hls {
enabled on;
hls_fragment 3;
hls_window 10;
hls_path ./objs/nginx/html;
hls_m3u8_file [app]/[stream].m3u8;
hls_ts_file [app]/[stream]-[seq].ts;
enabled on;
hls_fragment 3;
hls_window 10;
hls_path ./objs/nginx/html;
hls_m3u8_file [app]/[stream].m3u8;
hls_ts_file [app]/[stream]-[seq].ts;
}
dvr {
enabled on;
dvr_path ../IoTCenter/wwwroot/video/[app]-[stream]-[timestamp].mp4;
dvr_plan segment;
dvr_duration 3600;
dvr_wait_keyframe on;
time_jitter full;
enabled on;
dvr_apply none;
dvr_path ../IoTCenter/wwwroot/video/[app]-[stream]-[timestamp].mp4;
dvr_plan session;
dvr_duration 300;
dvr_wait_keyframe on;
time_jitter full;
}
http_hooks {
enabled on;
on_dvr http://localhost/IoTCenter/App/OnDvr;
enabled on;
on_dvr http://localhost/IoTCenter/App/OnDvr;
}
}

@ -1,48 +0,0 @@
# main config for srs.
# @see full.conf for detail config.
listen 1935;
daemon off;
max_connections 1000;
srs_log_tank file;
srs_log_file ./objs/srs.log;
http_api {
enabled on;
listen 1985;
}
http_server {
enabled on;
listen 8080;
dir ./objs/nginx/html;
}
stats {
network 0;
disk sda sdb xvda xvdb;
}
vhost __defaultVhost__ {
http_remux {
enabled on;
mount [vhost]/[app]/[stream].flv;
hstrs on;
}
hls {
enabled on;
hls_fragment 3;
hls_window 10;
hls_path ./objs/nginx/html;
hls_m3u8_file [app]/[stream].m3u8;
hls_ts_file [app]/[stream]-[seq].ts;
}
dvr {
enabled off;
dvr_path ./objs/nginx/html/[app].[stream].[timestamp].flv;
dvr_plan segment;
dvr_duration 600;
dvr_wait_keyframe on;
time_jitter full;
}
http_hooks {
enabled on;
on_dvr http://localhost/IoTCenter/Service/OnDvr;
}
}

@ -1,3 +0,0 @@
<cross-domain-policy>
<allow-access-from domain="*"/>
</cross-domain-policy>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

@ -1,3 +0,0 @@
<video autoplay controls autobuffer type="application/vnd.apple.mpegurl"
src="livestream.m3u8">
</video>

@ -1,3 +0,0 @@
<video autoplay controls autobuffer type="application/vnd.apple.mpegurl"
src="livestream_ld.m3u8">
</video>

@ -1,3 +0,0 @@
<video autoplay controls autobuffer type="application/vnd.apple.mpegurl"
src="livestream_sd.m3u8">
</video>

@ -1,17 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>SRS</title>
<meta charset="utf-8">
<script type="text/javascript" src="players/js/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="players/js/srs.page.js"></script>
<script type="text/javascript" src="players/js/srs.utility.js"></script>
<script type="text/javascript" src="players/js/winlin.utility.js"></script>
</head>
<body>
<script type="text/javascript">
setTimeout(function(){
window.location.href = "players/index.html" + window.location.search;
}, 500);
</script>
</body>

@ -1,3 +0,0 @@
<video autoplay controls autobuffer type="application/vnd.apple.mpegurl"
src="demo.m3u8">
</video>

@ -1,3 +0,0 @@
<video autoplay controls autobuffer type="application/vnd.apple.mpegurl"
src="livestream.m3u8">
</video>

@ -1,3 +0,0 @@
<video autoplay controls autobuffer type="application/vnd.apple.mpegurl"
src="livestream_ld.m3u8">
</video>

@ -1,3 +0,0 @@
<video autoplay controls autobuffer type="application/vnd.apple.mpegurl"
src="livestream_sd.m3u8">
</video>

@ -26,27 +26,20 @@ http {
listen 0.0.0.0:80;
server_name localhost;
location ^~ /live/ {
proxy_pass http://localhost:8080/live/;
}
location ^~ /UserCenter/ {
proxy_pass http://localhost:8010/;
#add_header 'Access-Control-Allow-Origin' '*';
#add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, PUT, DELETE';
#add_header 'Access-Control-Allow-Headers' 'Content-Type';
}
location ^~ /IoTCenter/ {
proxy_pass http://localhost:8011/;
proxy_pass http://localhost:8011/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_read_timeout 86400;
}
location ^~ /IoTCenter/App/ {
proxy_pass http://localhost:8011/App/;
location ^~ /live/ {
proxy_pass http://localhost:8080/live/;
}
error_page 500 502 503 504 /50x.html;
@ -54,5 +47,4 @@ http {
root html;
}
}
}
}
Loading…
Cancel
Save