Coder Social home page Coder Social logo

Comments (4)

xia-chu avatar xia-chu commented on June 19, 2024

你可以参考这个代码 控制无人观看时停止产生流:
image

还有参考这个代码,在有人观看时开始产生流:
image

需要指出的是,播放rtmp、rtsp、http-flv时才会触发这两个事件,播放hls不能触发这两个事件。
由于hls产生时间较长,不是一时半会就能生成的,而且实现按需产生流的机制也很复杂,所以目前hls不能触发这两个事件。

from zlmediakit.

cleverdouble avatar cleverdouble commented on June 19, 2024

我这边就想定时获取一下客户端连接的状态,如果flv的话是不是直接走readerCount就可以了?hls就暂时没有办法获取客户端访问状态了吗?

from zlmediakit.

xia-chu avatar xia-chu commented on June 19, 2024

是的 目前ZLMediaKit内部的实时内存流是通过MediaSource对象管理的,http-flv和rtmp共用的RtmpMediaSource。你可以根据app、流id 找到相应的RtmpMediaSource,然后根据readerCount方法就能知道总共有多少个播放器。

hls的播放机制是文件式,根http-flv、rtmp、rtsp完全不一样,目前还未实现链接数统计功能

from zlmediakit.

cleverdouble avatar cleverdouble commented on June 19, 2024

好的,你的回答解决了我的疑问,多谢啦~~~

from zlmediakit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.