Javascript 如何通过HTML5将视频添加到3D多维数据集
我正在尝试用图像替换3D立方体,并在每个面上添加视频,我在尝试找出如何用html视频元素标记替换html标记时遇到问题 我的JSFIDLE可以在下面看到 这是创建图像的代码的开头Javascript 如何通过HTML5将视频添加到3D多维数据集,javascript,html,3d,Javascript,Html,3d,我正在尝试用图像替换3D立方体,并在每个面上添加视频,我在尝试找出如何用html视频元素标记替换html标记时遇到问题 我的JSFIDLE可以在下面看到 这是创建图像的代码的开头 function start3d(texture_image) { var screen_canvas = document.getElementById('canvas'); 这是我的代码的底部,图像正在加载 var img = new Image(); img.
function start3d(texture_image) {
var screen_canvas = document.getElementById('canvas');
这是我的代码的底部,图像正在加载
var img = new Image();
img.onload = function() { start3d(img); };
img.src = 'http://content.bitsontherun.com/thumbs/3XnJSIm4-640.jpg';</script>
var img=newimage();
img.onload=function(){start3d(img);};
img.src=http://content.bitsontherun.com/thumbs/3XnJSIm4-640.jpg';
我知道如何通过html5创建和加载视频,但将其放在每个立方体上有点不同。。在此方面的任何帮助都将不胜感激!!谢谢将此代码放入您的div中
<object width="400" height="400"><param name="movie" value="http://www.youtube.com/v/YLorLVa95Xo?fs=1&hl=en_GB&rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/YLorLVa95Xo?fs=1&hl=en_GB&rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="400" height="400"></embed></object>
或者使用javascript在多维数据集类的第二个div上设置videeo(如果在html正文中有):
$('.cube > div').eq(1).html('<object width="360" height="360"><param name="movie" value="http://www.youtube.com/v/YLorLVa95Xo?fs=1&hl=en_GB&rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/YLorLVa95Xo?fs=1&hl=en_GB&rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="360" height="360"></embed></object>');
$('.cube>div').eq(1.html('');
它在chrome中运行良好,如果它在safari和firefox中运行,请回复