admin管理员组文章数量:1312902
I'm trying to open a remote video (let's say it's located at .mp4
) with the default Android player launched directly from Google Chrome, making use of the brand new intent://
.
This is the URI I called through an href
tag:
intent://www.example/video.mp4#Intent;scheme=file;action=android.intent.action.VIEW;end;
Of course, this URI doesn't work, and Chrome returns error "Unable to perform navigation". I've also tried the same URI omitting scheme=file
.
Here's the documentation I've been following:
Thanks in advance!
I'm trying to open a remote video (let's say it's located at http://www.example./video.mp4
) with the default Android player launched directly from Google Chrome, making use of the brand new intent://
.
This is the URI I called through an href
tag:
intent://www.example./video.mp4#Intent;scheme=file;action=android.intent.action.VIEW;end;
Of course, this URI doesn't work, and Chrome returns error "Unable to perform navigation". I've also tried the same URI omitting scheme=file
.
Here's the documentation I've been following: https://developer.chrome./multidevice/android/intents
Thanks in advance!
Share Improve this question asked Dec 29, 2015 at 18:26 josemmojosemmo 7,1033 gold badges39 silver badges50 bronze badges1 Answer
Reset to default 8A quick browse of the Gallery App in AOSP shows that it can be launched from a browser. It has a category of BROWSABLE and DEFAULT. This means given the correct intent URL you should be able to launch it.
Obviously specifying a package should work, but that is not flexible, what if there are two gallery apps.
The following Intent scheme url works:
intent://www.sample-videos./video/mp4/720/big_buck_bunny_720p_1mb.mp4#Intent;action=android.intent.action.VIEW;scheme=http;type=video/mp4;end
Note:
- scheme = http (it needs to be that or https),
- there is a // before the domain, if that is not there the URL is not constructed correctly in the player
- action = android.intent.action.VIEW
- type = video/mp4 - if this is not in place the video will open in the browser
I have created a demo that works
本文标签: javascriptOpen video URL in native player from Google ChromeStack Overflow
版权声明:本文标题:javascript - Open video URL in native player from Google Chrome - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741908900a2404320.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论