Detect support for drawImage from video element
I'm trying to write a video viewer that draws parts of a video element onto an HTML canvas using drawImage
, but this is not supported on some devices (iOS, for example). Rather than sniffing the browser/OS, I'd rather do feature detection and fall back to just playing the normal video on these devices. Is there a reliable way to test for this functionality?
check this:
function isCanvasSupported()
{
var canvas = document.createElement('canvas');
return !!(canvas.getContext && canvas.getContext('2d'));
};
This will return true if canvas is supported otherwise false.
链接地址: http://www.djcxy.com/p/84080.html上一篇: 是否支持Silverlight?
下一篇: 检测对视频元素的drawImage的支持