From 3e1ad373bc4c4905467362d0c831449fb3afecf0 Mon Sep 17 00:00:00 2001
From: wanggang <76527413@qq.com>
Date: Fri, 19 Apr 2019 15:18:54 +0800
Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0DEMO=EF=BC=8C=E6=B7=BB?=
=?UTF-8?q?=E5=8A=A0libvlc=E5=BA=93?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Demo/Demo.Android/Demo.Android.csproj | 5 +-
.../Resources/Resource.designer.cs | 3 +
projects/Demo/Demo.iOS/Demo.iOS.csproj | 5 +-
projects/Demo/Demo/Demo.csproj | 11 +-
projects/Demo/Demo/MainPage.xaml.cs | 5 +
projects/Demo/Demo/OnvifPage.xaml | 13 +
projects/Demo/Demo/OnvifPage.xaml.cs | 45 ++
projects/Demo/Demo/wwwroot/index.html | 398 ++++++++----------
projects/Demo/Demo/wwwroot/js/app.js | Bin 28580 -> 30080 bytes
9 files changed, 255 insertions(+), 230 deletions(-)
create mode 100644 projects/Demo/Demo/OnvifPage.xaml
create mode 100644 projects/Demo/Demo/OnvifPage.xaml.cs
diff --git a/projects/Demo/Demo.Android/Demo.Android.csproj b/projects/Demo/Demo.Android/Demo.Android.csproj
index 53c35b06..71425534 100644
--- a/projects/Demo/Demo.Android/Demo.Android.csproj
+++ b/projects/Demo/Demo.Android/Demo.Android.csproj
@@ -49,7 +49,10 @@
-
+
+ 3.1.2
+
+
diff --git a/projects/Demo/Demo.Android/Resources/Resource.designer.cs b/projects/Demo/Demo.Android/Resources/Resource.designer.cs
index 7768330c..ad8ed41c 100644
--- a/projects/Demo/Demo.Android/Resources/Resource.designer.cs
+++ b/projects/Demo/Demo.Android/Resources/Resource.designer.cs
@@ -6125,6 +6125,9 @@ namespace Demo.Droid
// aapt resource value: 0x7f080026
public const int abc_toolbar_collapse_description = 2131230758;
+ // aapt resource value: 0x7f08003d
+ public const int app_name = 2131230781;
+
// aapt resource value: 0x7f080034
public const int appbar_scrolling_view_behavior = 2131230772;
diff --git a/projects/Demo/Demo.iOS/Demo.iOS.csproj b/projects/Demo/Demo.iOS/Demo.iOS.csproj
index 1bd4a7bb..af05a6bd 100644
--- a/projects/Demo/Demo.iOS/Demo.iOS.csproj
+++ b/projects/Demo/Demo.iOS/Demo.iOS.csproj
@@ -166,7 +166,10 @@
-
+
+ 3.1.5-alpha
+
+
diff --git a/projects/Demo/Demo/Demo.csproj b/projects/Demo/Demo/Demo.csproj
index 8c310f2c..9e133a41 100644
--- a/projects/Demo/Demo/Demo.csproj
+++ b/projects/Demo/Demo/Demo.csproj
@@ -10,9 +10,10 @@
-
+
+
-
+
@@ -24,5 +25,9 @@
-
+
+
+ MSBuild:UpdateDesignTimeXaml
+
+
\ No newline at end of file
diff --git a/projects/Demo/Demo/MainPage.xaml.cs b/projects/Demo/Demo/MainPage.xaml.cs
index f38673d9..877b3917 100644
--- a/projects/Demo/Demo/MainPage.xaml.cs
+++ b/projects/Demo/Demo/MainPage.xaml.cs
@@ -29,6 +29,11 @@ namespace Demo
e.Cancel = true;
CrossLocalNotifications.Current.Show("title", e.Url);
}
+ else if (e.Url.Contains("rtmp://"))
+ {
+ e.Cancel = true;
+ this.Navigation.PushAsync(new OnvifPage(e.Url));
+ }
}
private void WebView_Navigated(object sender, WebNavigatedEventArgs e)
diff --git a/projects/Demo/Demo/OnvifPage.xaml b/projects/Demo/Demo/OnvifPage.xaml
new file mode 100644
index 00000000..29395744
--- /dev/null
+++ b/projects/Demo/Demo/OnvifPage.xaml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/projects/Demo/Demo/OnvifPage.xaml.cs b/projects/Demo/Demo/OnvifPage.xaml.cs
new file mode 100644
index 00000000..3c1fa508
--- /dev/null
+++ b/projects/Demo/Demo/OnvifPage.xaml.cs
@@ -0,0 +1,45 @@
+using LibVLCSharp.Shared;
+
+using Xamarin.Forms;
+using Xamarin.Forms.Xaml;
+
+namespace Demo
+{
+ [XamlCompilation(XamlCompilationOptions.Compile)]
+ public partial class OnvifPage : ContentPage
+ {
+ private readonly string _url;
+ private readonly LibVLC _libvlc;
+
+ public OnvifPage(string url)
+ {
+ this._url = url;
+ InitializeComponent();
+ Core.Initialize();
+ this._libvlc = new LibVLC();
+ }
+
+ protected override void OnAppearing()
+ {
+ var media = new Media(_libvlc, this._url, FromType.FromLocation);
+ media.AddOption(new MediaConfiguration().EnableHardwareDecoding());
+ media.AddOption(":network-caching=0");
+ media.AddOption(":clock-jitter=0");
+ media.AddOption(":clock-synchro=0");
+ var player = new MediaPlayer(_libvlc);
+ videoView.MediaPlayer = player;
+ player.Play(media);
+ }
+
+ protected override void OnDisappearing()
+ {
+ this.videoView.MediaPlayer.Stop();
+ }
+
+ protected override bool OnBackButtonPressed()
+ {
+ this.videoView.MediaPlayer.Stop();
+ return base.OnBackButtonPressed();
+ }
+ }
+}
\ No newline at end of file
diff --git a/projects/Demo/Demo/wwwroot/index.html b/projects/Demo/Demo/wwwroot/index.html
index c58fa9ee..876444a2 100644
--- a/projects/Demo/Demo/wwwroot/index.html
+++ b/projects/Demo/Demo/wwwroot/index.html
@@ -75,7 +75,7 @@
@@ -155,8 +155,8 @@
场景
@@ -165,26 +165,27 @@
监测
-
-
-
-
{{getData(device,"温度")}}
-
{{getData(device,"湿度")}}
-
-
-
{{getData(device,"二氧化碳")}}
-
-
-
{{getData(device,"光照强度")}}
-
-
-
{{getData(device,"粉尘")}}
-
-
+
@@ -193,13 +194,12 @@
警报
-
-
-
-
{{getData(device,"状态")}}
-
+
@@ -208,17 +208,21 @@
主机
-
-
-
-
{{getData(device,"计算机名")}}
-
+
+
+
@@ -228,17 +232,9 @@
无线AP
-
-
-
-
IP {{getData(device,"IP")}}
-
连接数:{{getData(device,"连接数")}}
-
-
+
@@ -247,27 +243,20 @@
一路可调窗帘
-
-
-
-
{{getData(device,"状态")}}
-
-
+
-
-
@@ -277,24 +266,20 @@
计量开关
-
-
-
@@ -304,24 +289,20 @@
一路开关
-
-
-
@@ -331,32 +312,24 @@
二路灯开关
-
-
-
@@ -366,32 +339,26 @@
三路照明开关
-
-
-
@@ -401,24 +368,20 @@
墙面插座
-
-
-
@@ -428,24 +391,20 @@
一路插座
-
-
-
@@ -455,24 +414,20 @@
二路插座
-
-
-
@@ -482,22 +437,18 @@
密码门锁
-
-
-
@@ -507,17 +458,13 @@
红外转发器
@@ -527,23 +474,19 @@
@@ -552,13 +495,9 @@
摄像头
@@ -570,7 +509,7 @@
-
属性{{Device.Data.length}}
+
属性
操作
-
+
+
-
diff --git a/projects/Demo/Demo/wwwroot/js/app.js b/projects/Demo/Demo/wwwroot/js/app.js
index 206728493fd4a2075d9042361bcbb870743590da..2b7a0b1366ac2208a55fc01ee951a6c9feef7677 100644
GIT binary patch
delta 447
zcmX|8JxD@f6umEdVWsklGzpStL{AgcRM7H=ENh8MD1S1sA1snIC5=EDYHtY6+ECFP
z!GnedX^OULYpXpPTARAPAr9ZY-0xiOIrsan--Y8(;dW9`XNB`V^~wBV2+DNCP-ur5
zj2calhY_H0a&vTZ_Hi6z_?QckSAz#91-p7TWD4Lkl}F8|$9=eow~Ptv=>frsxu{FK
zoiaM`BRL=snY#CBi|TYhWop2l^{B0MQN+!R#aw6gDjias^-JWSjlYa|*oBAPE|_u>
zF5-H`BKl5+62<3aU`4^J#jmlgv^D5p|4DY=BtIo6$Fr(bp(U28F{-rBoI*~LDXKx{
zYGhf#rOuC
YB{p2==XF9Vw5y>tgQVjh!E|-w7Z#ayp8x;=
delta 73
zcmV-P0Ji^t>j9+S0kA*;1!MqX0Bo~A0i6`H_7%1alMrquvkW5!G_&ehUImjdHypDV
fV#WdoVE}aibO3LYp=K$w3}p}ylOPHXlP+~qt>qXE