1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #include "mozilla/dom/AudioTrack.h"
7 #include "mozilla/dom/AudioTrackList.h"
8 #include "mozilla/dom/AudioTrackListBinding.h"
10 namespace mozilla::dom
{
12 JSObject
* AudioTrackList::WrapObject(JSContext
* aCx
,
13 JS::Handle
<JSObject
*> aGivenProto
) {
14 return AudioTrackList_Binding::Wrap(aCx
, this, aGivenProto
);
17 AudioTrack
* AudioTrackList::operator[](uint32_t aIndex
) {
18 MediaTrack
* track
= MediaTrackList::operator[](aIndex
);
19 return track
->AsAudioTrack();
22 AudioTrack
* AudioTrackList::IndexedGetter(uint32_t aIndex
, bool& aFound
) {
23 MediaTrack
* track
= MediaTrackList::IndexedGetter(aIndex
, aFound
);
24 return track
? track
->AsAudioTrack() : nullptr;
27 AudioTrack
* AudioTrackList::GetTrackById(const nsAString
& aId
) {
28 MediaTrack
* track
= MediaTrackList::GetTrackById(aId
);
29 return track
? track
->AsAudioTrack() : nullptr;
32 } // namespace mozilla::dom