很震撼的HTML5视频播放器,电影院的感觉

时间:2022-11-24 16:31:40

效果很震撼!有电影院的感觉了。呵呵。

看了下代码,依然是 在一个canvas里嵌入<video>然后getImageData

点击这里查看效果

代码:

var canvas = document.createElement('canvas'), 

video = document.getElementsByTagName('video')[0],
ctx = canvas.getContext('2d');
ctx.drawImage(video, 0, 0, video.width, video.height);
var block_width = 50;
var pixels = ctx.getImageData(0, 0, block_width, canvas.height);
//http://www.cnblogs.com/roucheng/