2011-09-01 117 views
0

我试图通过使用AJAX调用嵌入代码,因为我有很多渠道,使嵌入,我不希望使用PHP呼应嵌入代码

我使用此代码

embedios="<video x-webkit-airplay=\"allow\"> "; 
embedios=embedios+"<source src=\""+stream+"\" type=\"video/mp4\"> "; 
embedios=embedios+"<!-- other sources and fallbacks go here --></video> "; 
embed=embedios; 

和问题是输出出来这样

<video x-webkit-airplay="allow" tabindex="0"> 
<source type="video/mp4" src="http://yoursn0w.com/ch3.m3u8 "></source> 
<!-- other sources and fallbacks go here --> 
</video> 

,而是我希望它出来像这样

<video x-webkit-airplay="allow"> 
    <source src="http://yoursn0w.com/ch3.m3u8" type="video/mp4"> 
    <!-- other sources and fallbacks go here --> 
</video> 

我不知道我在代码中做了什么错误

+1

能否请您更详细的与你的问题你在做什么?什么是流如此。 –

+0

抱歉,我已编辑上面的代码。 – Ali

回答

1

您还没有终止你的字符串:

embedios="<video x-webkit-airplay=\"allow\">" 
embedios=embedios+"<source src=\""+stream+"\" type=\"video/mp4\">" 
embedios=embedios+"<!-- other sources and fallbacks go here --></video>" 
embed=embedios; 
+0

非常感谢您为我工作! – Ali

+1

您应该可以在视频标签中放入'px'。因此,width = \“635 \”height = \“448 \” – Joe

+0

对不起,我只是认为视频标签应该放在airplay线上而不是soruce线^^“所以现在一切正常:D – Ali

1

您的报价不正确匹配。

var embedios='<video x-webkit-airplay=\"allow\">' 
embedios=embedios+'<source src=\""+stream+"\" type=\"video/mp4\">' 
embedios=embedios+'<!-- other sources and fallbacks go here --></video>' 
embed=embedios; 
+0

我试过你和你的输出像这样 在此输入代码 Ali