blob: 401060a6f7b7dba651c8f393986d581b48c1c507 [file] [log] [blame]
// 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
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// See the License for the specific language governing permissions and
// limitations under the License.
interface HTMLMediaElement : HTMLElement {
// error state
readonly attribute MediaError? error;
// network state
attribute DOMString src;
readonly attribute DOMString currentSrc;
attribute DOMString? crossOrigin;
const unsigned short NETWORK_EMPTY = 0;
const unsigned short NETWORK_IDLE = 1;
const unsigned short NETWORK_LOADING = 2;
const unsigned short NETWORK_NO_SOURCE = 3;
readonly attribute unsigned short networkState;
readonly attribute TimeRanges buffered;
void load();
// The keySystem argument is an extension defined in Encrypted Media Extensions.
DOMString canPlayType(DOMString type, optional DOMString keySystem);
// ready state
const unsigned short HAVE_NOTHING = 0;
const unsigned short HAVE_METADATA = 1;
const unsigned short HAVE_CURRENT_DATA = 2;
const unsigned short HAVE_FUTURE_DATA = 3;
const unsigned short HAVE_ENOUGH_DATA = 4;
readonly attribute unsigned short readyState;
readonly attribute boolean seeking;
// playback state
[RaisesException] attribute double currentTime;
readonly attribute double duration;
Date getStartDate();
readonly attribute boolean paused;
attribute double defaultPlaybackRate;
attribute double playbackRate;
readonly attribute TimeRanges played;
readonly attribute TimeRanges seekable;
readonly attribute boolean ended;
attribute boolean autoplay;
attribute boolean loop;
void play();
void pause();
// controls
attribute boolean controls;
[RaisesException] attribute double volume;
attribute boolean muted;
// non standard, semicolon separated names of audio connectors, like
// "hdmi;bluetooth". It raises `NotSupportedError` on apps doesn't support
// this feature, or `InvalidStateError` if there isn't an active playback.
// TODO(b/267678497): The current interface is tentative, to be refined.
[RaisesException] readonly attribute DOMString h5vccAudioConnectors;