簡體   English   中英

帶有訪問令牌的 Android Google Drive API v2 downloadUrl 停止工作

[英]Android Google Drive API v2 downloadUrl with access token stopped working

我的應用曾經使用 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);

但是這樣他們就需要在觀看視頻的設備上登錄谷歌。

有誰知道為什么 v2 的 downloadUrl() + access_token 停止工作? 另外為什么以下不起作用? 因為我想在第三方播放器中播放我的視頻,所以在 Google Drive 應用程序中沒有。

intent.setDataAndType(Uri.parse(videoItem.webContent()), "video/avi");

先感謝您。

是的,由於最近更改了 Google Drive API 的授權downloadUrl() + access_token於 2020 年 1 月 1 日停止工作

按照文檔中描述的新程序,基本上

您將需要遷移您的請求以使用 HTTP 標頭進行身份驗證

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM