【发布时间】:2020-09-17 00:03:20
【问题描述】:
我正在为 iOS 和 Android 编写一个跨平台的 XForms 应用程序。我在 xaml 中有一个嵌入式 WebView 控件。我传入的 URL 是一个包含 YouTube 视频链接的页面。
当我在 iOS 上运行应用程序时,无论是真实设备还是模拟器,一切正常。
当我在带有 Android 10 的 Pixel 2 上运行该应用程序时,会播放音频但没有视频。这只是一个黑屏。
我正在使用 VS2019 for Mac 并针对 api 29。
我确实在调试窗口中得到了一些有趣的输出:
[VideoCapabilities] Unrecognized profile 2130706433 for video/avc
[VideoCapabilities] Unrecognized profile 2130706434 for video/avc
[VideoCapabilities] Unrecognized profile 2130706433 for video/avc
[VideoCapabilities] Unrecognized profile 2130706434 for video/avc
[VideoCapabilities] Unrecognized profile 2130706433 for video/avc
[VideoCapabilities] Unrecognized profile 2130706434 for video/avc
[] PlayerBase::PlayerBase()
[cr_MediaCodecBridge] create MediaCodec video decoder, mime video/avc
[] TrackPlayerBase::TrackPlayerBase()
[libOpenSLES] Emulating old channel mask behavior (ignoring positional mask 0x3, using default mask 0x3 based on channel count of 2)
[OMXClient] IOmx service obtained
[VideoCapabilities] Unrecognized profile 2130706433 for video/avc
[VideoCapabilities] Unrecognized profile 2130706434 for video/avc
[MediaCodec] MediaCodec will operate in async mode
[SurfaceUtils] connecting to surface 0x77fd67a010, reason connectToSurface
[MediaCodec] [OMX.qcom.video.decoder.avc] setting surface generation to 10594305
[SurfaceUtils] disconnecting from surface 0x77fd67a010, reason connectToSurface(reconnect)
[SurfaceUtils] connecting to surface 0x77fd67a010, reason connectToSurface(reconnect)
[SurfaceUtils] set up nativeWindow 0x77fd67a010 for 426x240, color 0x7fa30c06, rotation 0, usage 0x20002900
[Gralloc3] allocator 3.x is not supported
[SurfaceUtils] set up nativeWindow 0x77fd67a010 for 432x240, color 0x7fa30c06, rotation 0, usage 0x20002900
[NdkImageReader] acquireImageLocked: Overriding buffer format YUV_420_888 to 0x7fa30c06.
[AudioManager] Use of stream types is deprecated for operations other than volume control
[AudioManager] See the documentation of requestAudioFocus() for what to use instead with android.media.AudioAttributes to qualify your playback use case
[chromium] [ERROR:web_contents_delegate.cc(224)] WebContentsDelegate::CheckMediaAccessPermission: Not supported.
[chromium] [ERROR:web_contents_delegate.cc(224)] WebContentsDelegate::CheckMediaAccessPermission: Not supported.
[CameraManagerGlobal] Connecting to camera service
[cr_media] Requires MODIFY_AUDIO_SETTINGS and RECORD_AUDIO. No audio device will be available for recording
【问题讨论】:
-
在 Android 网络视图中有很多关于 Youtube 的现有帖子 - 你读过其中的任何一个吗? google.com/…
-
其实我已经做了很多谷歌搜索。我没有做的只是搜索stackoverflow。那是我的错误。我已经阅读了几件事。我想我的搜索技巧不如你。如果我按去年的所有内容过滤您的搜索,那么第一个答案就是它。对于发现这个的其他人,这是 androidmanifest.xml 中的应用程序设置
-
如果您的问题已经解决,您可以在答案中发布并接受它。