diyroms 发表于 2023-9-25 10:11

求教php高手关于rtmp协议源静态写php

本帖最后由 diyroms 于 2023-9-25 10:15 编辑

济铁电视,rtmp://alivealone.litenews.cn/303/8876f9ea0ce6400d9b1e54a129ff1c0c
济阳综合,rtmp://jsylivealone.iqilu.com/live/jiyang_tv01
济阳影视,rtmp://jsylivealone.iqilu.com/live/jiyang_tv02

像这种静态源想写成php,但是好像这个协议写出来播放不了,请问如何可以在tvbox等播放器播放
写php目的便于自己管理,防止被贩卖等


diyroms 发表于 2023-9-25 10:13

<?php
$id = isset($_GET['id']) ? $_GET['id'] : 'sdzy';

// Define an associative array of channel IDs and their corresponding RTMP URLs
$channels = [
    'sdzy' => 'rtmp://livealone.iqilu.com/iqilu/zypdhjOF03kn'
];

// Check if the provided ID exists in the channels array
if (isset($channels[$id])) {
    $channelUrl = $channels[$id];
    // Redirect to the corresponding M3U8 URL for the selected channel
    header("Location: $channelUrl");
    exit;
} else {
    // If the ID is not found, you can handle it as you prefer (e.g., show an error message)
    echo "Channel not found";
}
?>

mxwz 发表于 2023-9-25 10:22

rtmp在php中不能跳转播放

diyroms 发表于 2023-9-25 10:38

mxwz 发表于 2023-9-25 10:22
rtmp在php中不能跳转播放

有解决办法没

林大大 发表于 2023-9-25 10:49

这些本身就有http的PHPhttps://www.right.com.cn/forum//mobcent//app/data/phiz/default/04.png

diyroms 发表于 2023-9-25 11:00

林大大 发表于 2023-9-25 10:49
这些本身就有http的PHP

但是无法播放 何解

EScZkc_1d8 发表于 2023-9-25 11:56

diyroms 发表于 2023-9-25 11:00
但是无法播放 何解

他说的是你直接用这些播放链接的HTTP版本地址,不要用RTMP。

diyroms 发表于 2023-9-25 12:48

EScZkc_1d8 发表于 2023-9-25 11:56
他说的是你直接用这些播放链接的HTTP版本地址,不要用RTMP。

http地址有么

diyroms 发表于 2023-9-25 12:49

本帖最后由 diyroms 于 2023-9-25 14:59 编辑

EScZkc_1d8 发表于 2023-9-25 11:56
他说的是你直接用这些播放链接的HTTP版本地址,不要用RTMP。
像这样么?

EScZkc_1d8 发表于 2023-9-25 12:51

diyroms 发表于 2023-9-25 12:49
像这样么?

iqilu的代理论坛有人发过,你一搜就有了。

diyroms 发表于 2023-9-25 13:02

EScZkc_1d8 发表于 2023-9-25 12:51
iqilu的代理论坛有人发过,你一搜就有了。

那个用过了,没静态稳定 不定期放不出来

zsz520 发表于 2023-9-25 13:22

一样,rtsp也不支持,等解决

patty 发表于 2023-9-25 19:53

可以作为URL参数作为跳转地址,不过需要APP做相应处理才行

howeasytech 发表于 2023-9-25 23:08

diyroms 发表于 2023-9-25 12:48
http地址有么

把rtmp改成http,最后加.flv就可以了
页: [1]
查看完整版本: 求教php高手关于rtmp协议源静态写php