Jump to content

video tag html5 with src from base64_encode not work on different device&browser


rey1024

Recommended Posts

i try this code.

<video width="320" height="240"  controls="controls" autobuffer="autobuffer">
<source src="data:video/mp4;base64,AAAA<?php echo   chunk_split(base64_encode(trim(file_get_contents('kecak.mp4'))));  ?>" type="video/mp4" /> 
Your browser does not support the video tag.
</video>

 

it's work when i play in Notebook(safari, firefox) but not work when i play on IPAD2(safari) or Samsung Galaxy(Opera).

i think the problem is in

src="data:video/mp4;base64,AAAA<?php echo chunk_split(base64_encode(trim(file_get_contents('kecak.mp4'))));  ?>

because when i replace with

src="kecak.mp4"

it's work at all device and browser. i must use base64_encode(trim(file_get_contents('kecak.mp4'))) because in real my case it's come from response from RESTFul to delivery video via http. string response from http same with base64_encode(trim(file_get_contents('kecak.mp4'))). thanks u for help :-)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.