1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/interfaces/html/nsIDOMHTMLMediaElement.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,136 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* vim:set ts=2 sw=2 sts=2 et cindent: */ 1.6 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.9 + 1.10 +#include "nsIDOMHTMLElement.idl" 1.11 +#include "nsIDOMMediaError.idl" 1.12 +#include "nsIDOMTimeRanges.idl" 1.13 + 1.14 +interface nsIDOMMediaStream; 1.15 + 1.16 +/** 1.17 + * The nsIDOMHTMLMediaElement interface is an interface to be implemented by the HTML 1.18 + * <audio> and <video> elements. 1.19 + * 1.20 + * For more information on this interface, please see 1.21 + * http://www.whatwg.org/specs/web-apps/current-work/#htmlmediaelement 1.22 + * 1.23 + * @status UNDER_DEVELOPMENT 1.24 + */ 1.25 + 1.26 +// undef the GetCurrentTime macro defined in WinBase.h from the MS Platform SDK 1.27 +%{C++ 1.28 +#ifdef GetCurrentTime 1.29 +#undef GetCurrentTime 1.30 +#endif 1.31 +%} 1.32 + 1.33 +[scriptable, uuid(1f9393e8-2df0-4072-87b9-c26999b09acc)] 1.34 +interface nsIDOMHTMLMediaElement : nsISupports 1.35 +{ 1.36 + // error state 1.37 + readonly attribute nsIDOMMediaError error; 1.38 + 1.39 + // network state 1.40 + attribute DOMString src; 1.41 + attribute nsIDOMMediaStream mozSrcObject; 1.42 + readonly attribute DOMString currentSrc; 1.43 + attribute DOMString crossOrigin; 1.44 + const unsigned short NETWORK_EMPTY = 0; 1.45 + const unsigned short NETWORK_IDLE = 1; 1.46 + const unsigned short NETWORK_LOADING = 2; 1.47 + const unsigned short NETWORK_NO_SOURCE = 3; 1.48 + readonly attribute unsigned short networkState; 1.49 + attribute DOMString preload; 1.50 + readonly attribute nsIDOMTimeRanges buffered; 1.51 + void load(); 1.52 + DOMString canPlayType(in DOMString type); 1.53 + 1.54 + // ready state 1.55 + const unsigned short HAVE_NOTHING = 0; 1.56 + const unsigned short HAVE_METADATA = 1; 1.57 + const unsigned short HAVE_CURRENT_DATA = 2; 1.58 + const unsigned short HAVE_FUTURE_DATA = 3; 1.59 + const unsigned short HAVE_ENOUGH_DATA = 4; 1.60 + readonly attribute unsigned short readyState; 1.61 + readonly attribute boolean seeking; 1.62 + 1.63 + // playback state 1.64 + attribute double currentTime; 1.65 + readonly attribute double duration; 1.66 + readonly attribute boolean paused; 1.67 + attribute double defaultPlaybackRate; 1.68 + attribute double playbackRate; 1.69 + attribute boolean mozPreservesPitch; 1.70 + readonly attribute nsIDOMTimeRanges played; 1.71 + readonly attribute nsIDOMTimeRanges seekable; 1.72 + readonly attribute boolean ended; 1.73 + readonly attribute boolean mozAutoplayEnabled; 1.74 + attribute boolean autoplay; 1.75 + attribute boolean loop; 1.76 + void play(); 1.77 + void pause(); 1.78 + 1.79 + // controls 1.80 + attribute boolean controls; 1.81 + attribute double volume; 1.82 + attribute boolean muted; 1.83 + attribute boolean defaultMuted; 1.84 + 1.85 + // Mozilla extension: stream capture 1.86 + nsIDOMMediaStream mozCaptureStream(); 1.87 + nsIDOMMediaStream mozCaptureStreamUntilEnded(); 1.88 + readonly attribute boolean mozAudioCaptured; 1.89 + 1.90 + // Mozilla extension: return embedded metadata from the stream as a 1.91 + // JSObject with key:value pairs for each tag. This can be used by 1.92 + // player interfaces to display the song title, artist, etc. 1.93 + [implicit_jscontext] 1.94 + jsval mozGetMetadata(); 1.95 + 1.96 + // Mozilla extension: provides access to the fragment end time if 1.97 + // the media element has a fragment URI for the currentSrc, otherwise 1.98 + // it is equal to the media duration. 1.99 + readonly attribute double mozFragmentEnd; 1.100 + 1.101 + // Mozilla extension: an audio channel type for media elements. 1.102 + // An exception is thrown if the app tries to change the audio channel type 1.103 + // without the permission (manifest file for B2G apps). 1.104 + // The supported values are: 1.105 + // * normal (default value) 1.106 + // Automatically paused if "notification" or higher priority channel 1.107 + // is played 1.108 + // Use case: normal applications 1.109 + // * content 1.110 + // Automatically paused if "notification" or higher priority channel 1.111 + // is played. Also paused if another app starts using "content" 1.112 + // channel. Using this channel never affects applications using 1.113 + // the "normal" channel. 1.114 + // Use case: video/audio players 1.115 + // * notification 1.116 + // Automatically paused if "alarm" or higher priority channel is played. 1.117 + // Use case: New email, incoming SMS 1.118 + // * alarm 1.119 + // Automatically paused if "telephony" or higher priority channel is 1.120 + // played. 1.121 + // User case: Alarm clock, calendar alarms 1.122 + // * telephony 1.123 + // Automatically paused if "ringer" or higher priority 1.124 + // channel is played. 1.125 + // Use case: dialer, voip 1.126 + // * ringer 1.127 + // Automatically paused if "publicnotification" or higher priority 1.128 + // channel is played. 1.129 + // Use case: dialer, voip 1.130 + // * publicnotification 1.131 + // Always plays in speaker, even when headphones are plugged in. 1.132 + // Use case: Camera shutter sound. 1.133 + attribute DOMString mozAudioChannelType; 1.134 + 1.135 + // In addition the media element has this new events: 1.136 + // * onmozinterruptbegin - called when the media element is interrupted 1.137 + // because of the audiochannel manager. 1.138 + // * onmozinterruptend - called when the interruption is concluded 1.139 +};