HTML中的"href"值可在Android上的youtube应用或市场(Google Play)中打开视频 [英] “href” value in HTML to open video in youtube app or market (Google Play) on Android

查看:120
本文介绍了HTML中的"href"值可在Android上的youtube应用或市场(Google Play)中打开视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在制作一个显示360个视频的网页,但是最近我注意到不支持android浏览器中的360功能,因此,该视频无法正确显示,因此在搜索了很多内容后,我发现最好选项是尝试使用此开发者教程中说明的"Android Intent"在YouTube应用中打开视频:

I'm making a Web Page that shows 360 videos, but i recently noticed that 360 functionality in the android browser is not supported, and because of this the video wont shows correctly, so after searching a lot i found that the best option is to try to open the video in the YouTube app making use of an "Android Intent" explained in this developer tutorial:

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

因此,我需要为YouTube视频构建href地址,但是很不幸,我不了解android编程,也找不到YouTube App xml清单来填充选项,有人可以帮助我吗?

So i need to construct the href address for a YouTube video, but unfortunately i don't know android programming and also can't find the YouTube App xml manifest to fill the options, can anyone help me?

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;

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

Any help or tutorial will be greatly appreciated... Thanks!!

推荐答案

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>

NB:

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

Maybe you need to remove spaces in 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>

您可以在设置> 应用> Youtube > 默认打开> 中获得更多信息.链接:

You get more information in Settings > Apps > Youtube > Open by default > Supported links:

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

请参阅: https://youtu.be/8xn9iq3lG_w 并在此处尝试:

See: https://youtu.be/8xn9iq3lG_w and try, here: 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>

这篇关于HTML中的"href"值可在Android上的youtube应用或市场(Google Play)中打开视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆