gpt4 book ai didi

c# - Tizen .NET 流播放器

转载 作者:太空宇宙 更新时间:2023-11-03 14:49:19 24 4
gpt4 key购买 nike

我正在尝试找到一种解决方案来播放来自 URI 的“HLS/TS”内容。
我在 VS(xamarin 表单/跨平台)上编码,但找不到适合我的 Tizen 项目的方法或渲染器。

目前我有这个功能(但它与 xamarin.forms 的更新版本不兼容)并且它不能播放 HLS/TS 流(只是视频内容“如 mp4/mkv”):

public async Task PrepareAsync()
{
State = PlayerState.Preparing;

var display = new Multimedia.Display(Forms.Context.MainWindow);
_player.Display = display;

await _player.PrepareAsync();

State = PlayerState.Prepared;
}

谢谢

最佳答案

ExoPlayer 或许可以帮到您。

ExoPlayer 是一个开源库,它公开了较低级别的 Android 音频 API。 ExoPlayer 支持 MediaPlayer 不具备的高性能功能,例如 DASH 和 HLS 流。您可以自定义 ExoPlayer 代码,以便轻松添加新组件。 ExoPlayer 只能与 Android 4.1 及更高版本一起使用。

要使用 ExoPlayer,请将以下代码添加到您的 MainActivity (Xamarin):

((MediaManagerImplementation)CrossMediaManager.Current).MediaSessionManager = new MediaSessionManager(Application.Context, typeof(ExoPlayerAudioService));
var exoPlayer = new ExoPlayerAudioImplementation(((MediaManagerImplementation)CrossMediaManager.Current).MediaSessionManager);
CrossMediaManager.Current.AudioPlayer = exoPlayer;

也可以访问这里:

Run iptv & ts urls in android

https://github.com/google/ExoPlayer

https://blog.xamarin.com/play-audio-and-video-with-the-mediamanager-plugin-for-xamarin/

关于c# - Tizen .NET 流播放器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52518164/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com