// Copyright 2015 The Cobalt Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// https://www.w3.org/TR/media-source/#idl-def-mediasource
// https://www.w3.org/TR/2016/CR-media-source-20160705/#idl-def-MediaSource

[Constructor] interface MediaSource : EventTarget {
  // All the source buffers created by this object.
  readonly attribute SourceBufferList sourceBuffers;
  // Subset of sourceBuffers that provide data for the selected/enabled tracks.
  readonly attribute SourceBufferList activeSourceBuffers;

  readonly attribute MediaSourceReadyState readyState;
  [RaisesException] attribute unrestricted double duration;

  [RaisesException] SourceBuffer addSourceBuffer(DOMString type);
  [RaisesException] void removeSourceBuffer(SourceBuffer sourceBuffer);

  [RaisesException] void endOfStream(optional MediaSourceEndOfStreamError error);

  [Conditional=COBALT_MEDIA_SOURCE_2016, RaisesException]
      void setLiveSeekableRange(double start, double end);
  [Conditional=COBALT_MEDIA_SOURCE_2016, RaisesException]
      void clearLiveSeekableRange();

  [CallWith=EnvironmentSettings] static boolean isTypeSupported(DOMString type);
};
