mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Add track_list
member to AudioTrack, VideoTrack, TextTrack structs
Add member to the track structs pointing at their associated tracklist and update it when the track is added or removed from a tracklist.
This commit is contained in:
parent
43a5f65940
commit
9b59b9602c
8 changed files with 58 additions and 8 deletions
|
@ -94,6 +94,7 @@ impl TextTrackList {
|
|||
}),
|
||||
&canceller,
|
||||
);
|
||||
track.add_track_list(self);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -101,6 +102,9 @@ impl TextTrackList {
|
|||
// removed from the TextTrackList.
|
||||
#[allow(dead_code)]
|
||||
pub fn remove(&self, idx: usize) {
|
||||
if let Some(track) = self.dom_tracks.borrow().get(idx) {
|
||||
track.remove_track_list();
|
||||
}
|
||||
self.dom_tracks.borrow_mut().remove(idx);
|
||||
self.upcast::<EventTarget>()
|
||||
.fire_event(atom!("removetrack"));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue