1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim:set ts=2 sw=2 et tw=78: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_dom_VideoTrackList_h
8 #define mozilla_dom_VideoTrackList_h
10 #include "MediaTrack.h"
11 #include "MediaTrackList.h"
18 class VideoTrackList
: public MediaTrackList
{
20 VideoTrackList(nsIGlobalObject
* aOwnerObject
, HTMLMediaElement
* aMediaElement
)
21 : MediaTrackList(aOwnerObject
, aMediaElement
), mSelectedIndex(-1) {}
23 JSObject
* WrapObject(JSContext
* aCx
,
24 JS::Handle
<JSObject
*> aGivenProto
) override
;
26 VideoTrack
* operator[](uint32_t aIndex
);
28 void RemoveTrack(const RefPtr
<MediaTrack
>& aTrack
) override
;
30 void EmptyTracks() override
;
32 VideoTrack
* GetSelectedTrack();
35 int32_t SelectedIndex() const { return mSelectedIndex
; }
37 VideoTrack
* IndexedGetter(uint32_t aIndex
, bool& aFound
);
39 VideoTrack
* GetTrackById(const nsAString
& aId
);
41 friend class VideoTrack
;
44 VideoTrackList
* AsVideoTrackList() override
{ return this; }
47 int32_t mSelectedIndex
;
51 } // namespace mozilla
53 #endif // mozilla_dom_VideoTrackList_h