HTML中的"href"值可在Android上的YouTube应用或市场(Google Play)中打开视频

Chi*_*001 9 html android youtube-api android-intent android-youtube-api

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

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

所以我需要为YouTube视频构建href地址,但遗憾的是我不知道android编程,也无法找到YouTube App xml清单来填充选项,任何人都可以帮助我吗?

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;
Run Code Online (Sandbox Code Playgroud)

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

A-3*_*312 9

1)意图解决方案:

<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>
Run Code Online (Sandbox Code Playgroud)

注意:

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

<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>
Run Code Online (Sandbox Code Playgroud)

视频


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>
Run Code Online (Sandbox Code Playgroud)

视频

  • @VincentAlex https://developer.chrome.com/docs/multidevice/android/intents/ (2认同)