Reputation: 4548
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?
Upvotes: 0
Views: 602
Reputation: 5262
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);
Upvotes: 1