简体   繁体   中英

How to open blob link use webview of android?

I want to display video in android app.

The link of video is blob link so that i think i need use webview to display it.

How to implement it?

WebView support loading HTML data from string . So following code is possible.

 String videoBlobLinkUrl = "data:video/mp4;base64,[video base64-encoded data ..]";
 String videoBlobMime = "video/mp4";

 String videoHtml = "<html><body><video><source type=\""+videoBlobMime+"\" src=\""+ videoBlobLinkUrl +"\"></video></body></html>";
 webview.loadData(videoHtml, "text/html", null);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM