1
我试图在桌面和手机中播放开始和结束时间的YouTube视频(必须在Safari浏览器中)。 我得到这样的YouTube网址表格数据库。如何在桌面设备和ios设备中使用开始和结束时间播放YouTube视频
$video_location='http://www.youtube.com/watch?v=2Tvy_Pbe5NA&start=10&end=29';
我使用下面的代码来播放视频。
if (strpos($video_location,'youtube') !== false)
{
$parsedurl = parse_url("$video_location");
$queryvars = explode("&",$parsedurl["query"]);
$string1 = str_replace("=","/",$queryvars[0]);
$string2 = $queryvars[1]."&".$queryvars[2];
$cleanurl = "http://www.youtube.com/".$string1."&".$string2."&".'version=3';
$videodata = "<embed width=\"100%\" height=\"400px\" src=\"$cleanurl\"
type=\"application/x-shockwave-flash\">
</embed>";
}
else
{
another condition
}
above code is working only in desktops with start and end times but in mobile devices start and end times not working properly.thanks!
我想这个链接, http://www.youtube.com/embed/BmOpD46eZoA?start=36&end=65 ,但它不是在iPhone Safari浏览器上使用开始和结束时间玩 – lalith458
我只是把这个在我safari浏览器在我的iOS7 iPhone和工作正常。正如我在另一个问题中提到的,你的问题在于编码?和&,不在链接中。 –
我在iOS7 iphone上试过这个链接,http://www.youtube.com/embed/BmOpD46eZoA?start = 36&end = 65,从36秒开始播放,但在45秒停止播放完整视频 – lalith458