当前位置: 首页 > news >正文

深圳自适应网站的公司有谁知道哪个网址

深圳自适应网站的公司,有谁知道哪个网址,企业网站设计制作收费,网站优化怎么样做介绍 在实际的开发过程中#xff0c;需要在应用内部内嵌播放器进行视频的播放。官方默认的MediaElement控件只能播放有限的视频格式#xff0c;也不能播放网络流。比较流行的解决方式是vlc的库#xff0c;但是在实际使用过程中发现有很多问题。这里给大家推荐另一个比较好的…介绍 在实际的开发过程中需要在应用内部内嵌播放器进行视频的播放。官方默认的MediaElement控件只能播放有限的视频格式也不能播放网络流。比较流行的解决方式是vlc的库但是在实际使用过程中发现有很多问题。这里给大家推荐另一个比较好的库。 使用 官网地址 安装库 Nuget下安装FFME.Windows PM Install-Package FFME.Windows下载ffmpeg依赖 注官网给的地址我在实际使用中发现使用官方的代码没问题使用给定的步骤使用就会抱错如果你们跟我一样给大家推荐另一个ffmpeg包的地址 ffmpeg依赖下载地址 代码 指定ffmpeg库的地址 Unosquare.FFME.Library.FFmpegDirectory C:\ffmpeg\ffmpeg-4.4-windows-desktop-vs2022-gpl-lite\bin;xaml中插入控件 Window x:ClassWpfApp1.MainWindowxmlnshttp://schemas.microsoft.com/winfx/2006/xaml/presentationxmlns:xhttp://schemas.microsoft.com/winfx/2006/xamlxmlns:dhttp://schemas.microsoft.com/expression/blend/2008xmlns:mchttp://schemas.openxmlformats.org/markup-compatibility/2006xmlns:localclr-namespace:WpfApp1 xmlns:ffmeclr-namespace:Unosquare.FFME;assemblyffme.winmc:IgnorabledLoadedWindow_LoadedClosedWindow_ClosedTitleMainWindow Height300 Width600Gridffme:MediaElement x:NameMedia BackgroundGray LoadedBehaviorPlay UnloadedBehaviorManual /Button ContentPlay ClickPlayButton_Click HorizontalAlignmentLeft VerticalAlignmentTop Width75 Margin10/Button ContentStop ClickStopButton_Click HorizontalAlignmentLeft VerticalAlignmentTop Width75 Margin100,10,0,0//Grid /Window 监听失败的事件 Media.MediaFailed OnMediaFailed;创建一个处理流地址的类FileInputStream namespace Unosquare.FFME.Windows.Sample.Foundation;using Common; using FFmpeg.AutoGen; using System; using System.IO; using System.Runtime.InteropServices;/// inheritdoc / /// summary /// Provides an example of a very simple custom input stream. /// /summary /// seealso crefIMediaInputStream / public sealed unsafe class FileInputStream : IMediaInputStream {private readonly FileStream BackingStream;private readonly object ReadLock new();private readonly byte[] ReadBuffer;/// summary/// Initializes a new instance of the see crefFileInputStream/ class./// /summary/// param namepathThe path./parampublic FileInputStream(string path){var fullPath Path.GetFullPath(path);BackingStream File.OpenRead(fullPath);var uri new Uri(fullPath);StreamUri new Uri(uri.ToString().ReplaceOrdinal(file://, Scheme));CanSeek true;ReadBuffer new byte[ReadBufferLength];}/// summary/// The custom file scheme (URL prefix) including the :// sequence./// /summarypublic static string Scheme customfile://;/// inheritdoc /public Uri StreamUri { get; }/// inheritdoc /public bool CanSeek { get; }/// inheritdoc /public int ReadBufferLength 1024 * 16;/// inheritdoc /public InputStreamInitializing OnInitializing { get; }/// inheritdoc /public InputStreamInitialized OnInitialized { get; }/// inheritdoc /public void Dispose(){BackingStream?.Dispose();}/// summary/// Reads from the underlying stream and writes up to paramref nametargetBufferLength / bytes/// to the paramref nametargetBuffer /. Returns the number of bytes that were written./// /summary/// param nameopaqueThe opaque./param/// param nametargetBufferThe target buffer./param/// param nametargetBufferLengthLength of the target buffer./param/// returns/// The number of bytes that have been read./// /returnspublic int Read(void* opaque, byte* targetBuffer, int targetBufferLength){lock (ReadLock){try{var readCount BackingStream.Read(ReadBuffer, 0, ReadBuffer.Length);if (readCount 0)Marshal.Copy(ReadBuffer, 0, (IntPtr)targetBuffer, readCount);else if (readCount 0)return ffmpeg.AVERROR_EOF;return readCount;}catch (Exception){return ffmpeg.AVERROR_EOF;}}}/// inheritdoc /public long Seek(void* opaque, long offset, int whence){lock (ReadLock){try{return whence ffmpeg.AVSEEK_SIZE ?BackingStream.Length : BackingStream.Seek(offset, SeekOrigin.Begin);}catch{return ffmpeg.AVERROR_EOF;}}} } 播放视频 //var target new Uri(rtmp://127.0.0.1/live/test1231233); var target new Uri(D:\视频\泥坑.mp4); if (target.ToString().StartsWith(FileInputStream.Scheme, StringComparison.OrdinalIgnoreCase))await Media.Open(new FileInputStream(target.LocalPath)); elseawait Media.Open(target);
http://www.w-s-a.com/news/361146/

相关文章:

  • 平顶山公司网站建设南昌网站seo多少钱
  • 网站开发要先买服务器吗建设婚恋网站用什么搭建
  • 我想自己在网站上发文章 怎样做wordpress站点安装
  • 北京模板网站开发全包昆明网站开发正规培训
  • 西咸新区建设环保网站谷歌风格wordpress
  • 嘉兴港区建设局网站2018年网站开发
  • 网站里图片做超链接专业开发网站报价单
  • server2003网站建设做销售记住这十句口诀
  • microsoft免费网站网站后台登陆路径
  • 贵州住房和城乡建设局网站做网站排名费用多少钱
  • 现在个人做网站还能盈利吗xampp用wordpress
  • 做网站 租服务器温岭建设公司网站
  • 四川住房和城乡建设厅网站官网做网站最贵
  • 右玉网站建设四川林峰脉建设工程有限公司网站
  • 网站推广小助手杭州百度百家号seo优化排名
  • 怎么做网站搜索框搜索网站备案拍照背景幕布
  • 建设部网站城市规划资质标准伊春网络推广
  • 如何设计酒店网站建设深圳市房地产信息系统平台
  • 伍佰亿网站怎么样网站建设前台后台设计
  • 做整装的网站北京哪个网站制作公司
  • 建设赚钱的网站福州便民生活网
  • 咸阳网站设计建设公司小程序打包成app
  • 做视频网站视频文件都存放在哪做旅游宣传图的网站有哪些
  • 地方门户类网站产品推广惠州市中国建设银行网站
  • 网站建设公司推荐5788移动版wordpress
  • 产品类型 速成网站淘宝怎么建立自己的网站
  • 南京优化网站建设公司的网站怎么建设
  • 做网站开发能挣钱月嫂云商城网站建设
  • 包装网站模板新手入门网站建设
  • 做网站的天津哪个公司做网站