如何使用FlvPlayBack回放和直播视频?

发布于 2024-10-03 05:23:39 字数 55 浏览 0 评论 0原文

我希望它自动检测是否有直播视频,然后播放直播;否则播放。

怎样才能做到这一点呢?

I want it to automatically detect if there's a live video,then play live;otherwise play back.

How to do it that way?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

小忆控 2024-10-10 05:23:39

礼貌地询问服务员?

(不,这是实际的答案)

编辑:我的意思是(因为有人显然不明白)在服务器上保留一个变量,例如isLive,它将根据关于某物是否存在。然后,在开始传输任何内容之前,请在客户端中进行检查(可能使用简单的 HTTP 请求)。如果有东西正在直播,则再次发送 HTTP 请求,例如“liveStream.php”,如果没有则“some-other-video.flv”...

此外,如果没有东西正在直播,但仍会发送对 liveStream.php 的请求,只需传输“离线媒体”之类的内容即可。

为了确保实时流自动关闭(在客户端),请定期检查 isLive 变量(例如 10 秒间隔),或者(如果您有 FMS,或任何真正与 OSMF 配合使用的东西)使用可以以 FLV 格式沿着 A/V 传输的元数据。

Politely ask the server?

(no that is the actual answer)

EDIT: I MEANT (as someone apparently does not understand) to keep a variable on the server, like isLive, which will be changed based on if something IS live or not. Then, before you start to stream anything, check for that in the client, maybe using a simple HTTP request. If something is live, again, HTTP request for something like "liveStream.php", if not then "some-other-video.flv"...

Also, if nothing is live, but the request for liveStream.php is still sent, just transmit something like "media offline" or whatever.

To ensure the live stream automatically turns off (in client), either check for the isLive variable periodically (like 10 second interval), or (IF you have got FMS, or anything that works with OSMF really) use the metadata that can be transmitted along A/V in FLV format.

淡淡離愁欲言轉身 2024-10-10 05:23:39

目前,无法检测流是否实时。您需要将某种元数据传递到播放器中(如 Aurel300 建议的那样)。

-安德里安

Currently, there is no way to detect if a stream is live or not. You need some kind of metadata passed into the player (like Aurel300 suggested).

-Andrian

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文