lucinhu / bili_you

一个用flutter制作的第三方B站客户端.
Apache License 2.0
2.87k stars 126 forks source link

通过URL Scheme打开链接 #51

Open My-Responsitories opened 1 year ago

My-Responsitories commented 1 year ago

预期行为

允许浏览器等其他应用通过URL Scheme调用 部分URL Scheme如下:

bilibili://
b23.tv
www.bilibili.com
live.bilibili.com
m.bilibili.com
space.bilibili.com
...

功能描述

同上

补充说明

测试:

https://www.bilibili.com/video/av2
https://www.bilibili.com/bangumi/play/ep2
https://www.bilibili.com/bangumi/play/ss7
https://www.bilibili.com/bangumi/media/md7
https://space.bilibili.com/1
https://m.bilibili.com/video/av2
https://m.bilibili.com/bangumi/play/ep2
https://m.bilibili.com/bangumi/play/ss7
https://m.bilibili.com/space/1
https://b23.tv/av2
https://b23.tv/ep2
https://b23.tv/ss7
...

bilibili://rank/rank
bilibili://pgc/season/ep/
bilibili://article/
bilibili://tag/
bilibili://video/
bilibili://music/playlist/playpage/
bilibili://root
bilibili://music/detail/
bilibili://music/menu/detail/
bilibili://space/
bilibili://following/detail/
bilibili://m.bilibili.com/topic-detail?topic_id=
bilibili://pegasus/channel/
bilibili://home?tab_name=
bilibili://search
bilibili://browser
bilibili://root
bilibili://browser?url=
...
lucinhu commented 1 year ago

已适配bilibili://root, bilibili://space, bilibili://video, bilibili://bangumi/season

My-Responsitories commented 1 year ago

已适配bilibili://root, bilibili://space, bilibili://video, bilibili://bangumi/season

http/https的链接并不能直接跳转到相应视频, 仅能打开app. 例如adb执行:

am start -a android.intent.action.VIEW -d https://www.bilibili.com/video/av2
am start -a android.intent.action.VIEW -d https://m.bilibili.com/video/av2
am start -a android.intent.action.VIEW -d https://b23.tv/av2

均只能打开首页, 而官方的app均可以直接跳转到av2

另外bilibili://video可传递BV号, 如:bilibili://video/BV1xx411c7mD. bilibili://pgc/season/ep/2可传递ep号

lucinhu commented 1 year ago

已适配bilibili://root, bilibili://space, bilibili://video, bilibili://bangumi/season

http/https的链接并不能直接跳转到相应视频, 仅能打开app. 例如adb执行:

am start -a android.intent.action.VIEW -d https://www.bilibili.com/video/av2
am start -a android.intent.action.VIEW -d https://m.bilibili.com/video/av2
am start -a android.intent.action.VIEW -d https://b23.tv/av2

均只能打开首页, 而官方的app均可以直接跳转到av2

另外bilibili://video可传递BV号, 如:bilibili://video/BV1xx411c7mD. bilibili://pgc/season/ep/2可传递ep号

然而我这里只能打开浏览器,也不能跳转到官方的app。

lucinhu commented 1 year ago

话说http/https跳转在什么情景下会出现?可以说一下吗?

lucinhu commented 1 year ago

高版本Android的http/https跳转需要在设置中启用,感觉有被废弃的倾向。 所以我的想法是只适配bilibili://而放弃http://和https://。

lucinhu commented 1 year ago

当然,帮忙适配是欢迎的。