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:

  1. download file local phone , play there (if use angular ngcordova file transfer plugin)

  2. 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

Popular posts from this blog

javascript - oscilloscope of speaker input stops rendering after a few seconds -

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -