gpt4 book ai didi

android - HTML 中的 “href” 值,用于在 Android 上的 youtube 应用程序或市场 (Google Play) 中打开视频

转载 作者:太空狗 更新时间:2023-10-29 13:26:15 26 4
gpt4 key购买 nike

我正在制作一个显示 360 视频的网页,但我最近注意到 android 浏览器中的 360 功能不受支持,因此视频无法正确显示,所以经过大量搜索后我发现最好的选项是尝试使用本开发者教程中解释的“Android Intent”在 YouTube 应用程序中打开视频:

https://developer.chrome.com/multidevice/android/intents

所以我需要为 YouTube 视频构建 href 地址,但不幸的是我不懂 android 编程,也找不到 YouTube 应用程序 xml list 来填充选项,有人可以帮我吗?

intent:
HOST/URI-path <-- I think here needs to be the video URL?
#Intent;
package=com.google.android.youtube.player.YouTubeIntents; <-- Is this the correct package? or should i use com.google.android.youtube.player?
action=createPlayVideoIntentWithOptions(context, UUweNrpFTwA, true, true); <-- Dont know what to put in context field
category=[string]; <-- Is category needed? if so what category should i place here?
component=[string]; <-- Is component needed?
scheme=youtube; <-- Is this the correct scheme?
end;

任何帮助或教程将不胜感激......谢谢!!

最佳答案

1) Intent 解决方案:

<a href="
intent:
//8xn9iq3lG_w/
#Intent;
scheme=vnd.youtube;
package=com.google.android.youtube
S.browser_fallback_url=market://details?id=com.google.android.youtube;
end;
">youtube or market</a>

注意:

也许您需要删除href 属性 中的空格:

<a href="intent://8xn9iq3lG_w/#Intent;scheme=vnd.youtube;package=com.google.android.youtube;S.browser_fallback_url=market://details?id=com.google.android.youtube;end;">youtube or market</a>

video


2) 链接解决方案:

您可以在设置> 应用> Youtube> 默认打开> 支持链接:

  • youtube.be
  • m.youtube.com
  • youtube.com
  • www.youtube.com

参见:https://youtu.be/8xn9iq3lG_w并尝试,在这里:http://output.jsbin.com/tubozokebe/

<a target="_blank" href="https://youtu.be/8xn9iq3lG_w">link: https://youtu.be/8xn9iq3lG_w</a> or
<a target="_blank" href="vnd.youtube:8xn9iq3lG_w">link: vnd.youtube:8xn9iq3lG_w</a>

video

关于android - HTML 中的 “href” 值,用于在 Android 上的 youtube 应用程序或市场 (Google Play) 中打开视频,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39024729/

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