DEMO播放功能,android和ios完成验证

TangShanKaiPing
wanggang 6 years ago
parent 3e1ad373bc
commit 38a1d0bd0d

@ -29,7 +29,7 @@ namespace Demo
e.Cancel = true;
CrossLocalNotifications.Current.Show("title", e.Url);
}
else if (e.Url.Contains("rtmp://"))
else if (e.Url.Contains("rtmp://") || e.Url.Contains(".flv") || e.Url.Contains(".m3u8"))
{
e.Cancel = true;
this.Navigation.PushAsync(new OnvifPage(e.Url));

@ -3,11 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:shared="clr-namespace:LibVLCSharp.Forms.Shared;assembly=LibVLCSharp.Forms"
x:Class="Demo.OnvifPage">
<ContentPage.Content>
<StackLayout>
<Grid>
<shared:VideoView x:Name="videoView" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" />
</Grid>
</StackLayout>
</ContentPage.Content>
<Grid>
<shared:VideoView x:Name="videoView" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" />
</Grid>
</ContentPage>

@ -15,6 +15,7 @@ namespace Demo
{
this._url = url;
InitializeComponent();
NavigationPage.SetHasNavigationBar(this, false);
Core.Initialize();
this._libvlc = new LibVLC();
}
@ -22,7 +23,7 @@ namespace Demo
protected override void OnAppearing()
{
var media = new Media(_libvlc, this._url, FromType.FromLocation);
media.AddOption(new MediaConfiguration().EnableHardwareDecoding());
//media.AddOption(new MediaConfiguration().EnableHardwareDecoding());
media.AddOption(":network-caching=0");
media.AddOption(":clock-jitter=0");
media.AddOption(":clock-synchro=0");

@ -539,11 +539,13 @@
</div>
<div class="block-title" v-if="Device.Apis.length">操作</div>
<div class="list" v-if="Device.Apis.length">
<ul>
<ul v-if="Device.Name==='摄像头'">
<li>
<div class="item-content">
<div class="item-inner">
<a style='width:100%;' v-if="Device.Name==='摄像头'" class="button button-large button-fill button-outline external" :href="getUrl()">查看视频</a>
<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 external" :href="getUrl('flv')">FLV预览</a>
<a style='width:100%;' class="button button-large button-fill button-outline external" :href="getUrl('hls')">HLS预览</a>
</div>
</div>
</li>

Loading…
Cancel
Save