我想拥有用于图像,音频和视频图标的HTML实体代码。我在网站上看到了这一点,但它无效// to visualise with red and blue lines.
var x = Math.cos(Math.atan2(0.5,-1))*150 + 230;
var y = Math.sin(Math.atan2(0.5,-1))*150 + 50;
ctx.strokeStyle = 'red';
ctx.beginPath();
ctx.moveTo(x, y); // no guessing
ctx.lineTo(x + Math.cos(Math.atan2(0.5,1))*200, y + Math.sin(Math.atan2(0.5,1))*200); //
ctx.stroke();
var x = Math.cos(Math.atan2(0.5,1))*100 + 230;
var y = Math.sin(Math.atan2(0.5,1))*100 + 50;
ctx.strokeStyle = 'blue';
ctx.beginPath();
ctx.moveTo(x, y); //
ctx.lineTo(x + Math.cos(Math.atan2(0.5,-1))*300, y + Math.sin(Math.atan2(0.5,-1))*300); //
ctx.stroke();
,&audio;
,ℑ
。请有人对这些有更好的线索吗?
答案 0 :(得分:1)
对于音频和视频,您可以使用html5
<video src="http://v2v.cc/~j/theora_testsuite/320x240.ogg" controls>
Your browser does not support the <code>video</code> element.
</video>
<audio src="/test/audio.ogg">
<p>Your browser does not support the <code>audio</code> element.</p>
</audio>
这是MDN的形式
https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Using_HTML5_audio_and_video
答案 1 :(得分:1)
如果需要,您也可以使用iframe标签!