This commit is contained in:
yumoqing 2024-09-11 14:13:26 +08:00
parent 46dbb582dd
commit 85cdbcbbad

View File

@ -103,11 +103,11 @@ class LoopingVideoTrack(VideoStreamTrack):
def __init__(self, filename):
super().__init__()
self.player = MyMediaPlayer(filename)
self.iteration = 0
print(dir(self.player)
async def recv(self):
frame = await self.player.video.recv()
print(f'{self.__class__.__name__}, {self.player.video.readyState}')
print(f'{self.__class__.__name__}, {self.source.duration=}, {self.source.time=}')
if self.player.video.readyState != 'live':
self.player = MyMediaPlayer(self.player._file_path)
frame = await self.player.video.recv()