javascript - Angular base64 video interpolation fail ($sce) -
i'm trying present base64 video using angular, fails interpolate due $sce provider not trusting source (which simple data url).
error: [$interpolate:interr] can't interpolate: {{video}} error: [$sce:insecurl] blocked loading resource url not allowed $scedelegate policy. url: data:video/mp4;base64,aaaaggz0exbtcdqyaaaaaglzb21tcdqyaaavzm1vb3yaaabsbxzoz…+vxw5fexy+x3p3xv429xirw87evd0svwnuu3by8hw9zs6twxs5zcbmgmlcky+3csi4rac9ya==
so far have tried:
$scope.video = $sce.trustasresourceurl('base64-string-here');
this didn't worked, believe method still expecting valid link , not data url, therefore not right solution.
second try:
angular.module('myappwithscedisabledmyapp', []).config(function($sceprovider) { // disable sce. // not use in new projects. $sceprovider.enabled(false); });
this of course works, disables entire provider, hence making app vulnerable.
i have yet came across valid solution this, i'm displaying base64 images without hassle i'm sure there must way solve it, or @ least workaround.
much help!
if looking solution, here's input 3 months after posting question:
base64 videos not idea, if solve interpolation problem app crash on android when played.
i spent lot of time on it, solution on "how play non-streamed videos on apps" to:
download file local phone , play there (if use angular ngcordova file transfer plugin)
for android: html5 video tag not work. reason somewhere between permission issues , android not allowing local videos played on html. use android video player such this media player
for ios: html5 video tag works playing local videos. converts native one.
hope helps someday.
Comments
Post a Comment