Wednesday, 15 September 2010

django - Send out base64 string to html5 player "media resource could not be decoded" -



django - Send out base64 string to html5 player "media resource could not be decoded" -

i have uploaded video base64 string stored in gridfs , have django view can set chunks together.

def servevideo(request, *args, **kwargs): info = '' m = multimedia.objects.get(id = args[0]) chunks = client.db.fs.chunks.find({"files_id":objectid(m.media.grid_id)}) chunk in chunks: info = info + chunk['data'] response = httpresponse("data:video/webm;base64,"+data.split(",")[1], content_type='video/webm') homecoming response

so on client side have this:

<video width="500" height="500" controls> <source src="/videos/{{ post.video }}/" type="video/webm"> browser not back upwards video tag. </video>

but doesn't seem work, i'm getting error in web console "media resource not decoded".

note: when straight feed base64 string src attribute works fine.( there no problem base64 info of video ).

django html5 video-streaming base64 gridfs

No comments:

Post a Comment