diff --git a/rtcllm/aav.py b/rtcllm/aav.py index 373319e..4b5b658 100644 --- a/rtcllm/aav.py +++ b/rtcllm/aav.py @@ -5,8 +5,9 @@ from aiortc import VideoStreamTrack, AudioStreamTrack class MyMediaPlayer(MediaPlayer): pass -class MyTrackBase: +class MyTrackBase(MediaStreamTrack): def __init__(self, source=None): + super().__init__() self.reloaded = False self.source = source self.set_track() @@ -38,12 +39,8 @@ class MyTrackBase: return f -class MyAudioStreamTrack(AudioStreamTrack, MyTrackBase): - def __init__(self, source=None): - AudioStreamTrack.__init__(self) - MyTrackBase.__init__(self, source=source) +class MyAudioStreamTrack(MyTrackBase): + kind = 'audio' class MyVideoStreamTrack(VideoStreamTrack, MyTrackBase): - def __init__(self, source=None): - VideoStreamTrack.__init__(self) - MyTrackBase.__init__(self, source=source) + kind = 'video'