javascript - Cordova - Capture video and retrieve base64 data -
I am using a phonegap to record a video and I want to save the base64 data-encoded string. So far I have tried to do this ..
Capture function on function (media files) {var i, path, len; Path = media file [0]; Victory (path); } Function Win (file) {var reader = new FileReader (); Reader.onloadend = function (evt) {console.log ("Success Read"); Console.log (evt.target.result); }; Reader.readAsDataURL (file); }; Function Capture Error (error) {navigator.notification.alert ('Error code:' + ErrorRode, tap, 'capture error'); } Function capture video () {navigator.device.capture.captureVideo (capture source, capture error, {limit: 1}); } I have specified as the download data. Output of evt.target.result is not any encoded data after the "data: video / mp34base64," but file type.
Do I want to add more to get the full base 64 data of the video?
I am really struggling to find anything that can help me any help would be greatly appreciated.
var b64toBlobAlt = function (dataURI, contentType) {var now, byte string, i, iia ; Byte string = etob (daturae split (',') [1]); Ab = new arrebufer (byte string. Langha); Ia = new Uint8Array (AB); I = 0; While (I Lieutenant: Byte String. Lang) {IIA [I] = ByteStringing.Corchoday (I); I ++; } Return new Blob ([ab], {type: content type}); }; Var Path = Media File [0] .fullPath; Window.resolveLocalFileSystemURL (path, function (file entry) {returns fileinteri.file (function (data) {var reader = new flimmer (reader ).loaded = function (e) {var blob = b64toBlobAlt (e.target.result, Video / mp3 '); if (blob) {// what you want to do with blob}}}}} return reader. Redhatetadata (data);});});
Comments
Post a Comment