javascript - Base64 value is not working with video tag? -


i adding src video source base64 value not working here html

<video id="video" controls>    <source type="video/mp4"  id="jh">   </video>  

and js is

$("#vd").click(function(){            $.ajax({                 url:"retrivevedio",                 method: "get",                 datatype: 'text',                  success:function(response){                     console.log(response);                       var src = 'data:video/mp4;base64,'+response;                   $("#video").find("#jh").attr("src", src);                 // $('#video').load();                  $("#video").trigger('load');                  $("#video").trigger('play');                  }             });           });    

base64 value coming server aaaaggz0exbtcdqyaaaaag1wndfpc29tbnjldm1kyxqaaaaaaaaaeaa= value getting added source <source type="video/mp4" id="jh" src="data:video/mp4;base64,aaaaggz0exbtcdqyaaaaag1wndfpc29tbnjldm1kyxqaaaaaaaaaeaa="> video not getting played. not able trace ,can 1 me?

isn't there solution it??

"...but video not getting played. not able trace it, can 1 me?"

(1) string "aaaaggz0exbtcdqyaaaaag1wndfpc29tbnjldm1kyxqaaaaaaaaaeaa=" provides 41 bytes. not enough play video.

00 00 00 18 66 74 79 70 6d 70 34 32 00 00 00 00         ....ftypmp42.... 6d 70 34 31 69 73 6f 6d 04 d8 e5 76 6d 64 61 74         mp41isom.Øåvmdat 00 00 00 00 00 00 00 10 00                              ......... 

(2) bytes begin mdat (which a/v data mixed in 1 group), decoder needs moov part of file (which has metadata) know frame1 bytes begin/end within mixed mdat section. best make mp4 file moov first, followed mdat.

find fixing tool online keywords : fast start mp4 moov @ front

(3) because mdat first, can see size @ bytes : 04 d8 e5 76 (which means 81.3 mb). must receive around 81 megs before begin having metadata decoder.

decoder needs metadata (stored in moov section, after 81 megs of mdat) before can display or decode sound.


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -