Exemplo n.º 1
0
 def test_audio_and_video(self):
     recorder = MediaBlackhole()
     recorder.addTrack(AudioStreamTrack())
     recorder.addTrack(VideoStreamTrack())
     run(recorder.start())
     run(asyncio.sleep(2))
     run(recorder.stop())
Exemplo n.º 2
0
 def test_audio_remove_track(self):
     recorder = MediaBlackhole()
     track = AudioStreamTrack()
     recorder.addTrack(track)
     recorder.start()
     run(asyncio.sleep(1))
     recorder.removeTrack(track)
     run(asyncio.sleep(1))
     recorder.stop()
Exemplo n.º 3
0
    def test_video_ended(self):
        track = VideoStreamTrack()

        recorder = MediaBlackhole()
        recorder.addTrack(track)
        run(recorder.start())
        run(asyncio.sleep(1))
        track.stop()
        run(asyncio.sleep(1))

        run(recorder.stop())
Exemplo n.º 4
0
    async def test_audio_ended(self):
        track = AudioStreamTrack()

        recorder = MediaBlackhole()
        recorder.addTrack(track)
        await recorder.start()
        await asyncio.sleep(1)
        track.stop()
        await asyncio.sleep(1)

        await recorder.stop()
Exemplo n.º 5
0
 async def addRemoteTrack(track: MediaStreamTrack) -> None:
     recvTracks[track.id] = track
     blackhole = MediaBlackhole()
     blackhole.addTrack(track)
     await blackhole.start()
Exemplo n.º 6
0
 async def test_video(self):
     recorder = MediaBlackhole()
     recorder.addTrack(VideoStreamTrack())
     await recorder.start()
     await asyncio.sleep(2)
     await recorder.stop()
Exemplo n.º 7
0
 async def test_audio(self):
     recorder = MediaBlackhole()
     recorder.addTrack(AudioStreamTrack())
     await recorder.start()
     await asyncio.sleep(1)
     await recorder.stop()