mirror of
https://github.com/servo/servo.git
synced 2025-08-08 06:55:31 +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
|
@ -104,9 +104,14 @@ impl AudioTrackList {
|
|||
|
||||
pub fn add(&self, track: &AudioTrack) {
|
||||
self.tracks.borrow_mut().push(Dom::from_ref(track));
|
||||
track.add_track_list(self);
|
||||
}
|
||||
|
||||
pub fn clear(&self) {
|
||||
self.tracks
|
||||
.borrow()
|
||||
.iter()
|
||||
.for_each(|t| t.remove_track_list());
|
||||
self.tracks.borrow_mut().clear();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue