在onvif的page页添加云台控制、静音以及截图的图片按钮和布局

TangShanKaiPing
wanggang 6 years ago
parent 19d407ad70
commit 5b291ceb86

@ -2,6 +2,7 @@
*.suo
*.db
*.user
*.log
.vs
obj
Obj

@ -16,7 +16,7 @@
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
<AndroidUseLatestPlatformSdk>false</AndroidUseLatestPlatformSdk>
<TargetFrameworkVersion>v8.1</TargetFrameworkVersion>
<TargetFrameworkVersion>v9.0</TargetFrameworkVersion>
<AndroidHttpClientHandlerType>Xamarin.Android.Net.AndroidClientHandler</AndroidHttpClientHandlerType>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
@ -40,6 +40,9 @@
<WarningLevel>4</WarningLevel>
<AndroidManagedSymbols>true</AndroidManagedSymbols>
<AndroidUseSharedRuntime>false</AndroidUseSharedRuntime>
<AotAssemblies>false</AotAssemblies>
<EnableLLVM>false</EnableLLVM>
<BundleAssemblies>false</BundleAssemblies>
</PropertyGroup>
<ItemGroup>
<Reference Include="Mono.Android" />

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="com.nbaxp.Demo" android:installLocation="auto">
<uses-sdk android:minSdkVersion="22" android:targetSdkVersion="27" />
<uses-sdk android:minSdkVersion="22" android:targetSdkVersion="28" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.FLASHLIGHT" />
<uses-permission android:name="android.permission.INTERNET" />

File diff suppressed because it is too large Load Diff

@ -1,5 +1,6 @@
using Plugin.LocalNotifications;
using System;
using System.Threading.Tasks;
using Xamarin.Forms;
using ZXing.Net.Mobile.Forms;
@ -32,7 +33,7 @@ namespace Demo
else if (e.Url.Contains("rtmp://") || e.Url.Contains(".flv") || e.Url.Contains(".m3u8"))
{
e.Cancel = true;
this.Navigation.PushAsync(new OnvifPage(e.Url));
Task.Run(() => this.Navigation.PushAsync(new OnvifPage(e.Url)));
}
}

@ -3,10 +3,30 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:shared="clr-namespace:LibVLCSharp.Forms.Shared;assembly=LibVLCSharp.Forms"
x:Class="Demo.OnvifPage">
<RelativeLayout>
<AbsoluteLayout>
<shared:VideoView x:Name="videoView" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" />
<ImageButton Clicked="Button_Clicked" Opacity="0.8" Source="close.png"
RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent, Property=X, Factor=0,Constant=0}"
RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent, Property=Y, Factor=0, Constant=0}" />
</RelativeLayout>
<ImageButton Clicked="Button_Clicked" Opacity="0.8" Source="close.png" AbsoluteLayout.LayoutBounds="0,0,48,48" AbsoluteLayout.LayoutFlags="PositionProportional" x:Name="back" />
<ImageButton Clicked="Button_Clicked" Opacity="0.8" Source="close.png" AbsoluteLayout.LayoutBounds="1,0,48,48" AbsoluteLayout.LayoutFlags="PositionProportional" x:Name="muted" />
<Grid AbsoluteLayout.LayoutBounds=".5,1,210,270" AbsoluteLayout.LayoutFlags="PositionProportional" RowSpacing="10" ColumnSpacing="10">
<Grid.RowDefinitions>
<RowDefinition Height="60" />
<RowDefinition Height="60" />
<RowDefinition Height="60" />
<RowDefinition Height="60" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="60" />
<ColumnDefinition Width="60" />
<ColumnDefinition Width="60" />
</Grid.ColumnDefinitions>
<ImageButton Grid.Row="0" Grid.Column="1" x:Name="top" Source="close.png" />
<ImageButton Grid.Row="1" Grid.Column="0" x:Name="left" Source="close.png" />
<ImageButton Grid.Row="1" Grid.Column="1" x:Name="stop" Source="close.png" />
<ImageButton Grid.Row="1" Grid.Column="2" x:Name="right" Source="close.png" />
<ImageButton Grid.Row="2" Grid.Column="1" x:Name="bottom" Source="close.png" />
<ImageButton Grid.Row="3" Grid.Column="0" x:Name="zoomin" Source="close.png" />
<ImageButton Grid.Row="3" Grid.Column="1" x:Name="shot" Source="close.png" />
<ImageButton Grid.Row="3" Grid.Column="2" x:Name="zoomout" Source="close.png" />
</Grid>
</AbsoluteLayout>
</ContentPage>

@ -40,11 +40,11 @@ namespace Demo
this.videoView.MediaPlayer.Stop();
}
protected override bool OnBackButtonPressed()
{
this.videoView.MediaPlayer.Stop();
return base.OnBackButtonPressed();
}
//protected override bool OnBackButtonPressed()
//{
// this.videoView.MediaPlayer.Stop();
// return base.OnBackButtonPressed();
//}
private void Button_Clicked(object sender, System.EventArgs e)
{

@ -88,6 +88,9 @@
<f7-page :page-content="false" @page:reinit="vm.init">
<f7-navbar>
<f7-nav-title>{{vm.Title}}</f7-nav-title>
<f7-nav-right>
<f7-link external panel-open="right" icon-f7="add" href="webqr.html" ></f7-link>
</f7-nav-right>
</f7-navbar>
<f7-toolbar tabbar labels bottom>
<f7-link tab-link="#tab-message" icon-ios="f7:chat" icon-md="f7:chat" text="消息"></f7-link>
@ -543,9 +546,21 @@
<li>
<div class="item-content">
<div class="item-inner">
<!--<a style='width:100%;' class="button button-large button-fill button-outline external" :href="getUrl('rtmp')">RTMP预览</a>-->
<a style='width:100%;' class="button button-large button-fill button-outline color-green external" :href="getUrl('flv')">预览</a>
<!--<a style='width:100%;' class="button button-large button-fill button-outline external" :href="getUrl('hls')">HLS预览</a>-->
<a style='width:100%;' class="button button-large button-fill button-outline color-green external" :href="getUrl('rtmp')">RTMP预览</a>
</div>
</div>
</li>
<li>
<div class="item-content">
<div class="item-inner">
<a style='width:100%;' class="button button-large button-fill button-outline color-green external" :href="getUrl('flv')">FLV预览</a>
</div>
</div>
</li>
<li>
<div class="item-content">
<div class="item-inner">
<a style='width:100%;' class="button button-large button-fill button-outline color-green external" :href="getUrl('hls')">HLS预览</a>
</div>
</div>
</li>

Loading…
Cancel
Save