Comments (9)
Which MediaStreamTrack are we talking about? The want that represents the remote party's media, or the one you write to send media to the remote party?
from aiortc.
I mean the remote/incoming stream. Because I want to detect when an incoming track was ended by the remote party (while the peer connection and stream is still alive).
from aiortc.
OK I'll look into it. Could you elaborate on how you plan to use these events?
The 'ended' event is interesting, but I'm wondering if RemoteStreamTrack.recv()
shouldn't also raise an exception, as otherwise a media consumer will stay blocked forever
from aiortc.
Right, in that case an exception makes sense. An explicit 'ended' event would still be useful, to handle ended remote tracks in a clean way. (In my usecase the remote client should be able to end and switch tracks, while the python client should remove ended remote tracks from its processing pipeline.)
from aiortc.
Thanks for working on that!
I just noticed, that I also need it "the other way round", meaning MediaStreamTrack.stop()
(see here) for local tracks, and perhaps RTCPeerConnection.removeTrack(sender)
(see here). Should I open a new issue for that?
from aiortc.
I'm not done yet with emitting 'ended', there are cases where it won't fire (like tearing down the peer connection while it's running). I also don't understand when 'started' is supposed to fire, the MDN docs say nothing about it, so I guess I need to go look at the actual specs.
When you say you want to call MediaStreamTrack.stop(), is this again on the remote media stream track? What's the purpose?
from aiortc.
I think, 'started' is not an official event on MediaStreamTrack
, only 'mute', 'unmute', 'overconstrained', 'ended', as listed here.
And maybe this helps for the 'ended' event.
MediaStreamTrack.stop()
I want to call on the local track. This should set the track state to 'ended' (see here) and the remote (receiving) client should be able to detect this by an 'ended' event. No further data should be sended through that track.
from aiortc.
OK let's forget about "started" then.
For the second point, as you provide the local track by subclassing MediaStreamTrack
I don't think stop() makes any sense : it would do nothing. My suggestion is for you to instead stop the RTCRtpTransceiver, which will send a BYE to the remote party.
from aiortc.
Great, thanks! I will try that.
from aiortc.
Related Issues (20)
- MediaPlayer HTTP stream from the same EndPoint does work
- Cannot connect to video stream: BINDING ERROR / 400 Bad Request HOT 1
- Can aiortc module be used for professional or semi-professional use?
- Implement MediaStreamTrack.enabled HOT 3
- Setting RTCRtpTransceiver.direction to `inactive` does not have any effect HOT 1
- Issue encountered when installing aiortc from source
- JS and PYTHON communication are available in the LAN, and the Internet connection fails HOT 1
- 'server' example failed when served in a remote machine HOT 2
- example videostream-cli not working HOT 1
- addTrack failing inside datachannel message receive handler
- chopping sounds with AudioStreamTrack HOT 2
- Recording video on server discards beyond a few seconds.
- Combining multiple mp3 files to be returned as a single MediaStreamTrack
- Server Python to Client Python Q/A (INCLUDE FULL SCRIPTS!)
- Webrtc initial negotiation succeeds but renegotiation fails
- Set packet_time = 125 msec instead of 20 msec (both side) HOT 4
- Adding a new track HOT 1
- Bug in filexfer example: filename should be fp?
- How to create ICE candidates? HOT 1
- Problems with ForwardTsnChunk
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aiortc.