java - Adding src to the video source is not working when base64 is added to the src -


i retrieving video oracle database using java , sending response base64 value here java code

protected void doget(httpservletrequest request, httpservletresponse response) throws servletexception, ioexception      {   string video64="";        system.out.println("service");         try {                preparedstatement ps=cn.preparestatement("select * video ");             resultset rs=ps.executequery();             rs.next();             blob vedio=rs.getblob(1);             system.out.println("try");             if(vedio !=null)                {             byte videobytes[]=vedio.getbytes(1,(int)vedio.length());             video64 = datatypeconverter.printbase64binary(videobytes);             }          } catch (sqlexception e) {               // todo auto-generated catch block             e.printstacktrace();         }         system.out.println(video64);           response.getwriter().write(video64);           }  here html  <video controls>    <source type="video/mp4"  id="v">  </video> 

i using ajax call send request , adding response <source type="video/mp4" id="v"> using jquery here ajax

$("#sub").click(function(){           $.ajax({                 url:"retrivevedio",                 method: "get",                 datatype: 'text',                  success:function(response){                     console.log(response);                     $("#v").attr("src",'data:video/mp4;base64,'+response);                     $("#v").load();                 }            });          });   

but src not getting added source , , base64 value not working video tag base64 value getting response aaaaggz0exbtcdqyaaaaag1wndfpc29tbnjldm1kyxqaaaaaaaaaeaa= problem this?


Comments

Popular posts from this blog

Sort a complex associative array in PHP -

vb.net - How to ignore if a cell is empty nothing -

recursion - Can every recursive algorithm be improved with dynamic programming? -