gpt4 book ai didi

java - 使用 ExoPlayer 将 YouTube 直播视频 (DASH) 流式传输到 Android 应用

转载 作者:搜寻专家 更新时间:2023-11-01 09:39:23 25 4
gpt4 key购买 nike

我正在制作一个可以将实时 YouTube 视频流式传输到我的应用程序的应用程序。我想使用 ExoPlayer。我浏览了 ExoPlayer 的演示应用程序,他们在 DASH 流式传输中使用的 URL 是这样的:

"uri":"http://www.youtube.com/api/manifest/dash/id/bf5bb2419360daf1/source/youtube?as=fmp4_audio_clear,fmp4_sd_hd_clear&sparams=ip,ipbits,expire,source,id ,as&ip=0.0.0.0&ipbits=0&expire=19000000000&signature=51AF5F39AB0CEC3E5497CD9C900EBFEAECCCB5C7.8506521BFC350652163895D4C26DEE124209AA9E&key=ik0"

这是有效的。

我不知道如何获得这样的 URL,最后我得到了 here .这是否意味着即使视频是我自己的,我也无法从 YouTube 流式传输? (尤其是直播视频)如果可以的话,我怎样才能为我的视频获取这样的 URL?

最佳答案

我了解到 DASH 网址实际上是 Google 内部的东西,您可能需要使用解码器才能获取您的网址。

为此,您可能想尝试 Karim Abdell Salam 在 SO post 中给出的以下解决方案:

  1. First you need to call this url: http://www.youtube.com/get_video_info?&video_id=v1uyQZNg2vE and don't forget to change the last id with the target one.
  2. Now you will get notice to download a file called get_video_info with no extesion.
  3. Try to open this file using notepad and so.
  4. Now you have the right data but you can't read it because its encoded You need HTML decoder to read this data. Use this one: http://meyerweb.com/eric/tools/dencoder/. Just paste your data and press decode a several times to ensure it decoded well
  5. Finally, search for a key called dashmpd and enjoy your URL

您可能还想查看这些链接以获取更多有用的信息和更新:

最后,您也可以选择尝试在 Android 4.2.2 版上播放实时视频,而不必使用本 SO post 中提到的 ExoPlayer。 .

关于java - 使用 ExoPlayer 将 YouTube 直播视频 (DASH) 流式传输到 Android 应用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40761192/

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