升级playblock

This commit is contained in:
dexter
2022-03-27 11:37:19 +08:00
parent 40a9b74ea4
commit 3aee7da66f
5 changed files with 109 additions and 3 deletions

View File

@@ -64,7 +64,7 @@ type ISubscriber interface {
getIO() *IO[config.Subscribe, ISubscriber]
GetConfig() *config.Subscribe
IsPlaying() bool
PlayBlock(ISubscriber)
PlayBlock()
Stop()
}
type TrackPlayer struct {
@@ -197,7 +197,12 @@ func (s *Subscriber) Play(spesic ISubscriber) func() error {
}
//PlayBlock 阻塞式读取数据
func (s *Subscriber) PlayBlock(spesic ISubscriber) {
func (s *Subscriber) PlayBlock() {
spesic := s.Spesic
if spesic == nil {
s.Error("play before subscribe")
return
}
s.Info("playblock")
var t time.Time
var startTime time.Time //读到第一个关键帧的时间