【发布时间】:2015-03-09 07:28:29
【问题描述】:
我正在尝试根据流媒体频道的状态有条件地将播放列表请求重定向到一个或另一个列表。
现在,这就是我正在测试的,它没有播放任何东西。我试着用 VLC 和 Kodi 来称呼它。我的目的是完成这项工作,以便在流离线时重定向到备用流。
CURL 遵循重定向,Kodi 日志表明它也遵循重定向,但不播放任何内容,无论是直播还是离线。
这是this script的代码。你可以用 CURL 调用它,这样你就可以检查发生了什么。或者复制此代码并使用您自己的流进行尝试。
<?php
$stream_status = json_decode(file_get_contents("http://api.ustream.tv/json/channel/canal3pichilemu-stream/getValueOf/status?key=<my_key>"));
if($stream_status->results == "offline") {
header("Location: http://vivo.pichilemutv.org/offline/playlist.m3u8", false, 302);
} else {
header("Location: http://iphone-streaming.ustream.tv/uhls/15179897/streams/live/iphone/playlist.m3u8", false, 302);
}
die();
我想知道我错过了什么,因为重定向似乎有效,但流无法播放。
【问题讨论】:
-
您找到解决方案了吗?我有同样的问题,kodi 和 vlc 没有播放重定向流!
标签: php redirect curl http-live-streaming