javascript - Can I have a mp4 video with transparent background using HTML5 video tag? -


i have tried here url : check link in myh local system can't see video. atleast jsfidlle show video.

<h1>html5 video alpha transparency</h1> <div>   <video id="video" style="display:none" autoplay>     <source src="http://jakearchibald.com/scratch/alphavid/compressed.mp4" type='video/mp4; codecs="avc1.42e01e"' />     <source src="http://jakearchibald.com/scratch/alphavid/compressed.ogv" type='video/ogg; codecs="theora, vorbis"' />   </video>   <canvas width="480" height="488" id="buffer"></canvas>   <canvas width="480" height="244" id="output"></canvas> </div> <p> <a href="#" id="randombg">random background colour</a> - <a href="#" id="stop">stop</a> - <a href="#" id="start">start</a> - <a href="#" id="toggleprocessing">toggle processing</a> </p> 

the main problem here cors or cross-origin resource sharing. if video loaded different server page, considered cross-origin.

also, browsers consider loaded file:// cross-origin.

when pixels extracted cors must fulfilled. means either video loaded same origin (usually server) page. in case can download videos local disc loaded same place test page.

or, server hosting videos allows cross-origin use, not case here not option. alternative find host or cdn allows cors usage.

you must make sure page loaded localhost (127.0.0.1) setting local server or use ide built-in 1 (webstorm, visual studio etc.).


Comments

Popular posts from this blog

javascript - Google App Script ContentService downloadAsFile not working -

javascript - Function overwritting -

php - Find a regex to take part of Email -