【发布时间】:2020-02-17 04:03:01
【问题描述】:
我的应用曾经使用 v2 的 downloadUrl() + access_token 播放 Google Drive 视频
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.parse(videoItem.downloadUrl() + "&access_token=" + mAccessToken), "video/avi");
startActivity(intent);
但是,它有一天会无缘无故停止工作。
我尝试过使用 v3 的 webContent()
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(videoItem.webContent()));
startActivity(intent);
但这样他们需要在观看视频的设备上登录 Google。
有谁知道为什么 v2 的 downloadUrl() + access_token 停止工作? 另外为什么以下不起作用?因为我想在 Google Drive 应用程序中的第三方播放器中播放我的视频。
intent.setDataAndType(Uri.parse(videoItem.webContent()), "video/avi");
提前谢谢你。
【问题讨论】:
-
请定义停止工作。访问令牌过期后你刷新了吗?
-
我不能再用这个链接播放视频 "videoItem.downloadUrl() + "&access_token=" + mAccessToken
-
每次都使用新的访问令牌
标签: android google-api google-drive-api google-oauth