开发者

embed code in AJAX error

开发者 https://www.devze.com 2023-04-01 03:56 出处:网络
I\'m trying to make the embed by using AJAX to call the embed code because I have many channels and I don\'t want to use PHP echo

I'm trying to make the embed by using AJAX to call the embed code because I have many channels and I don't want to use PHP echo

I use this code

embedios="<video x-webkit-airplay=\"allow\"> ";
embedios=embedios+"<source src=\""+stream+"\" type=\"video/mp4\"> ";
embedios=embedios+"&l开发者_运维百科t;!-- other sources and fallbacks go here --></video> ";
embed=embedios;

and the problem is that the output come out like this

<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>

but instead I want it to come out like this

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

I dont know what I did wrong in this code


You aren't terminating your strings:

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;


Your quotes are not matching properly.

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

精彩评论

暂无评论...
验证码 换一张
取 消