Commit acde14a
Actually stop the track when the broadcast extension socket is closed (#520)
This closes #446
Two fixes:
~1. It seems that stopping the broadcast via tapping on the system
indicator and choosing "stop broadcast" calls the `broadcastPaused`
method instead of the `broadcastFinished` method on the SampleHandler.
The only way I could trigger `broadcastFinished` in testing was by
locking my device. I could not find a way to trigger `broadcastResumed`
so I just went ahead and treated "pause" as final, and close the socket
(I think maybe this is vestigial from older iterations of ReplayKit? not
sure, it's not an area I'm super familiar with)~
2. When the socket closes the frame reader stops but never notified the
BroadcastScreenCapturer that owns it, so the track would stay published
even as it stopped being updated. This fix adds a new callback method to
pass the closure up the stack and stop the track.
Not sure what happened in original testing but actually
broadcastFinished _is_ called as expected, and broadcastPaused is called
when you open the "stop capture" dialog, not when you finish it. I also
fixed it to properly unpublish the track, not sure why initial testing
showed simply ending capture to be enough.
---------
Co-authored-by: hiroshihorie <[email protected]>1 parent 970e609 commit acde14a
File tree
3 files changed
+24
-0
lines changed- Sources/LiveKit
- Broadcast
- TrackPublications
3 files changed
+24
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
65 | 71 | | |
66 | 72 | | |
67 | 73 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
| 140 | + | |
140 | 141 | | |
141 | 142 | | |
142 | 143 | | |
| |||
227 | 228 | | |
228 | 229 | | |
229 | 230 | | |
| 231 | + | |
230 | 232 | | |
231 | 233 | | |
232 | 234 | | |
| |||
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
108 | 124 | | |
109 | 125 | | |
110 | 126 | | |
| |||
0 commit comments