Search completed in 0.98 seconds.
<track>: The Embed Text Track element - HTML: Hypertext Markup Language
the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories none permitted content none, it is an empty element. tag omission as it is a void element, the start tag must be present and the end tag must not be present. permitted parents a media element, <audio> or <video>. ...
...ries none permitted content none, it is an empty element. tag omission as it is a void element, the start tag must be present and the end tag must not be present. permitted parents a media element, <audio> or <video>. implicit aria role no corresponding role permitted aria roles no role permitted dom interface html
trackelement attributes this element includes the global attributes. default this attribute indicates that the
track should be enabled unless the user's preferences indicate that another
track is more appropriate. this may only be used on one
track element per media element. kind how the text
track is meant to be used. if omitted the default kind is subtitles. if the attribute contains an...
...cate the cue's source (e.g. music, text, character). suitable for users who are deaf or when the sound is muted. descriptions textual description of the video content. suitable for users who are blind or where the video cannot be seen. chapters chapter titles are intended to be used when the user is navigating the media resource. ...
...And 14 more matches
RTCTrackEventInit.track - Web APIs
candidate recommendation initial specification. ...
... candidate recommendation initial specification. ...
... candidate recommendation initial specification. ...
...And 11 more matches
TextTrackList: removeTrack event - Web APIs
the remove
track event is fired when a
track is removed from a text
tracklist. ...
... the remove
track event is fired when a
track is removed from a text
tracklist. ...
... the remove
track event is fired when a
track is removed from a text
tracklist. ...
...And 3 more matches
MediaStreamTrackAudioSourceOptions.mediaStreamTrack - Web APIs
the mediastream
trackaudiosourceoptions dictionary's mediastream
track property must contain a reference to the mediastream
track from which the mediastream
trackaudiosourcenode being created using the mediastream
trackaudiosourcenode() constructor. syntax mediastream
trackaudiosourceoptions = { mediastream
track: audiosource
track; } mediastream
trackaudiosourceoptions.mediastream
track = audiosource
track; value a mediastream
track from which the audio output of the new mediastream
trackaudiosourcenode will be taken. example this example uses getusermedia() to obtain access to the user's camera, then creates a new mediastreamaudiosourcenode from the first audio
track provided by the device. let audioctx = new (window.audiocontext || window.webkitaudiocontext)(); if (navigator.mediadevices.getu...
...access to the user's camera, then creates a new mediastreamaudiosourcenode from the first audio
track provided by the device. ...
...amera, then creates a new mediastreamaudiosourcenode from the first audio
track provided by the device. ...
...And 2 more matches
AudioTrackList.getTrackById() - Web APIs
the audio
tracklist method get
trackbyid() returns the first audio
track object from the
track list whose id matches the specified string. this lets you find a specified
track if you know its id string. syntax var the
track = audio
tracklist.get
trackbyid(id); paramters id a domstring indicating the id of the
track to locate within the
track list. return value an audio
track object indicating the first
track found within the audio
tracklist whose id matches the specified string. if no match is found, this method returns null. the
tracks are searched in their natural order; that is, in the order defined by the media resource itself, or, if the resource doesn't define an order, the relative order in which the
tracks are declared by the media resource. example this example suggests a hypothe...
...this function allows the game to disable a specific character's audio in order to adjust the movie's performance based on occurrences within the game; if the character's dialog isn't relevant, it gets left out. obviously that would require some clever graphic design to make work, but... ...
...and so forth. this function allows the game to disable a specific character's audio in order to adjust the movie's performance based on occurrences within the game; if the character's dialog isn't relevant, it gets left out. obviously that would require some clever graphic design to make work, but... it's a hypothetical game. function disablecharacter(videoelem, charactername) { videoelem.audio
tracks.get
trackbyid(charactername).enabled = false; } this short function gets the audio
tracklist containing the video's audio
tracks using htmlmediaelement.audio
tracks, then calls get
trackbyid() on it, specifying the character's name. the resulting
track's audio is then disabled by setting its enabled flag to false. specifications specification status comment html livin...
...led = false; } this short function gets the audio
tracklist containing the video's audio
tracks using htmlmediaelement.audio
tracks, then calls get
trackbyid() on it, specifying the character's name. the resulting
track's audio is then disabled by setting its enabled flag to false. specifications specification status comment html living standardthe definition of 'audio
tracklist.get
trackbyid()' in that specification. living standard html5the definition of 'audio
tracklist.get
trackbyid()' in that specification. recommendation ...
AudioTrackList.onaddtrack - Web APIs
the audio
tracklist property onadd
track is an event handler which is called when the add
track event occurs, indicating that a new audio
track has been added to the media element whose audio
tracks the audio
tracklist represents. the event is passed into the event handler in the form of a
trackevent object, whose
track property identifies the newly-added
track. note: you can also add a handler for the add
track event using addeventlistener(). syntax audio
tracklist.onadd
track = eventhandler; value set onadd
track to a function that accepts as input a
trackevent object which indicates in its
track property which audio
track has been added to the media. ...
...of a
trackevent object, whose
track property identifies the newly-added
track. note: you can also add a handler for the add
track event using addeventlistener(). syntax audio
tracklist.onadd
track = eventhandler; value set onadd
track to a function that accepts as input a
trackevent object which indicates in its
track property which audio
track has been added to the media. usage notes the add
track event is called whenever a new
track is added to the media element whose audio
tracks are represented by the audio
tracklist object. this happens when
tracks are added to the element when the media is first attached to the element; one add
track event will occur for each audio
track in the media resource. ...
... the media. usage notes the add
track event is called whenever a new
track is added to the media element whose audio
tracks are represented by the audio
tracklist object. this happens when
tracks are added to the element when the media is first attached to the element; one add
track event will occur for each audio
track in the media resource. example this snippet establishes a handler for the add
track event that calls a function, addto
tracklist(), passing in the audio
track object representing the newly-added
track. in this scenario, that function's role is to add the new
track to a list of audio
tracks available to choose from. ...
...dd
track event will occur for each audio
track in the media resource. example this snippet establishes a handler for the add
track event that calls a function, addto
tracklist(), passing in the audio
track object representing the newly-added
track. in this scenario, that function's role is to add the new
track to a list of audio
tracks available to choose from. document.queryselector("video").audio
tracks.onadd
track = function(event) { addto
tracklist(event.
track); }; specifications specification status comment html living standardthe definition of 'audio
tracklist.onadd
track' in that specification. living standard html5the definition of 'audio
tracklist.onadd
track' in that specification. recommendation ...
TextTrackList.onaddtrack - Web APIs
the text
tracklist property onadd
track is an event handler which is called when the add
track event occurs, indicating that a new text
track has been added to the media element whose text
tracks the text
tracklist represents. the event is passed into the event handler in the form of a
trackevent object, whose
track property identifies the newly-added
track. note: you can also add a handler for the add
track event using addeventlistener(). syntax text
tracklist.onadd
track = eventhandler; value set onadd
track to a function that accepts as input a
trackevent object which indicates in its
track property which video
track has been added to the media. ...
... of a
trackevent object, whose
track property identifies the newly-added
track. note: you can also add a handler for the add
track event using addeventlistener(). syntax text
tracklist.onadd
track = eventhandler; value set onadd
track to a function that accepts as input a
trackevent object which indicates in its
track property which video
track has been added to the media. usage notes the add
track event is called whenever a new
track is added to the media element whose video
tracks are represented by the text
tracklist object. this happens when
tracks are added to the element when the media is first attached to the element; one add
track event will occur for each video
track in the media resource. ...
...o the media. usage notes the add
track event is called whenever a new
track is added to the media element whose video
tracks are represented by the text
tracklist object. this happens when
tracks are added to the element when the media is first attached to the element; one add
track event will occur for each video
track in the media resource. example this snippet establishes a handler for the add
track event that calls a function, addto
tracklist(), passing in the video
track object representing the newly-added
track. in this scenario, that function's role is to add the new
track to a list of video
tracks available to choose from. ...
...add
track event will occur for each video
track in the media resource. example this snippet establishes a handler for the add
track event that calls a function, addto
tracklist(), passing in the video
track object representing the newly-added
track. in this scenario, that function's role is to add the new
track to a list of video
tracks available to choose from. document.queryselector("video").text
tracks.onadd
track = function(event) { addto
tracklist(event.
track); }; specifications specification status comment html living standardthe definition of 'text
tracklist: onadd
track' in that specification. living standard ...
VideoTrackList.onaddtrack - Web APIs
the video
tracklist property onadd
track is an event handler which is called when the add
track event occurs, indicating that a new video
track has been added to the media element whose video
tracks the video
tracklist represents. the event is passed into the event handler in the form of a
trackevent object, whose
track property identifies the newly-added
track. note: you can also add a handler for the add
track event using addeventlistener(). syntax video
tracklist.onadd
track = eventhandler; value set onadd
track to a function that accepts as input a
trackevent object which indicates in its
track property which video
track has been added to the media. ...
...of a
trackevent object, whose
track property identifies the newly-added
track. note: you can also add a handler for the add
track event using addeventlistener(). syntax video
tracklist.onadd
track = eventhandler; value set onadd
track to a function that accepts as input a
trackevent object which indicates in its
track property which video
track has been added to the media. usage notes the add
track event is called whenever a new
track is added to the media element whose video
tracks are represented by the video
tracklist object. this happens when
tracks are added to the element when the media is first attached to the element; one add
track event will occur for each video
track in the media resource. ...
... the media. usage notes the add
track event is called whenever a new
track is added to the media element whose video
tracks are represented by the video
tracklist object. this happens when
tracks are added to the element when the media is first attached to the element; one add
track event will occur for each video
track in the media resource. example this snippet establishes a handler for the add
track event that calls a function, addto
tracklist(), passing in the video
track object representing the newly-added
track. in this scenario, that function's role is to add the new
track to a list of video
tracks available to choose from. ...
...dd
track event will occur for each video
track in the media resource. example this snippet establishes a handler for the add
track event that calls a function, addto
tracklist(), passing in the video
track object representing the newly-added
track. in this scenario, that function's role is to add the new
track to a list of video
tracks available to choose from. document.queryselector("video").video
tracks.onadd
track = function(event) { addto
tracklist(event.
track); }; specifications specification status comment html living standardthe definition of 'video
tracklist: onadd
track' in that specification. living standard ...
AudioTrackList.onremovetrack - Web APIs
the audio
tracklist onremove
track event handler is called when the remove
track event occurs, indicating that an audio
track has been removed from the media element, and therefore also from the audio
tracklist. the event is passed into the event handler in the form of a
trackevent object, whose
track property identifies the
track that was removed from the media element's audio
tracklist. note: you can also add a handler for the remove
track event using addeventlistener(). syntax audio
tracklist.onremove
track = eventhandler; value set onremove
track to a function that accepts as input a
trackevent object which indicates in its
track property which audio
track has been removed from the media element. ...
...cklist. note: you can also add a handler for the remove
track event using addeventlistener(). syntax audio
tracklist.onremove
track = eventhandler; value set onremove
track to a function that accepts as input a
trackevent object which indicates in its
track property which audio
track has been removed from the media element. example this simple example just fetches the current number of audio
tracks in the media element whenever a
track is removed from the media element. document.queryselector("my-video").audio
tracks.onremove
track = function(event) { my
trackcount = document.queryselector("my-video").audio
tracks.length; }; the current number of audio
tracks remaining in the media element is obtained from audio
tracklist property length. specifications specification status ...
...lement. document.queryselector("my-video").audio
tracks.onremove
track = function(event) { my
trackcount = document.queryselector("my-video").audio
tracks.length; }; the current number of audio
tracks remaining in the media element is obtained from audio
tracklist property length. specifications specification status comment html living standardthe definition of 'audio
tracklist.onremove
track' in that specification. living standard html5the definition of 'audio
tracklist.onremove
track' in that specification. recommendation ...
TextTrackList.onremovetrack - Web APIs
the text
tracklist onremove
track event handler is called when the remove
track event occurs, indicating that a text
track has been removed from the media element, and therefore also from the text
tracklist. the event is passed into the event handler in the form of a
trackevent object, whose
track property identifies the
track that was removed from the media element's text
tracklist. note: you can also add a handler for the remove
track event using addeventlistener(). syntax text
tracklist.onremove
track = eventhandler; value set onremove
track to a function that accepts as input a
trackevent object which indicates in its
track property which text
track has been removed from the media element. ...
...
tracklist. note: you can also add a handler for the remove
track event using addeventlistener(). syntax text
tracklist.onremove
track = eventhandler; value set onremove
track to a function that accepts as input a
trackevent object which indicates in its
track property which text
track has been removed from the media element. example this simple example just fetches the current number of text
tracks in the first media element whenever a
track is removed from the media element. document.queryselectorall("video, audio")[0].text
tracks.onremove
track = function(event) { my
trackcount = document.queryselectorall("video, audio")[0].text
tracks.length; }; the current number of text
tracks remaining in the media element is obtained from text
tracklist property length. specifications spe...
...nt.queryselectorall("video, audio")[0].text
tracks.onremove
track = function(event) { my
trackcount = document.queryselectorall("video, audio")[0].text
tracks.length; }; the current number of text
tracks remaining in the media element is obtained from text
tracklist property length. specifications specification status comment html living standardthe definition of 'text
tracklist: onremove
track' in that specification. living standard ...
VideoTrackList.onremovetrack - Web APIs
the video
tracklist onremove
track event handler is called when the remove
track event occurs, indicating that a video
track has been removed from the media element, and therefore also from the video
tracklist. the event is passed into the event handler in the form of a
trackevent object, whose
track property identifies the
track that was removed from the media element's video
tracklist. note: you can also add a handler for the remove
track event using addeventlistener(). syntax video
tracklist.onremove
track = eventhandler; value set onremove
track to a function that accepts as input a
trackevent object which indicates in its
track property which video
track has been removed from the media element. ...
...cklist. note: you can also add a handler for the remove
track event using addeventlistener(). syntax video
tracklist.onremove
track = eventhandler; value set onremove
track to a function that accepts as input a
trackevent object which indicates in its
track property which video
track has been removed from the media element. example this simple example just fetches the current number of video
tracks in the media element whenever a
track is removed from the media element. document.queryselector("my-video").video
tracks.onremove
track = function(event) { my
trackcount = document.queryselector("my-video").video
tracks.length; }; the current number of video
tracks remaining in the media element is obtained from video
tracklist property length. specifications specification status ...
...lement. document.queryselector("my-video").video
tracks.onremove
track = function(event) { my
trackcount = document.queryselector("my-video").video
tracks.length; }; the current number of video
tracks remaining in the media element is obtained from video
tracklist property length. specifications specification status comment html living standardthe definition of 'video
tracklist: onremove
track' in that specification. living standard ...
TrackDefault.TrackDefault() - Web APIs
the
trackdefault() constructor of the
trackdefault interface constructs and returns a new
trackdefault object. syntax var
trackdefault = new
trackdefault(type, language, label, kinds, bytestream
trackid); parameters type a domstring specifying a media segment data type for the sourcebuffer to contain. can be audio, video, or text. language a domstring specifying a default language for the sourcebuffer to use when an initialization segment does not contain language information for a new
track. label a domstring specifying a default label for the sourcebuffer to use when an initialization segment does not contain label information for a new
track. kinds an array (sequence) of domstrings specifying default kinds for the sourcebuffer to use when an initialization segment doe...
...lization segment does not contain language information for a new
track. label a domstring specifying a default label for the sourcebuffer to use when an initialization segment does not contain label information for a new
track. kinds an array (sequence) of domstrings specifying default kinds for the sourcebuffer to use when an initialization segment does not contain kind information for a new
track. bytestream
trackid optional a domstring specifying the id of the specific
track that the sourcebuffer should apply to. if not specified, this value will be an empty string and the sourcebuffer can contain any
tracks of the specified type. errors when this constructor is invoked, the following errors can occur: error explanation invalidaccesserror the supplied lan...
AudioTrackList: addtrack event - Web APIs
the add
track event is fired when a
track is added to an audio
tracklist. bubbles no cancelable no interface
trackevent event handler property onadd
track examples using addeventlistener(): const videoelement = document.queryselector('video'); videoelement.audio
tracks.addeventlistener('add
track', (event) => { console.log(`audio
track: ${event.
track.label} added`); }); using the onadd
track event handler property: const videoelement = document.queryselector('video'); videoelement.audio
tracks.onadd
track = (event) => { console.log(`audio
track: ${event.
track.label} added`); }; specifications specification status html living standardthe definition of 'add
track' in that specification. living standard ...
AudioTrackList: removetrack event - Web APIs
the remove
track event is fired when a
track is removed from an audio
tracklist. bubbles no cancelable no interface
trackevent event handler property onremove
track examples using addeventlistener(): const videoelement = document.queryselector('video'); videoelement.audio
tracks.addeventlistener('remove
track', (event) => { console.log(`audio
track: ${event.
track.label} removed`); }); using the onremove
track event handler property: const videoelement = document.queryselector('video'); videoelement.audio
tracks.onremove
track = (event) => { console.log(`audio
track: ${event.
track.label} removed`); }; specifications specification status html living standardthe definition of 'remove
track' in that specification. l...
RTCTrackEvent.track - Web APIs
the webrtc api interface rtc
trackevent's read-only
track property specifies the mediastream
track that has been added to the rtcpeerconnection. syntax var
track =
trackevent.
track; value a mediastream
track indicating the
track which has been added to the rtcpeerconnection. specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtc
trackevent.
track' in that specification. candidate recommendation initial specification. ...
TextTrackList: addtrack event - Web APIs
the add
track event is fired when a
track is added to a text
tracklist. bubbles no cancelable no interface
trackevent event handler property onadd
track examples using addeventlistener(): const mediaelement = document.queryselector('video, audio'); mediaelement.text
tracks.addeventlistener('add
track', (event) => { console.log(`text
track: ${event.
track.label} added`); }); using the onadd
track event handler property: const mediaelement = document.queryselector('video, audio'); mediaelement.text
tracks.onadd
track = (event) => { console.log(`text
track: ${event.
track.label} added`); }; specifications specification status html living standardthe definition of 'add
track' in that specification. living standard ...
TrackDefault.byteStreamTrackID - Web APIs
the bytestream
trackid read-only property of the
trackdefault interface returns the id of the specific
track that the sourcebuffer should apply to. if not specified in the constructor, this value will be an empty string and the sourcebuffer can contain any
tracks of the specified
trackdefault.type. syntax var myid =
trackdefault.bytestream
trackid; value a domstring. example tbd ...
TrackDefaultList.TrackDefault() - Web APIs
the
trackdefault() getter method of the
trackdefaultlist interface allows the
trackdefault objects in the list to be accessed with an array operator (i.e. [].) syntax var my
trackdefault =
trackdefaultlist[index]; parameters index the index position of the
trackdefault object you want to return. returns a
trackdefault object. errors no specific errors are returned, but if the supplied index is great than or equal to
trackdefaultlist.length, the operation will return undefined. example tbd. ...
TrackDefaultList.TrackDefaultList() - Web APIs
the
trackdefaultlist() constructor of the
trackdefaultlist interface constructs and returns a new
trackdefaultlist object. syntax var
trackdefaultlist = new
trackdefaultlist(
trackdefaults); parameters
trackdefaults a sequence (array) of
trackdefault objects. example tbd. ...
TrackEvent.track - Web APIs
the read-only
track property of the
trackevent interface specifies the media
track object to which the event applies. this will be an audio
track, video
track, or text
track object. syntax
track =
trackevent.
track; value an object which is one of the types audio
track, video
track, or text
track, depending on the type of media represented by the
track. this identifies the
track to which the event applies. specifications specification status comment html living standardthe definition of '
trackevent.
track' in that specification. living standard initial definition. html5the definition of '
trackevent.
track' in that specification. recommendation initial definition. ...
VideoTrackList: addtrack event - Web APIs
the add
track event is fired when a
track is added to a video
tracklist. bubbles no cancelable no interface
trackevent event handler property onadd
track examples using addeventlistener(): const videoelement = document.queryselector('video'); videoelement.video
tracks.addeventlistener('add
track', (event) => { console.log(`video
track: ${event.
track.label} added`); }); using the onadd
track event handler property: const videoelement = document.queryselector('video'); videoelement.video
tracks.onadd
track = (event) => { console.log(`video
track: ${event.
track.label} added`); }; specifications specification status html living standardthe definition of 'add
track' in that specification. living standard ...
VideoTrackList: removetrack event - Web APIs
the remove
track event is fired when a
track is removed from a video
tracklist. bubbles no cancelable no interface
trackevent event handler property onremove
track examples using addeventlistener(): const videoelement = document.queryselector('video'); videoelement.video
tracks.addeventlistener('remove
track', (event) => { console.log(`video
track: ${event.
track.label} removed`); }); using the onremove
track event handler property: const videoelement = document.queryselector('video'); videoelement.video
tracks.onremove
track = (event) => { console.log(`video
track: ${event.
track.label} removed`); }; specifications specification status html living standardthe definition of 'remove
track' in that specification. li...
Storage access policy: Block cookies from trackers
this article explains how the policy works and how you can test it. testing in firefox this cookie policy has been available in firefox since version 63. this documentation describes the policy that we intend to ship to firefox release users, but may not match what is implemented in the current release version of firefox. ...
...the current release version of firefox. that's because we document new aspects of the policy as soon as they land in firefox nightly, our pre-release channel. firefox nightly may also contain experimental features that we don't yet plan to ship to release users; experimental features will not be included in this documentation, but may nevertheless impact the functionality of domains classified as
trackers. we recommend sites test with firefox nightly, as this includes the newest version of our protections. as described above, note that nightly may include additional protections that end up getting removed or changed before they reach our release users. we’ll keep this page updated with the newest information as we strengthen our protections. these protections are on by default in nightly. t...
...trengthen our protections. these protections are on by default in nightly. the cookie policy can be enabled in other versions of firefox through the content blocking settings (these steps will vary by version; the linked documentation includes a dropdown to select the appropriate firefox version). ...
...And 33 more matches
RTCPeerConnection.addTrack() - Web APIs
the rtcpeerconnection method add
track() adds a new media
track to the set of
tracks which will be transmitted to the other peer. note: adding a
track to a connection triggers renegotiation by firing a negotiationneeded event. see starting negotiation in signaling and video calling for details. syntax rtpsender = rtcpeerconnection.add
track(
track, stream...); parameters
track a mediastream
track object representing the media
track to add to the peer connection. stream... optional one or more local mediastream objects to which the
track should be added. the specified
track doesn't necessarily have to already be part of any of the specified streams. ...
... return value the rtcrtpsender object which will be used to transmit the media data. ...
... return value the rtcrtpsender object which will be used to transmit the media data. note: every rtcrtpsender is paired with an rtcrtpreceiver to make up an rtcrtptransceiver. ...
...And 19 more matches
TrackEvent - Web APIs
the
trackevent interface, which is part of the html dom specification, is used for events which represent changes to a set of available
tracks on an html media element; these events are add
track and remove
track. it's important not to confuse
trackevent with the rtc
trackevent interface, which is used for
tracks which are part of an rtcpeerconnection. events based on
trackevent are always sent to one of the media
track list types: events involving video
tracks are always sent to the video
tracklist found in htmlmediaelement.video
tracks events involving audio
tracks are always sent to the audio
tracklist specified in htmlmediaelement.audio
tracks events affecting text
tracks are sent to the text
tracklist object indicated by htmlmediaelement.text
tracks. ...
...always sent to one of the media
track list types: events involving video
tracks are always sent to the video
tracklist found in htmlmediaelement.video
tracks events involving audio
tracks are always sent to the audio
tracklist specified in htmlmediaelement.audio
tracks events affecting text
tracks are sent to the text
tracklist object indicated by htmlmediaelement.text
tracks. constructor
trackevent() creates and initializes a new
trackevent object with the event type specified, as well as optional additional properties. properties
trackevent is based on event, so properties of event are also available on
trackevent objects.
track read only the dom
track object the event is in reference to. ...
...cks. constructor
trackevent() creates and initializes a new
trackevent object with the event type specified, as well as optional additional properties. properties
trackevent is based on event, so properties of event are also available on
trackevent objects.
track read only the dom
track object the event is in reference to. if not null, this is always an object of one of the media
track types: audio
track, video
track, or text
track). methods
trackevent has no methods of its own; however, it is based on event, so it provides the methods available on event objects. example this example sets up a function, handle
trackevent(), which is callled for any add
track or remove
track event on the first <video> element found in the document. var videoelem = document.queryselector("video")...
...And 16 more matches
TrackEvent() - Web APIs
bubbles optional a boolean indicating whether the event bubbles or not. ...
... bubbles optional a boolean indicating whether the event bubbles or not. ...
... bubbles optional a boolean indicating whether the event bubbles or not. ...
...And 14 more matches
AudioTrack - Web APIs
the id can also be used as the fragment part of the url if the media supports seeking by media fragment per the media fragments uri specification. ...
...the id can also be used as the fragment part of the url if the media supports seeking by media fragment per the media fragments uri specification. ...
...the id can also be used as the fragment part of the url if the media supports seeking by media fragment per the media fragments uri specification. ...
...And 13 more matches
AudioTrack.enabled - Web APIs
the audio
track property enabled specifies whether or not the described audio
track is currently enabled for use. if the
track is disabled by setting enabled to false, the
track is muted and does not produce audio. syntax isaudioenabled = audio
track.enabled; audio
track.enabled = true | false; value the enabled property is a boolean whose value is true if the
track is enabled; enabled
tracks produce audio while the media is playing. setting enabled to false effectively mutes the audio
track, preventing it from contributing to the media's audio performance. example this example switches between the main and commentary audio
tracks of a media element. ...
...
track is enabled; enabled
tracks produce audio while the media is playing. setting enabled to false effectively mutes the audio
track, preventing it from contributing to the media's audio performance. example this example switches between the main and commentary audio
tracks of a media element. ...
...bled
tracks produce audio while the media is playing. setting enabled to false effectively mutes the audio
track, preventing it from contributing to the media's audio performance. example this example switches between the main and commentary audio
tracks of a media element. ...
...And 12 more matches
RTCRtpSender.replaceTrack() - Web APIs
the rtcrtpsender method replace
track() replaces the
track currently being used as the sender's source with a new mediastream
track. the new
track must be of the same media kind (audio, video, etc) and switching the
track should not require negotiation. among the use cases for replace
track() is the common need to switch between the rear- and front-facing cameras on a phone. with replace
track(), you can simply have a
track object for each camera and switch between the two as needed. see the example switching cameras below. syntax
trackreplacedpromise = sender.replace
track(new
track); parameters new
track optional a mediastream
track specifying the
track with which to replace the rtcrtpsender's current source
track. ...
...ar- and front-facing cameras on a phone. with replace
track(), you can simply have a
track object for each camera and switch between the two as needed. see the example switching cameras below. syntax
trackreplacedpromise = sender.replace
track(new
track); parameters new
track optional a mediastream
track specifying the
track with which to replace the rtcrtpsender's current source
track. the new
track's kind must be the same as the current
track's, or the replace
track request will fail. return value a promise which is fulfilled once the
track has been successfully replaced. the promise is rejected if the
track cannot be replaced for any reason; this is commonly because the change would require renegotiation of the codec, which is not allowed (see things that require negotiation). if newtr...
...ent
track's, or the replace
track request will fail. return value a promise which is fulfilled once the
track has been successfully replaced. the promise is rejected if the
track cannot be replaced for any reason; this is commonly because the change would require renegotiation of the codec, which is not allowed (see things that require negotiation). if new
track was omitted or was null, replace
track() simply stops the sender. no negotiation is required in this case. when the promise is fulfilled, the fulfillment handler receives a value of undefined. exceptions if the returned promise is rejected, one of the following exceptions is provided to the rejection handler: invalidmodificationerror replacing the rtcrtpsender's current
track with the new one would require negotiation. invalid...
...And 12 more matches
Tracking Protection
note that with firefox for android, you can access console output using the remote debugger. ...
... note that with firefox for android, you can access console output using the remote debugger. ...
...ross sites. if blocked content is part of the page layout, users may notice layout issues where firefox blocked these loads. sometimes users won’t notice at all, if the page grid works such that other page elements slide in to fill holes left by blocked elements. when firefox blocks content, it logs a message to the web console like this: the resource at "http://some/url" was blocked because
tracking protection is enabled. note that with firefox for android, you can access console output using the remote debugger. click the ⓘ symbol in the address bar to view information about the currently loaded page. the popup that appears will notify you when content has been blocked. you will also be able to disable
tracking protection entirely if you choose by accessing the
tracking settings. ...
...And 11 more matches
MediaStreamTrack - Web APIs
the mediastream
track interface represents a single media
track within a stream; typically, these are audio or video
tracks, but other
track types may exist as well. properties in addition to the properties listed below, mediastream
track has constrainable properties which can be set using applyconstraints() and accessed using getconstraints() and getsettings(). see capabilities, constraints, and settings to learn how to correctly work with constrainable properties. not doing so correctly will result in your code being unreliable. mediastream
track.contenthint a string that may be used by the web application to provide a hint as to what type of content the
track contains to guide how it should be treated by api consumers. ...
...nd getsettings(). see capabilities, constraints, and settings to learn how to correctly work with constrainable properties. not doing so correctly will result in your code being unreliable. mediastream
track.contenthint a string that may be used by the web application to provide a hint as to what type of content the
track contains to guide how it should be treated by api consumers. mediastream
track.enabled a boolean whose value of true if the
track is enabled, that is allowed to render the media source stream; or false if it is disabled, that is not rendering the media source stream but silence and blackness. if the
track has been disconnected, this value can be changed but has no more effect. note: you can implement standard "mute" functionality by setting enabled to false. the muted pro...
...ia source stream; or false if it is disabled, that is not rendering the media source stream but silence and blackness. if the
track has been disconnected, this value can be changed but has no more effect. note: you can implement standard "mute" functionality by setting enabled to false. the muted property refers to a condition in which there's no media because of a technical issue. mediastream
track.id read only returns a domstring containing a unique identifier (guid) for the
track; it is generated by the browser. ...
...And 11 more matches
MediaTrackSettings - Web APIs
to learn more about how constraints and settings work, see capabilities, constraints, and settings. properties some or all of the following will be included in the object, either because it's not supported by the browser or because it's not available due to context. ...
...s couldn't be matched. to learn more about how constraints and settings work, see capabilities, constraints, and settings. properties some or all of the following will be included in the object, either because it's not supported by the browser or because it's not available due to context. ...
...ties some or all of the following will be included in the object, either because it's not supported by the browser or because it's not available due to context. for example, because rtp doesn't provide some of these values during negotiation of a webrtc connection, a
track associated with a rtcpeerconnection will not include certain values, such as facingmode or groupid. properties of all media
tracks deviceid a domstring indicating the current value of the deviceid property. the device id is a origin-unique string identifying the source of the
track; this is usually a guid. this value is specific to the source of the
track's data and is not usable for setting constraints; it can, however, be used for initially selecting media when calling mediadevices.getusermedia(). groupid a domstrin...
...And 11 more matches
HTMLMediaElement.textTracks - Web APIs
the read-only text
tracks property on htmlmediaelement objects returns a text
tracklist object listing all of the text
track objects representing the media element's text
tracks, in the same order as in the list of text
tracks. you can detect when
tracks are added to and removed from an <audio> or <video> element using the add
track and remove
track events. however, these events aren't sent directly to the media element itself. instead, they're sent to the
track list object of the htmlmediaelement that corresponds to the type of
track that was added to the element the returned list is live; that is, as
tracks are added to and removed from the media element, the list's contents change dynamically. once you have a reference to the list, you can monitor it for changes to detect when new te...
...y to the media element itself. instead, they're sent to the
track list object of the htmlmediaelement that corresponds to the type of
track that was added to the element the returned list is live; that is, as
tracks are added to and removed from the media element, the list's contents change dynamically. once you have a reference to the list, you can monitor it for changes to detect when new text
tracks are added or existing ones removed. see event handlers in text
tracklist to learn more about watching for changes to a media element's
track list. syntax var text
tracks = mediaelement.text
tracks; value a text
tracklist object representing the list of text
tracks included in the media element. ...
...e a reference to the list, you can monitor it for changes to detect when new text
tracks are added or existing ones removed. see event handlers in text
tracklist to learn more about watching for changes to a media element's
track list. syntax var text
tracks = mediaelement.text
tracks; value a text
tracklist object representing the list of text
tracks included in the media element. the list of
tracks can be accessed using array notation, or using the object's get
trackbyid() method. each
track is represented by a text
track object which provides information about the
track. ...
...And 9 more matches
HTMLTrackElement - Web APIs
the html
trackelement interface represents an html <
track> element within the dom. this element can be used as a child of either <audio> or <video> to specify a text
track containing information such as closed captions or subtitles. <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" preserveaspectratio="xminymin meet"><a xlink:href="/docs/web/api/eventtarget" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="56" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignm...
...aco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlelement</text></a><polyline points="491,25 501,20 501,30 491,25" stroke="#d4dde4" fill="none"/><line x1="501" y1="25" x2="509" y2="25" stroke="#d4dde4"/><line x1="509" y1="25" x2="509" y2="90" stroke="#d4dde4"/><line x1="509" y1="90" x2="492" y2="90" stroke="#d4dde4"/><a xlink:href="/docs/web/api/html
trackelement" target="_top"><rect x="331" y="65" width="160" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="411" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">html
trackelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits p...
...th="160" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="411" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">html
trackelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. html
trackelement.kind is a domstring that reflects the kind html attribute, indicating how the text
track is meant to be used. ...
...And 8 more matches
TextTrack.mode - Web APIs
the text
track interface's mode property is a string specifying and controlling the text
track's mode: disabled, hidden, or showing. you can read this value to determine the current mode, and you can change this value to switch modes. safari additionally requires the default boolean attribute to be set to true when implementing your own video player controls in order for the subtitles cues to be shown. syntax var mode = text
track.mode; text
track.mode = "disabled" | "hidden" | "showing"; value a domstring which indicates the
track's current mode. the text
track mode is one of the values listed below, under text
track mode constants. ...
...lly requires the default boolean attribute to be set to true when implementing your own video player controls in order for the subtitles cues to be shown. syntax var mode = text
track.mode; text
track.mode = "disabled" | "hidden" | "showing"; value a domstring which indicates the
track's current mode. the text
track mode is one of the values listed below, under text
track mode constants. text
track mode constants the text
track mode—sometimes identified using the idl enum text
trackmode—must be one of the following values: disabled the text
track is currently disabled. while the
track's presence is exposed in the dom, the user agent is otherwise ignoring it. no cues are active, no events are being fired, and the user agent won't attempt to obtain the
track's cues. this is the defaul...
...
track mode—sometimes identified using the idl enum text
trackmode—must be one of the following values: disabled the text
track is currently disabled. while the
track's presence is exposed in the dom, the user agent is otherwise ignoring it. no cues are active, no events are being fired, and the user agent won't attempt to obtain the
track's cues. this is the default value, unless the text
track has the default boolean attribute is specified, in which case the default is showing. hidden the text
track is currently active but the cues aren't being displayed. if the user agent hasn't tried to obtain the
track's cues yet, it will do so soon (thereby populating the
track's text
track.cues property). ...
...And 8 more matches
AudioTrack.language - Web APIs
for brazilian portuguese, the value would be "pt-br". ...
...for brazilian portuguese, the value would be "pt-br". ...
...for brazilian portuguese, the value would be "pt-br". ...
...And 7 more matches
HTMLTrackElement: cuechange event - Web APIs
the cuechange event fires when a text
track has changed the currently displaying cues. the event is fired at both the text
track and at the html
trackelement in which it's being presented, if any. ...
... the cuechange event fires when a text
track has changed the currently displaying cues. the event is fired at both the text
track and at the html
trackelement in which it's being presented, if any. ...
...cuechange event fires when a text
track has changed the currently displaying cues. the event is fired at both the text
track and at the html
trackelement in which it's being presented, if any. ...
...And 7 more matches
TextTrack: cuechange event - Web APIs
the cuechange event fires when a text
track has changed the currently displaying cues. the event is fired at both the text
track and at the html
trackelement in which it's being presented, if any. ...
... the cuechange event fires when a text
track has changed the currently displaying cues. the event is fired at both the text
track and at the html
trackelement in which it's being presented, if any. ...
...text
track has changed the currently displaying cues. the event is fired at both the text
track and at the html
trackelement in which it's being presented, if any. ...
...And 7 more matches
RTCOutboundRtpStreamStats.trackId - Web APIs
candidate recommendation initial definition. ...
... candidate recommendation initial definition. ...
... candidate recommendation initial definition. ...
...And 6 more matches
Web Video Text Tracks Format (WebVTT) - Web APIs
webvtt files the mime type of webvtt is text/vtt. a webvtt file (.vtt) contains cues, which can be either a single line or multiple lines, as shown below: webvtt 00:01.000 --> 00:04.000 - never drink liquid nitrogen. 00:05.000 --> 00:09.000 - it will perforate your stomach. - you could die. ...
... webvtt files the mime type of webvtt is text/vtt. a webvtt file (.vtt) contains cues, which can be either a single line or multiple lines, as shown below: webvtt 00:01.000 --> 00:04.000 - never drink liquid nitrogen. 00:05.000 --> 00:09.000 - it will perforate your stomach. - you could die. ...
...ie. in the case of each cue: the first line is started with a time, which is the starting time for showing the text that appears underneath. on the same line, we then have a string of "-->". we finish the first line with a second time, which is the ending time for showing the associated text. we can then have one or more lines that start with a hyphen (-), each containing part of the text
track to be shown. we can also place comments in our .vtt file, to help us remember important information about the parts of our file. these should be on separate lines, starting with the string note. you'll find more about these in the below section. it is important to not use "extra" blank lines within a cue, for example between the timings line and the cue payload. webvtt is line based; a blank l...
...And 6 more matches
AudioTrackList - Web APIs
the audio
tracklist interface is used to represent a list of the audio
tracks contained within a given html media element, with each
track represented by a separate audio
track object in the list. retrieve an instance of this object with htmlmediaelement.audio
tracks. the individual
tracks can be accessed using array syntax. properties this interface also inherits properties from its parent interface, eventtarget. length read only the number of
tracks in the list. event handlers onadd
track an event handler to be called when the add
track event is fired, indicating that a new audio
track has been added to the media element. onchange an event handler to be called when the change event occurs. ...
...s interface also inherits properties from its parent interface, eventtarget. length read only the number of
tracks in the list. event handlers onadd
track an event handler to be called when the add
track event is fired, indicating that a new audio
track has been added to the media element. onchange an event handler to be called when the change event occurs. this occurs when one or more
tracks have been enabled or disabled by their enabled flag being changed. onremove
track an event handler to call when the remove
track event is sent, indicating that an audio
track has been removed from the media element. ...
...nt handler to be called when the change event occurs. this occurs when one or more
tracks have been enabled or disabled by their enabled flag being changed. onremove
track an event handler to call when the remove
track event is sent, indicating that an audio
track has been removed from the media element. methods this interface also inherits methods from its parent interface, eventtarget. get
trackbyid() returns the audio
track found within the audio
tracklist whose id matches the specified string. if no match is found, null is returned. events add
track fired when a new audio
track has been added to the media element. also available via the onadd
track property. ...
...And 5 more matches
HTMLTrackElement.src - Web APIs
recommendation initial definition. ...
... recommendation initial definition. ...
... recommendation initial definition. ...
...And 5 more matches
MediaTrackConstraints - Web APIs
for each constraint, you can typically specify an exact value you need, an ideal value you want, a range of acceptable values, and/or a value which you'd like to be as close to as possible. the specifics vary somewhat depending on the type of the constrainable property. to learn more about how constraints work, see capabilities, constraints, and settings. ...
...o learn more about how constraints work, see capabilities, constraints, and settings. properties some combination—but not necessarily all—of the following properties will exist on the object. this may be because a given browser doesn't support the property, or because it doesn't apply. for example, because rtp doesn't provide some of these values during negotiation of a webrtc connection, a
track associated with a rtcpeerconnection will not include certain values, such as facingmode or groupid. properties of all media
tracks deviceid a constraindomstring object specifying a device id or an array of device ids which are acceptable and/or required. groupid a constraindomstring object specifying a group id or an array of group ids which are acceptable and/or required. properties of ...
... channelcount a constrainlong specifying the channel count or range of channel counts which are acceptable and/or required. ...
...And 5 more matches
RTCInboundRtpStreamStats.trackId - Web APIs
candidate recommendation initial definition. ...
... candidate recommendation initial definition. ...
... candidate recommendation initial definition. ...
...And 5 more matches
RTCTrackEvent - Web APIs
the webrtc api interface rtc
trackevent represents the
track event, which is sent when a new mediastream
track is added to an rtcrtpreceiver which is part of the rtcpeerconnection. the target is the rtcpeerconnection object to which the
track is being added. this event is sent by the webrtc layer to the web site or application, so you will not typically need to instantiate an rtc
trackevent yourself. constructor rtc
trackevent() creates and returns a new rtc
trackevent object, initialized with properties taken from the specified rtc
trackeventinit dictionary. you will probably not need to create new
track events yourself, since they're typically created by the webrtc infrastructure and sent to the connection's on
track event handler. ...
...tantiate an rtc
trackevent yourself. constructor rtc
trackevent() creates and returns a new rtc
trackevent object, initialized with properties taken from the specified rtc
trackeventinit dictionary. you will probably not need to create new
track events yourself, since they're typically created by the webrtc infrastructure and sent to the connection's on
track event handler. properties since rtc
trackevent is based on event, its properties are also available. receiver read only the rtcrtpreceiver used by the
track that's been added to the rtcpeerconnection. streams read only optional an array of mediastream objects, each representing one of the media streams to which the added
track belongs. by default, the array is empty, indicating a streamless
track. ...
...r. properties since rtc
trackevent is based on event, its properties are also available. receiver read only the rtcrtpreceiver used by the
track that's been added to the rtcpeerconnection. streams read only optional an array of mediastream objects, each representing one of the media streams to which the added
track belongs. by default, the array is empty, indicating a streamless
track.
track read only the mediastream
track which has been added to the connection. transceiver read only the rtcrtptransceiver being used by the new
track.
track event types there is only one type of
track event.
track the
track event is sent to the rtcpeerconnection when a new
track has been added to the connection. ...
...And 5 more matches
Spaces and reference spaces: Spatial tracking in WebXR - Web APIs
the webxr apis used for implementing augmented and virtual reality is designed specifically to provide the ability to insert a human into a virtual environment. to accomplish this, software needs the ability to not only
track the locations, orientation, and movements of objects in the virtual world, but the user's location, orientation, and movement as well. but webxr goes beyond that by adding the ability to
track the location, orientation, and motion of the input devices which generate data used to determine the position and movement of individual parts of the viewer's body (with appropriate equipment). the location and movement of the user's headset represent their head's position and orientation in the virtual environment. hand controllers represent their hands in the same manner. other...
...ent their head's position and orientation in the virtual environment. hand controllers represent their hands in the same manner. other hardware elements can be used similarly to represent other parts of the body, providing additional data to use when simulating the user's actions in their environment. in this guide, we'll explore how webxr uses spaces and, more specifically, reference spaces, to
track the positions, orientations, and movements of objects and of the user's body in the virtual world. note: this article presumes that you are familiar with the concepts introduced in geometry and reference spaces in webxr: that is, the basics of 3d coordinate systems, as well as webxr spaces, reference spaces, and how reference spaces are used to create local coordinate systems for individual obj...
...ransition the user's experience to a bounded space. for instance, it may be easier to implement the interactions with the objects in a single room in a house by switching to a bounded space representing the single room. this might make it easier to do things like implement support for customizing the walls, placing furniture on the floor, and so forth. in cases like this, where you need to begin
tracking using a different reference space than the one you've been using, you can use a combination of getviewerpose() and some matrix computations to transition everything in your scene to be based at the new reference frame's origin. because getviewerpose() is only available in an xrframe, you will need to begin this process in your rendering callback, possibly using a worker to do the computations...
...And 5 more matches
AudioTrackList.onchange - Web APIs
the audio
tracklist property onchange is an event handler which is called when the change event occurs, indicating that one or more of the audio
tracks in the audio
tracklist have been enabled or disabled. the event is passed into the event handler in the form of an event object; the event doesn't provide any additional information. to determine the new state of media's
tracks, you'll have to look at their audio
track.enabled flags. note: you can also add a handler for the change event using addeventlistener(). syntax audio
tracklist.onchange = eventhandler; value set onchange to a function that should be called whenever
tracks are enabled or disabled on the media element. ...
..., you'll have to look at their audio
track.enabled flags. note: you can also add a handler for the change event using addeventlistener(). syntax audio
tracklist.onchange = eventhandler; value set onchange to a function that should be called whenever
tracks are enabled or disabled on the media element. example this snippet establishes a handler for the change event that looks at each of the
tracks in the list, calling a function to update the state of a user interface control that indicates the current state of the
track. ...
... syntax audio
tracklist.onchange = eventhandler; value set onchange to a function that should be called whenever
tracks are enabled or disabled on the media element. example this snippet establishes a handler for the change event that looks at each of the
tracks in the list, calling a function to update the state of a user interface control that indicates the current state of the
track. ...
...And 4 more matches
MediaStreamTrack.stop() - Web APIs
immediately after calling stop(), the readystate property is set to ended. ...
... immediately after calling stop(), the readystate property is set to ended. ...
... immediately after calling stop(), the readystate property is set to ended. ...
...And 4 more matches
MediaStreamTrackAudioSourceNode() - Web APIs
the web audio api's mediastream
trackaudiosourcenode() constructor creates and returns a new mediastream
trackaudiosourcenode object whose audio is taken from the mediastream
track specified in the given options object. another way to create a mediastream
trackaudiosourcenode is to call theaudiocontext.createmediastream
tracksource() method, specifying the mediastream
track from which you want to obtain audio. syntax audio
tracknode = new mediastream
trackaudiosourcenode(context, options); parameters context an audiocontext representing the audio context you want the node to be associated with. ...
...y to create a mediastream
trackaudiosourcenode is to call theaudiocontext.createmediastream
tracksource() method, specifying the mediastream
track from which you want to obtain audio. syntax audio
tracknode = new mediastream
trackaudiosourcenode(context, options); parameters context an audiocontext representing the audio context you want the node to be associated with. options a mediastream
trackaudiosourceoptions object defining the properties you want the mediastream
trackaudiosourcenode to have: mediastream
track the mediastream
track from which to take audio data for this node's output. return value a new mediastream
trackaudiosourcenode object representing the audio node whose media is obtained from the specified media
track. exceptions notsupportederror the specified con...
...
trackaudiosourcenode to have: mediastream
track the mediastream
track from which to take audio data for this node's output. return value a new mediastream
trackaudiosourcenode object representing the audio node whose media is obtained from the specified media
track. exceptions notsupportederror the specified context is not an audiocontext. invalidstateerror the specified mediastream
track isn't an audio
track (that is, its kind property isn't audio. example this example uses getusermedia() to obtain access to the user's camera, then creates a new mediastreamaudiosourcenode from the first audio
track provided by the device. let audioctx = new (window.audiocontext || window.webkitaudiocontext)(); if (navigator.mediadevices.getusermedia) { navigator.mediadevices.getusermedia (...
...And 4 more matches
MediaTrackSettings.facingMode - Web APIs
however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. ...
...however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. ...
...however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. ...
...And 4 more matches
RTCRtpSender.track - Web APIs
candidate recommendation initial definition. ...
... candidate recommendation initial definition. ...
... candidate recommendation initial definition. ...
...And 4 more matches
RTCTrackEventInit.streams - Web APIs
candidate recommendation initial specification. ...
... candidate recommendation initial specification. ...
... candidate recommendation initial specification. ...
...And 4 more matches
TextTrack - Web APIs
the text
track interface—part of the api for handling webvtt (text
tracks on media presentations)—describes and controls the text
track associated with a particular <
track> element. properties this interface also inherits properties from eventtarget. text
track.activecues read only a text
trackcuelist object listing the currently active set of text
track cues.
track cues are active if the current playback position of the media is between the cues' start and end times. thus, for displayed cues such as captions or subtitles, the active cues are currently being displayed. text
track.cues read only a text
trackcuelist which contains all of the
track's cues. text
track.id read only a domstring which identifies the
track, if it has one. if it doesn't have an id, then this value is an em...
...he media is between the cues' start and end times. thus, for displayed cues such as captions or subtitles, the active cues are currently being displayed. text
track.cues read only a text
trackcuelist which contains all of the
track's cues. text
track.id read only a domstring which identifies the
track, if it has one. if it doesn't have an id, then this value is an empty string (""). if the text
track is associated with a <
track> element, then the
track's id matches the element's id. text
track.inbandmetadata
trackdispatchtype read only returns a domstring which indicates the
track's in-band metadata
track dispatch type. ...
...k.id read only a domstring which identifies the
track, if it has one. if it doesn't have an id, then this value is an empty string (""). if the text
track is associated with a <
track> element, then the
track's id matches the element's id. text
track.inbandmetadata
trackdispatchtype read only returns a domstring which indicates the
track's in-band metadata
track dispatch type. needs details text
track.kind read only returns a domstring indicating what kind of text
track the text
track describes. the value must be one of those in the text
trackkind enum. ...
...And 4 more matches
TextTrackList - Web APIs
the text
tracklist interface is used to represent a list of the text
tracks defined by the <
track> element, with each
track represented by a separate text
track object in the list. retrieve an instance of this object with htmlmediaelement.text
tracks. the individual
tracks can be accessed using array syntax or functions such as foreach() for example. properties this interface also inherits properties from its parent interface, eventtarget. length read only the number of
tracks in the list. event handlers onadd
track an event handler to be called when the add
track event is fired, indicating that a new text
track has been added to the media element. onchange an event handler to be called when the change event occurs. ...
...ple. properties this interface also inherits properties from its parent interface, eventtarget. length read only the number of
tracks in the list. event handlers onadd
track an event handler to be called when the add
track event is fired, indicating that a new text
track has been added to the media element. onchange an event handler to be called when the change event occurs. onremove
track an event handler to call when the remove
track event is sent, indicating that a text
track has been removed from the media element. methods this interface also inherits methods from its parent interface, eventtarget. ...
...k event is fired, indicating that a new text
track has been added to the media element. onchange an event handler to be called when the change event occurs. onremove
track an event handler to call when the remove
track event is sent, indicating that a text
track has been removed from the media element. methods this interface also inherits methods from its parent interface, eventtarget. get
trackbyid() returns the text
track found within the text
tracklist whose id matches the specified string. if no match is found, null is returned. events add
track fired when a new text
track has been added to the media element. also available via the onadd
track property. change fired when a text
track has been made active or inactive. ...
...And 4 more matches
Videotrack.language - Web APIs
for brazilian portuguese, the value would be "pt-br". ...
...for brazilian portuguese, the value would be "pt-br". ...
...for brazilian portuguese, the value would be "pt-br". ...
...And 4 more matches
VideoTrackList.onchange - Web APIs
the video
tracklist property onchange is an event handler which is called when the change event occurs, indicating that a video
track in the video
tracklist has been made active. the event is passed into the event handler in the form of an event object; the event doesn't provide any additional information. to determine the new state of media's
tracks, you'll have to look at their video
track.selected flags. note: you can also add a handler for the change event using addeventlistener(). syntax video
tracklist.onchange = eventhandler; value set onchange to a function that should be called whenever a
track is made active. ...
... new state of media's
tracks, you'll have to look at their video
track.selected flags. note: you can also add a handler for the change event using addeventlistener(). syntax video
tracklist.onchange = eventhandler; value set onchange to a function that should be called whenever a
track is made active. example this snippet establishes a handler for the change event that looks at each of the
tracks in the list, calling a function to update the state of a user interface control that indicates the current state of the
track. ...
...nt using addeventlistener(). syntax video
tracklist.onchange = eventhandler; value set onchange to a function that should be called whenever a
track is made active. example this snippet establishes a handler for the change event that looks at each of the
tracks in the list, calling a function to update the state of a user interface control that indicates the current state of the
track. ...
...And 4 more matches
VideoTrackList - Web APIs
the video
tracklist interface is used to represent a list of the video
tracks contained within a <video> element, with each
track represented by a separate video
track object in the list. retrieve an instance of this object with htmlmediaelement.video
tracks. the individual
tracks can be accessed using array syntax or functions such as foreach() for example. properties this interface also inherits properties from its parent interface, eventtarget. length read only the number of
tracks in the list. selectedindex read only the index of the currently selected
track, if any, or −1 otherwise. event handlers onadd
track an event handler to be called when the add
track event is fired, indicating that a new video
track has been added to the media element. onchange an event handler to b...
... list. selectedindex read only the index of the currently selected
track, if any, or −1 otherwise. event handlers onadd
track an event handler to be called when the add
track event is fired, indicating that a new video
track has been added to the media element. onchange an event handler to be called when the change event occurs — that is, when the value of the selected property for a
track has changed, due to the
track being made active or inactive. onremove
track an event handler to call when the remove
track event is sent, indicating that a video
track has been removed from the media element. methods this interface also inherits methods from its parent interface, eventtarget. ...
...ed when the change event occurs — that is, when the value of the selected property for a
track has changed, due to the
track being made active or inactive. onremove
track an event handler to call when the remove
track event is sent, indicating that a video
track has been removed from the media element. methods this interface also inherits methods from its parent interface, eventtarget. get
trackbyid() returns the video
track found within the video
tracklist whose id matches the specified string. if no match is found, null is returned. events add
track fired when a new video
track has been added to the media element. also available via the onadd
track property. ...
...And 4 more matches
ImageCapture.track - Web APIs
working draft initial definition. ...
... working draft initial definition. ...
... working draft initial definition. ...
...And 3 more matches
MediaStreamTrack.enabled - Web APIs
the enabled property on the mediastream
track interface is a boolean value which is true if the
track is allowed to render the source stream or false if it is not. this can be used to intentionally mute a
track. when enabled, a
track's data is output from the source to the destination; otherwise, empty frames are output. in the case of audio, a disabled
track generates frames of silence (that is, frames in which every sample's value is 0). for video
tracks, every frame is filled entirely with black pixels. the value of enabled, in essence, represents what a typical user would consider the muting state for a
track, whereas the muted property indicates a state in which the
track is temporarily unable to output data, such as a scenario in which frames have been lost in transit. note: if the tr...
... empty audio frames have every sample's value set to 0. ...
... empty audio frames have every sample's value set to 0. empty video frames have every pixel set to black. ...
...And 3 more matches
MediaStreamTrack: mute event - Web APIs
the mute event is sent to a mediastream
track when the
track's source is temporarily unable to provide media data. when the
track is once again able to produce media output, an unmute event is sent. during the time between the mute event and the unmute event, the value of the
track's muted property is true. note: the condition that most people think of as "muted" (that is, a user-toggled state of silencing a
track) is actually managed using the mediastream
track.enabled property, for which there are no events. bubbles no cancelable no interface event event handler property onmute examples in this example, event handlers are established for the mute and unmute events in order to detect when the media is not flowing from the source for t...
...k) is actually managed using the mediastream
track.enabled property, for which there are no events. bubbles no cancelable no interface event event handler property onmute examples in this example, event handlers are established for the mute and unmute events in order to detect when the media is not flowing from the source for the mediastream
track referenced by music
track. ...
...stream
track.enabled property, for which there are no events. bubbles no cancelable no interface event event handler property onmute examples in this example, event handlers are established for the mute and unmute events in order to detect when the media is not flowing from the source for the mediastream
track referenced by music
track. ...
...And 3 more matches
MediaStreamTrack: unmute event - Web APIs
the unmute event is sent to a mediastream
track when the
track's source is once again able to provide media data after a period of not being able to do so. this ends the muted state that began with the mute event. bubbles no cancelable no interface event event handler property onunmute note: the condition that most people think of as "muted" (that is, a user-controllable way to silence a
track) is actually managed using the mediastream
track.enabled property, for which there are no events. ...
... onunmute note: the condition that most people think of as "muted" (that is, a user-controllable way to silence a
track) is actually managed using the mediastream
track.enabled property, for which there are no events. examples in this example, event handlers are established for the mute and unmute events in order to detect when the media is not flowing from the source for the mediastream
track stored in the variable music
track. ...
... people think of as "muted" (that is, a user-controllable way to silence a
track) is actually managed using the mediastream
track.enabled property, for which there are no events. examples in this example, event handlers are established for the mute and unmute events in order to detect when the media is not flowing from the source for the mediastream
track stored in the variable music
track. ...
...And 3 more matches
MediaTrackConstraints.cursor - Web APIs
however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. ...
...however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. ...
...ints.cursor as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. ...
...And 3 more matches
MediaTrackConstraints.displaySurface - Web APIs
however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. ...
...rface property is a constraindomstring describing the requested or mandatory constraints placed upon the value of the displaysurface constrainable property. this is used to specify the type or types of display surfaces which getdisplaymedia() will let the user select among for sharing purposes. if needed, you can determine whether or not this constraint is supported by checking the value of media
tracksupportedconstraints.displaysurface as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. syntax var constraintsobject = { displaysurface: constraint }; constraintsobject.displaysurface = constraint; value a constraindomstring which specifies the type of display surfac...
...lue does not affect the list of display sources in the browser's user interface. see how constraints are defined in capabilities, constraints, and settings for an explanation of how to define constraints. ...
...And 3 more matches
MediaTrackSettings.frameRate - Web APIs
however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. ...
...however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. ...
...however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. ...
...And 3 more matches
MediaTrackSettings.noiseSuppression - Web APIs
noise suppression automatically filters the audio to remove background noise, hum caused by equipment, and the like from the sound before delivering it to your code. this feature is typically used on microphones, although it is technically possible it could be provided by other input sources as well. ...
... noise suppression automatically filters the audio to remove background noise, hum caused by equipment, and the like from the sound before delivering it to your code. this feature is typically used on microphones, although it is technically possible it could be provided by other input sources as well. ...
... noise suppression automatically filters the audio to remove background noise, hum caused by equipment, and the like from the sound before delivering it to your code. ...
...And 3 more matches
VideoTrack - Web APIs
the video
track interface represents a single video
track from a <video> element. the most common use for accessing a video
track object is to toggle its selected property in order to make it the active video
track for its <video> element. properties selected a boolean value which controls whether or not the video
track is active. only a single video
track can be active at any given time, so setting this property to true for one
track while another
track is active will make that other
track inactive. id read only a domstring which uniquely identifies the
track within the media. this id can be used to locate a specific
track within a video
track list by calling video
tracklist.get
trackbyid(). the id can also be used as the fragment part of the url if the media supports seeking by media fra...
... a domstring which uniquely identifies the
track within the media. this id can be used to locate a specific
track within a video
track list by calling video
tracklist.get
trackbyid(). the id can also be used as the fragment part of the url if the media supports seeking by media fragment per the media fragments uri specification. kind read only a domstring specifying the category into which the
track falls. for example, the main video
track would have a kind of "main". label read only a domstring providing a human-readable label for the
track. for example, a
track whose kind is "sign" might have a label of "a sign-language interpretation". this string is empty if no label is provided. ...
...string specifying the category into which the
track falls. for example, the main video
track would have a kind of "main". label read only a domstring providing a human-readable label for the
track. for example, a
track whose kind is "sign" might have a label of "a sign-language interpretation". this string is empty if no label is provided. language read only a domstring specifying the video
track's primary language, or an empty string if unknown. the language is specified as a bcp 47 (rfc 5646) language code, such as "en-us" or "pt-br". sourcebuffer read only the sourcebuffer that created the
track. returns null if the
track was not created by a sourcebuffer or the sourcebuffer has been removed from the mediasource.sourcebuffers attribute of its parent media source. usage notes to g...
...And 3 more matches
AudioContext.createMediaStreamTrackSource() - Web APIs
the createmediastream
tracksource() method of the audiocontext interface creates and returns a mediastream
trackaudiosourcenode which represents an audio source whose data comes from the specified mediastream
track. this differs from createmediastreamsource(), which creates a mediastreamaudiosourcenode whose audio comes from the audio
track in a specified mediastream whose id is first, lexicographically (alphabetically). syntax var audioctx = new audiocontext(); var
track = audioctx.createmediastream
tracksource(
track); parameters
track the mediastream
track to use as the source of all audio data for the new node. return value a mediastream
trackaudiosourcenode object which acts as a source for audio data found in the specified audio
track. example in this example, getusermedia() is...
... then a biquadfilternode is created using createbiquadfilter(), and it's configured as desired to perform a lowshelf filter on the audio coming from the source. ...
... then a biquadfilternode is created using createbiquadfilter(), and it's configured as desired to perform a lowshelf filter on the audio coming from the source. ...
...And 2 more matches
AudioTrack.label - Web APIs
the read-only audio
track property label returns a string specifying the audio
track's human-readable label, if one is available; otherwise, it returns an empty string. syntax var audio
tracklabel = audio
track.label; value a domstring specifying the
track's human-readable label, if one is available in the
track metadata. otherwise, an empty string ("") is returned. for example, a
track whose kind is "commentary" might have a label such as "commentary with director mark markmarkimark and star donna donnalidon". example this example returns an array of
track kinds and labels for potential use in a user interface to select audio
tracks for a specified media element. the list is filtered to only allow certain
track kinds through. ...
...") is returned. for example, a
track whose kind is "commentary" might have a label such as "commentary with director mark markmarkimark and star donna donnalidon". example this example returns an array of
track kinds and labels for potential use in a user interface to select audio
tracks for a specified media element. the list is filtered to only allow certain
track kinds through. ...
...xample, a
track whose kind is "commentary" might have a label such as "commentary with director mark markmarkimark and star donna donnalidon". example this example returns an array of
track kinds and labels for potential use in a user interface to select audio
tracks for a specified media element. the list is filtered to only allow certain
track kinds through. ...
...And 2 more matches
AudioTrackList: change event - Web APIs
the change event is fired when an audio
track is enabled or disabled, for example by changing the
track's enabled property. ...
... the change event is fired when an audio
track is enabled or disabled, for example by changing the
track's enabled property. ...
... no cancelable no interface event event handler property onchange examples using addeventlistener(): const videoelement = document.queryselector('video'); videoelement.audio
tracks.addeventlistener('change', (event) => { console.log(`'${event.type}' event fired`); }); // changing the value of `enabled` will trigger the `change` event const toggle
trackbutton = document.queryselector('.toggle-
track'); toggle
trackbutton.addeventlistener('click', () => { const
track = videoelement.audio
tracks[0];
track.enabled = !
track.enabled; }); using the onchange event handler property: const videoelement = document.queryselector('video'); videoelement.audio
tracks.onchange = (event) => { console.log(`'${event.type}' event fired`); }; // changing th...
...And 2 more matches
HTMLMediaElement.audioTracks - Web APIs
the read-only audio
tracks property on htmlmediaelement objects returns an audio
tracklist object listing all of the audio
track objects representing the media element's audio
tracks. the media element may be either an <audio> element or a <video> element. the returned list is live; that is, as
tracks are added to and removed from the media element, the list's contents change dynamically. once you have a reference to the list, you can monitor it for changes to detect when new audio
tracks are added or existing ones removed. see event handlers in audio
tracklist to learn more about watching for changes to a media element's
track list. syntax var audio
tracks = mediaelement.audio
tracks; value a audio
tracklist object representing the list of audio
tracks included in the media element. ...
... html the html establishes the element itself. ...
...new audio
tracks are added or existing ones removed. see event handlers in audio
tracklist to learn more about watching for changes to a media element's
track list. syntax var audio
tracks = mediaelement.audio
tracks; value a audio
tracklist object representing the list of audio
tracks included in the media element. the list of
tracks can be accessed using array notation, or using the object's get
trackbyid() method. each
track is represented by a audio
track object which provides information about the
track. examples in this example, all of the audio
tracks on a given element are muted. html the html establishes the element itself. <video id="video" src="somevideo.mp4"></video> javascript the javascript code handles muting the video element's audio
tracks. var video = document.geteleme...
...And 2 more matches
MediaStream.onremovetrack - Web APIs
the mediastream.onremove
track property is an eventhandler which specifies a function to be called when the remove
track event occurs on a mediastream instance. this happens when a
track of any kind is removed from the media stream. this event is fired when the browser removes a
track from the stream (such as when a rtcpeerconnection is renegotiated or a stream being captured using htmlmediaelement.capturestream() gets a new set of
tracks because the media element being captured loaded a new source. the remove
track event does not get fired when javascript code explicitly removes
tracks from the stream (by calling remove
track()). ...
...er removes a
track from the stream (such as when a rtcpeerconnection is renegotiated or a stream being captured using htmlmediaelement.capturestream() gets a new set of
tracks because the media element being captured loaded a new source. the remove
track event does not get fired when javascript code explicitly removes
tracks from the stream (by calling remove
track()). syntax mediastream.onremove
track = eventhandler; value this should be set to a function which you provide that accepts as input a mediastream
trackevent object representing the remove
track event which has occurred. the mediastream
track representing the
track which was removed is specified in the event's
track property. ...
...lling remove
track()). syntax mediastream.onremove
track = eventhandler; value this should be set to a function which you provide that accepts as input a mediastream
trackevent object representing the remove
track event which has occurred. the mediastream
track representing the
track which was removed is specified in the event's
track property. example this example adds a listener which, when a
track is removed from the stream, logs the
track that was removed. ...
...And 2 more matches
MediaStreamTrack.applyConstraints() - Web APIs
constraints can be used to ensure that the media meets certain guidelines you prefer. for example, you may prefer high-density video but require that the frame rate be a little low to help keep the data rate low enough not overtax the network. constraints can also specify ideal and/or acceptable sizes or ranges of sizes. ...
...r example, you may prefer high-density video but require that the frame rate be a little low to help keep the data rate low enough not overtax the network. constraints can also specify ideal and/or acceptable sizes or ranges of sizes. see applying constraints in capabilities, constraints, and settings for more information on how to apply your preferred constraints. syntax const appliedpromise =
track.applyconstraints([constraints]) parameters constraints optional a media
trackconstraints object listing the constraints to apply to the
track's constrainable properties; any existing constraints are replaced with the new values specified, and any constrainable properties not included are restored to their default constraints. if this parameter is omitted, all currently set custom constraints ...
...traints are replaced with the new values specified, and any constrainable properties not included are restored to their default constraints. if this parameter is omitted, all currently set custom constraints are cleared. this object represents the basic set of constraints that must apply for the promise to resolve. the object may contain an advanced property containing an array of additional media
trackconstrants objects, which are treated as exact requires. return value a promise which resolves when the constraints have been successfully applied. if the constraints cannot be applied, the promise is rejected with a mediastreamerror whose name is overconstrainederror, to indicate that the constraints could not be met. this can happen if the specified constraints are too strict to find a match...
...And 2 more matches
MediaStreamTrack: ended event - Web APIs
there are various ways this can happen, including: there is no more data left to send. the user revoked the permissions needed for the data to be sent. the hardware generating the source data has been removed or ejected. a remote peer has permanently stopped sending data; pausing media does not generate an ended event. ...
...there are various ways this can happen, including: there is no more data left to send. the user revoked the permissions needed for the data to be sent. the hardware generating the source data has been removed or ejected. a remote peer has permanently stopped sending data; pausing media does not generate an ended event. ...
... there is no more data left to send. the user revoked the permissions needed for the data to be sent. the hardware generating the source data has been removed or ejected. a remote peer has permanently stopped sending data; pausing media does not generate an ended event. ...
...And 2 more matches
MediaStreamTrackEvent - Web APIs
these events are sent to the stream when these changes occur. ...
...these events are sent to the stream when these changes occur. ...
..."50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">event</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#d4dde4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/mediastream
trackevent" target="_top"><rect x="116" y="1" width="210" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="221" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">mediastream
trackevent</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} the events based on ...
...And 2 more matches
MediaTrackConstraints.logicalSurface - Web APIs
the media
trackconstraints dictionary's logicalsurface property is a constraindomstring describing the requested or mandatory constraints placed upon the value of the logicalsurface constrainable property. this is used to specify whether or not getdisplaymedia() should allow the user to choose display surfaces which are not necessarily fully visible on the screen, such as occluded windows or the complete content of windows which are large enough to require scrolling to see their entire contents. if needed, you can determine whether or not this constraint is supported by checking the value of media
tracksupportedconstraints.logicalsurface as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they'...
...logical surfaces should be permitted among the selections available to the user. see how constraints are defined in capabilities, constraints, and settings for an explanation of how to define constraints. ...
...ions available to the user. see how constraints are defined in capabilities, constraints, and settings for an explanation of how to define constraints. usage notes you can check the setting selected by the user agent after the display media has been created by getdisplaymedia() by calling getsettings() on the display media's video mediastream
track, then checking the value of the returned media
tracksettings object's logicalsurface object. ...
...And 2 more matches
MediaTrackSupportedConstraints - Web APIs
because of the way interface definitions in webidl work, if a constraint is requested but not supported, no error will occur. ...
... because of the way interface definitions in webidl work, if a constraint is requested but not supported, no error will occur. ...
... because of the way interface definitions in webidl work, if a constraint is requested but not supported, no error will occur. ...
...And 2 more matches
VideoTrack.label - Web APIs
the read-only video
track property label returns a string specifying the video
track's human-readable label, if one is available; otherwise, it returns an empty string. syntax var video
tracklabel = video
track.label; value a domstring specifying the
track's human-readable label, if one is available in the
track metadata. otherwise, an empty string ("") is returned. for example, a
track whose kind is "sign" might have a label such as "a sign-language interpretation.". example this example returns an array of
track kinds and labels for potential use in a user interface to select video
tracks for a specified media element. the list is filtered to only allow certain
track kinds through. ...
...rack metadata. otherwise, an empty string ("") is returned. for example, a
track whose kind is "sign" might have a label such as "a sign-language interpretation.". example this example returns an array of
track kinds and labels for potential use in a user interface to select video
tracks for a specified media element. the list is filtered to only allow certain
track kinds through. ...
...se, an empty string ("") is returned. for example, a
track whose kind is "sign" might have a label such as "a sign-language interpretation.". example this example returns an array of
track kinds and labels for potential use in a user interface to select video
tracks for a specified media element. the list is filtered to only allow certain
track kinds through. ...
...And 2 more matches
VideoTrackList: change event - Web APIs
the change event is fired when a video
track is made active or inactive, for example by changing the
track's selected property. ...
... the change event is fired when a video
track is made active or inactive, for example by changing the
track's selected property. ...
... no cancelable no interface event event handler property onchange examples using addeventlistener(): const videoelement = document.queryselector('video'); videoelement.video
tracks.addeventlistener('change', (event) => { console.log(`'${event.type}' event fired`); }); // changing the value of `selected` will trigger the `change` event const toggle
trackbutton = document.queryselector('.toggle-
track'); toggle
trackbutton.addeventlistener('click', () => { const
track = videoelement.video
tracks[0];
track.selected = !
track.selected; }); using the onchange event handler property: const videoelement = document.queryselector('video'); videoelement.video
tracks.onchange = (event) => { console.log(`'${event.type}' event fired`); }; // changing ...
...And 2 more matches
Grid Tracks - MDN Web Docs Glossary: Definitions of Web-related terms
a grid
track is the space between two grid lines. they are defined in the explicit grid by using the grid-template-columns and grid-template-rows properties or the shorthand grid or grid-template properties.
tracks are also created in the implicit grid by positioning a grid item outside of the
tracks created in the explicit grid. the image below shows the first row
track on a grid.
track sizing in the explicit grid when defining grid
tracks using grid-template-columns and grid-template-rows you may use any length unit, and also the flex unit, fr which indicates a portion of the available space in the grid container. the example below demonstrates a grid with three column
tracks, one of 200 pixels, the second of 1fr, the third of 3fr. once the 200 pixels has been subtracted from the...
... ...
... ...
... ...
MediaStream.onaddtrack - Web APIs
the mediastream.onadd
track property is an eventhandler which specifies a function to be called when the add
track event occurs on a mediastream instance. this happens when a new
track of any kind is added to the media stream. this event is fired when the browser adds a
track to the stream (such as when a rtcpeerconnection is renegotiated or a stream being captured using htmlmediaelement.capturestream() gets a new set of
tracks because the media element being captured loaded a new source. the add
track event does not get fired when javascript code explicitly adds
tracks to the stream (by calling add
track()). ...
...ired when the browser adds a
track to the stream (such as when a rtcpeerconnection is renegotiated or a stream being captured using htmlmediaelement.capturestream() gets a new set of
tracks because the media element being captured loaded a new source. the add
track event does not get fired when javascript code explicitly adds
tracks to the stream (by calling add
track()). syntax mediastream.onadd
track = eventhandler; value this should be set to a function which you provide that accepts as input a mediastream
trackevent object representing the add
track event which has occurred. the mediastream
track representing the
track which was added is specified in the event's
track property. ...
... (by calling add
track()). syntax mediastream.onadd
track = eventhandler; value this should be set to a function which you provide that accepts as input a mediastream
trackevent object representing the add
track event which has occurred. the mediastream
track representing the
track which was added is specified in the event's
track property. example this example adds a listener which, when a new
track is added to the stream, appends a new item to a list of
tracks; the new item shows the
track's kind ("audio" or "video") and label. ...
...nput a mediastream
trackevent object representing the add
track event which has occurred. the mediastream
track representing the
track which was added is specified in the event's
track property. example this example adds a listener which, when a new
track is added to the stream, appends a new item to a list of
tracks; the new item shows the
track's kind ("audio" or "video") and label. stream.onadd
track = function(event) { let
tracklist = document.getelementbyid("
tracks"); let label = document.createelement("li"); label.innerhtml = event.
track.kind + ": " + event.
track.label;
tracklist.appendchild(label); }; specifications specification status comment media capture and streamsthe definition of 'mediastream.onadd
track' in that specification. candidate re...
MediaStreamTrack.clone() - Web APIs
specifications specification status comment media capture and streamsthe definition of 'clone()' in that specification. ...
... specifications specification status comment media capture and streamsthe definition of 'clone()' in that specification. ...
... specifications specification status comment media capture and streamsthe definition of 'clone()' in that specification. ...
... specifications specification status comment media capture and streamsthe definition of 'clone()' in that specification. ...
MediaTrackConstraints.groupId - Web APIs
however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. syntax var constraintsobject = { groupid: constraint }; constraintsobject.groupid = constraint; value an object based on constraindomstring specifying one or more acceptable, ideal, and/or exact (mandatory) group ids which are acceptable as the source of media content. ...
...m the same physical device. for example, the microphone and speaker on the same headset would share a group id. this makes it possible to use the group id to ensure that the audio and input devices are on the same headset by retrieving the group id of the input device and specifying it when asking for an output device, perhaps. ...
...up id to ensure that the audio and input devices are on the same headset by retrieving the group id of the input device and specifying it when asking for an output device, perhaps. however, the value of the groupid is determined by the source of the
track's content, and there's no particular format mandated by the specification (although some kind of guid is recommended). that means that a given
track will only return one value for the groupid when you call getcapabilities(), and keep in mind that this value will change for each browsing session. ...
... example see example: constraint exerciser in capabilities, constraints, and settings for an example. ...
MediaTrackSettings.aspectRatio - Web APIs
the media
tracksettings dictionary's aspectratio property is a double-precision floating-point number indicating the aspect ratio of the mediastream
track as currently configured. this lets you determine what value was selected to comply with your specified constraints for this property's value as described in the media
trackconstraints.aspectratio property you provided when calling either getusermedia() or mediastream
track.applyconstraints(). if needed, you can determine whether or not this constraint is supported by checking the value of media
tracksupportedconstraints.aspectratio as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. ...
...for example, the standard 16:9 high-definition aspect ratio can be computed as 1920/1080, or 1.7777777778. ...
...for example, the standard 16:9 high-definition aspect ratio can be computed as 1920/1080, or 1.7777777778. example see example: constraint exerciser in capabilities, constraints, and settings for an example. ...
...for example, the standard 16:9 high-definition aspect ratio can be computed as 1920/1080, or 1.7777777778. ...
MediaTrackSettings.autoGainControl - Web APIs
automatic gain control is a feature in which a sound source automatically manages changes in the volume of its source media to maintain a steady overall volume level. this feature is typically used on microphones, although it can be provided by other input sources as well. ...
... automatic gain control is a feature in which a sound source automatically manages changes in the volume of its source media to maintain a steady overall volume level. this feature is typically used on microphones, although it can be provided by other input sources as well. ...
... automatic gain control is a feature in which a sound source automatically manages changes in the volume of its source media to maintain a steady overall volume level. ...
....applyconstraints(). automatic gain control is a feature in which a sound source automatically manages changes in the volume of its source media to maintain a steady overall volume level. this feature is typically used on microphones, although it can be provided by other input sources as well. if needed, you can determine whether or not this constraint is supported by checking the value of media
tracksupportedconstraints.autogaincontrol as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. syntax var autogaincontrol = media
tracksettings.autogaincontrol; value a boolean value which is true if the
track has automatic gain control enabled or false if agc is disabled. ...
MediaTrackSettings.deviceId - Web APIs
the media
tracksettings dictionary's deviceid property is a domstring which uniquely identifies the source for the corresponding mediastream
track for the origin corresponding to the browsing session. this lets you determine what value was selected to comply with your specified constraints for this property's value as described in the media
trackconstraints.deviceid property you provided when calling either getusermedia(). if needed, you can determine whether or not this constraint is supported by checking the value of media
tracksupportedconstraints.deviceid as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. ...
...hen calling either getusermedia(). if needed, you can determine whether or not this constraint is supported by checking the value of media
tracksupportedconstraints.deviceid as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. because rtp doesn't include this information,
tracks associated with a webrtc rtcpeerconnection will never include this property. syntax var deviceid = media
tracksettings.deviceid; value a domstring whose value is an origin-unique identifier for the
track's source. this id is valid across multiple browsing sessions for the same origin and is guaranteed to be different for all other origins, so you can safely use it to request the same source ...
....deviceid; value a domstring whose value is an origin-unique identifier for the
track's source. this id is valid across multiple browsing sessions for the same origin and is guaranteed to be different for all other origins, so you can safely use it to request the same source be used for multiple sessions, for example. the actual value of the string, however, is determined by the source of the
track, and there is no guarantee what form it will take, although the specification does recommend it be a guid. since there is a one-to-one pairing of id with each source, all
tracks with the same source will share the same id for any given origin, so mediastream
track.getcapabilities() will always return exactly one value for deviceid. that makes the device id not useful for any changes to constraint...
... an exception to the rule that device ids are the same across browsing sessions: private browsing mode will use a different id, and will change it each browsing session. ...
MediaTrackSettings.groupId - Web APIs
the media
tracksettings dictionary's groupid property is a browsing-session unique domstring which identifies the group of devices which includes the source for the mediastream
track. this lets you determine what value was selected to comply with your specified constraints for this property's value as described in the media
trackconstraints.groupid property you provided when calling either getusermedia(). if needed, you can determine whether or not this constraint is supported by checking the value of media
tracksupportedconstraints.groupid as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. ...
...when calling either getusermedia(). if needed, you can determine whether or not this constraint is supported by checking the value of media
tracksupportedconstraints.groupid as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. because rtp doesn't include this information,
tracks associated with a webrtc rtcpeerconnection will never include this property. syntax var groupid = media
tracksettings.groupid; value a domstring whose value is a browsing-session unique identifier for a group of devices which includes the source of the
track's contents. two devices share the same group id if they belong to the same physical hardware device. for example, a headset has two dev...
... the group id is not usable across multiple browsing sessions. however, it can be used to ensure that audio input and output are both being performed on the same headset, for example, or to ensure that the built-in camera and microphone on a phone are being used for video conferencing purposes. ...
...ve as an output for audio. the group id is not usable across multiple browsing sessions. however, it can be used to ensure that audio input and output are both being performed on the same headset, for example, or to ensure that the built-in camera and microphone on a phone are being used for video conferencing purposes. the actual value of the string, however, is determined by the source of the
track, and there is no guarantee what form it will take, although the specification does recommend it be a guid. since this property isn't stable across browsing sessions, its usefulness when calling getusermedia() is generally limited to ensuring that tasks performed during the same browsing session use devices from the same group (or that they don't use devices from the same group). there is no situ...
RTCPeerConnection.ontrack - Web APIs
the rtcpeerconnection property on
track is an eventhandler which specifies a function to be called when the
track event occurs, indicating that a
track has been added to the rtcpeerconnection. the function receives as input the event object, of type rtc
trackevent; this event is sent when a new incoming mediastream
track has been created and associated with an rtcrtpreceiver object which has been added to the set of receivers on connection. syntax rtcpeerconnection.on
track = eventhandler; value set on
track to be a function you provide that accepts as input a rtc
trackevent object describing the new
track and how it's being used. ...
...ent when a new incoming mediastream
track has been created and associated with an rtcrtpreceiver object which has been added to the set of receivers on connection. syntax rtcpeerconnection.on
track = eventhandler; value set on
track to be a function you provide that accepts as input a rtc
trackevent object describing the new
track and how it's being used. this information includes the mediastream
track object representing the new
track, the rtcrtpreceiver and rtcrtptransceiver, and a list of mediastream objects which indicates which stream or streams the
track is part of.. example this example, taken from the code for the article signaling and video calling, connects the incoming
track to the <video> element which will be used to display the incoming video. ...
...includes the mediastream
track object representing the new
track, the rtcrtpreceiver and rtcrtptransceiver, and a list of mediastream objects which indicates which stream or streams the
track is part of.. example this example, taken from the code for the article signaling and video calling, connects the incoming
track to the <video> element which will be used to display the incoming video. pc.on
track = function(event) { document.getelementbyid("received_video").srcobject = event.streams[0]; document.getelementbyid("hangup-button").disabled = false; }; the first line of our on
track event handler takes the first stream in the incoming
track and sets the srcobject attribute to that. this connects that stream of video to the element so that it begins to be presented to the user. the second ...
...cobject attribute to that. this connects that stream of video to the element so that it begins to be presented to the user. the second line of code simply enables a "hang up" button, which the user can use to disconnect from the call. specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnection.on
track' in that specification. candidate recommendation initial specification. ...
RTCPeerConnection.removeTrack() - Web APIs
the rtcpeerconnection.remove
track() method tells the local end of the connection to stop sending media from the specified
track, without actually removing the corresponding rtcrtpsender from the list of senders as reported by rtcpeerconnection.getsenders(). if the
track is already stopped, or is not in the connection's senders list, this method has no effect. if the connection has already been negotiated (signalingstate is set to "stable"), it is marked as needing to be negotiated again; the remote peer won't experience the change until this negotiation occurs. a negotiationneeded event is sent to the rtcpeerconnection to let the local end know this negotiation must occur. ...
...in the connection's senders list, this method has no effect. if the connection has already been negotiated (signalingstate is set to "stable"), it is marked as needing to be negotiated again; the remote peer won't experience the change until this negotiation occurs. a negotiationneeded event is sent to the rtcpeerconnection to let the local end know this negotiation must occur. syntax pc.remove
track(sender); parameters media
track a rtcrtpsender specifying the sender to remove from the connection. return value undefined. exceptions invalidstateerror the connection is not open. example this example adds a video
track to a connection and sets up a listener on a close button which removes the
track when the user clicks the button. var pc, sender; navigator.getusermedia({video: ...
...the sender to remove from the connection. return value undefined. exceptions invalidstateerror the connection is not open. example this example adds a video
track to a connection and sets up a listener on a close button which removes the
track when the user clicks the button. ...
...om the connection. return value undefined. exceptions invalidstateerror the connection is not open. example this example adds a video
track to a connection and sets up a listener on a close button which removes the
track when the user clicks the button. var pc, sender; navigator.getusermedia({video: true}, function(stream) { pc = new rtcpeerconnection(); var
track = stream.getvideo
tracks()[0]; sender = pc.add
track(
track, stream); }); document.getelementbyid("closebutton").addeventlistener("click", function(event) { pc.remove
track(sender); pc.close(); }, false); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnection.remove
track()' in that specification. candidate ...
TextTrackCue - Web APIs
text
trackcue is an abstract class which is used as the basis for the various derived cue types, such as vttcue; you will instead work with those derived types. these cues represent a string of text that is presented for some duration of time during the performance of a text
track. the cue includes the start time (the time at which the text will be displayed) and the end time (the time at which it will be removed from the display), as well as other information. properties this interface also inherits properties from eventtarget. text
trackcue.
track read only the text
track that this cue belongs to, or null if it doesn't belong to any. text
trackcue.id a domstring that identifies the cue. ...
...t time (the time at which the text will be displayed) and the end time (the time at which it will be removed from the display), as well as other information. properties this interface also inherits properties from eventtarget. text
trackcue.
track read only the text
track that this cue belongs to, or null if it doesn't belong to any. text
trackcue.id a domstring that identifies the cue. text
trackcue.starttime a double that represents the video time that the cue will start being displayed, in seconds. ...
...display), as well as other information. properties this interface also inherits properties from eventtarget. text
trackcue.
track read only the text
track that this cue belongs to, or null if it doesn't belong to any. text
trackcue.id a domstring that identifies the cue. text
trackcue.starttime a double that represents the video time that the cue will start being displayed, in seconds. text
trackcue.endtime a double that represents the video time that the cue will stop being displayed, in seconds. text
trackcue.pauseonexit a boolean for whether the video will pause when this cue stops being displayed. event handlers text
trackcue.onenter the event handler for the enter event. text
trackcue.onexit the event handler for the exit event. specifications specification sta...
...ill stop being displayed, in seconds. text
trackcue.pauseonexit a boolean for whether the video will pause when this cue stops being displayed. event handlers text
trackcue.onenter the event handler for the enter event. text
trackcue.onexit the event handler for the exit event. specifications specification status comment html living standardthe definition of 'text
trackcue' in that specification. living standard html5the definition of 'text
trackcue' in that specification. recommendation initial definition ...
AudioTrack.kind - Web APIs
the kind property contains a string indicating the category of audio contained in the audio
track. the kind can be used to determine the scenarios in which specific
tracks should be enabled or disabled. see audio
track kind strings for a list of the kinds available for audio
tracks. syntax var
trackkind = audio
track.kind; value a domstring specifying the type of content the media represents. the string is one of those found in audio
track kind strings below. audio
track kind strings the kinds available for audio
tracks are: "alternative" a potential alternative to the main
track, such as a different audio take or a version of the sound
track with only the music and no dialogue. "descriptions" an audio
track providing audible descriptions of the action depicted in a video
track. "mai...
...ound in audio
track kind strings below. audio
track kind strings the kinds available for audio
tracks are: "alternative" a potential alternative to the main
track, such as a different audio take or a version of the sound
track with only the music and no dialogue. "descriptions" an audio
track providing audible descriptions of the action depicted in a video
track. "main" the primary audio
track. "main-desc" the primary audio
track with audio descriptions mixed into it. "translation" a translated version of the primary audio
track. "commentary" an audio
track containing a commentary. this might be used to contain the director's commentary
track on a movie, for example. ...
...ble descriptions of the action depicted in a video
track. "main" the primary audio
track. "main-desc" the primary audio
track with audio descriptions mixed into it. "translation" a translated version of the primary audio
track. "commentary" an audio
track containing a commentary. this might be used to contain the director's commentary
track on a movie, for example. "" (empty string) the
track doesn't have an explicit kind, or the kind provided by the
track's metadata isn't recognized by the user agent. specifications specification status comment html living standardthe definition of 'audio
track: kind' in that specification. living standard html5the definition of 'audio
track.kind' in that specification. recommendation ...
AudioTrackList.length - Web APIs
the read-only audio
tracklist property length returns the number of entries in the audio
tracklist, each of which is an audio
track representing one audio
track in the media element. a value of 0 indicates that there are no audio
tracks in the media. syntax var
trackcount = audio
tracklist.length; value a number indicating how many audio
tracks are included in the audio
tracklist. each
track can be accessed by treating the audio
tracklist as an array of objects of type audio
track. example this snippet gets the number of audio
tracks in the first <video> element found in the dom by queryselector(). ...
...ount = audio
tracklist.length; value a number indicating how many audio
tracks are included in the audio
tracklist. each
track can be accessed by treating the audio
tracklist as an array of objects of type audio
track. example this snippet gets the number of audio
tracks in the first <video> element found in the dom by queryselector(). var videoelem = document.queryselector("video"); var numaudio
tracks = 0; if (videoelem.audio
tracks) { numaudio
tracks = videoelem.audio
tracks.length; } note that this sample checks to be sure htmlmediaelement.audio
tracks is defined, to avoid failing on browsers without support for audio
track. specifications specification status comment html living standardthe definition of 'audio
tracklist.length' in that specification. living...
... = videoelem.audio
tracks.length; } note that this sample checks to be sure htmlmediaelement.audio
tracks is defined, to avoid failing on browsers without support for audio
track. specifications specification status comment html living standardthe definition of 'audio
tracklist.length' in that specification. living standard html5the definition of 'audio
tracklist.length' in that specification. recommendation ...
MediaStream.getAudioTracks() - Web APIs
the getaudio
tracks() method of the mediastream interface returns a sequence that represents all the mediastream
track objects in this stream's
track set where mediastream
track.kind is audio. syntax var mediastream
tracks = mediastream.getaudio
tracks() parameters none. return value an array of mediastream
track objects, one for each audio
track contained in the stream. audio
tracks are those
tracks whose kind property is audio. the array is empty if the stream contains no audio
tracks. note: the order of the returned
tracks is not defined by the specification and may, in fact, change from one call to getaudio
tracks() to the next. ...
...iastream
track objects, one for each audio
track contained in the stream. audio
tracks are those
tracks whose kind property is audio. the array is empty if the stream contains no audio
tracks. note: the order of the returned
tracks is not defined by the specification and may, in fact, change from one call to getaudio
tracks() to the next. early versions of this api included a special audiostream
track interface which was used as the type for each entry in the list of audio streams; however, this has since been merged into the main mediastream
track interface. example this example gets a webcam's audio and video in a stream using getusermedia(), attaches the stream to a <video> element, then sets a timer that, upon expiring, will stop the first audio
track found on the stream. navigator.media...
... and video in a stream using getusermedia(), attaches the stream to a <video> element, then sets a timer that, upon expiring, will stop the first audio
track found on the stream. navigator.mediadevices.getusermedia({audio: true, video: true}) .then(mediastream => { document.queryselector('video').srcobject = mediastream; // stop the audio stream after 5 seconds settimeout(() => { const
tracks = mediastream.getaudio
tracks()
tracks[0].stop() }, 5000) }) specifications specification status comment media capture and streamsthe definition of 'getaudio
tracks()' in that specification. candidate recommendation initial definition. ...
MediaStream.getVideoTracks() - Web APIs
the getvideo
tracks() method of the mediastream interface returns a sequence of mediastream
track objects representing the video
tracks in this stream. syntax var mediastream
tracks[] = mediastream.getvideo
tracks(); parameters none. return value an array of mediastream
track objects, one for each video
track contained in the media stream. video
tracks are those
tracks whose kind property is video. the array is empty if the stream contains no video
tracks. note: the order of the
tracks is not defined by the specification, and may not be the same from one call to getvideo
tracks() to another. ...
... mediastream
track objects, one for each video
track contained in the media stream. video
tracks are those
tracks whose kind property is video. the array is empty if the stream contains no video
tracks. note: the order of the
tracks is not defined by the specification, and may not be the same from one call to getvideo
tracks() to another. early versions of this api included a special videostream
track interface which was used as the type for each entry in the list of video streams; however, this has since been merged into the main mediastream
track interface. example the following example, extracted from chrome's image capture / photo resolution sample, uses getvideo
tracks() to retrieve a
track for passing to the imagecapture() constructor. var imagecapture; navigator.mediadevices.getuserm...
... merged into the main mediastream
track interface. example the following example, extracted from chrome's image capture / photo resolution sample, uses getvideo
tracks() to retrieve a
track for passing to the imagecapture() constructor. var imagecapture; navigator.mediadevices.getusermedia({video: true}) .then(mediastream => { document.queryselector('video').srcobject = mediastream; const
track = mediastream.getvideo
tracks()[0]; imagecapture = new imagecapture(
track); return imagecapture.getphotocapabilities(); }) specifications specification status comment media capture and streamsthe definition of 'getvideo
tracks()' in that specification. candidate recommendation initial definition. ...
MediaStreamTrack.getConstraints() - Web APIs
these constraints indicate values and ranges of values that the web site or application has specified are required or acceptable for the included constrainable properties. constraints can be used to ensure that the media meets certain guidelines you prefer. for example, you may prefer high definition video but require that the frame rate be a little low to help keep the data rate low enough not overtax the network. constraints can also specify ideal and/or acceptable sizes or ranges of sizes. ...
...rtain guidelines you prefer. for example, you may prefer high definition video but require that the frame rate be a little low to help keep the data rate low enough not overtax the network. constraints can also specify ideal and/or acceptable sizes or ranges of sizes. see capabilities, constraints, and settings for details on how to work with constrainable properties. syntax const constraints =
track.getconstraints() return value a media
trackconstraints object which indicates the constrainable properties the web site or app most recently set using applyconstraints(). the properties in the returned object are listed in the same order as when they were set, and only properties specifically set by the site or app are included. note: the returned set of constraints doesn't necessarily describ...
...e: the returned set of constraints doesn't necessarily describe the actual state of the media. even if any of the constraints couldn't be met, they are still included in the returned object as originally set by the site's code. to get the currently active settings for all constrainable properties, you should instead call getsettings(). example this example obtains the current constraints for a
track, sets the facingmode, and applies the updated constraints. function switchcameras(
track, camera) { const constraints =
track.getconstraints(); constraints.facingmode = camera;
track.applyconstraints(constraints); } specifications specification status comment media capture and streamsthe definition of 'getconstraints()' in that specification. candidate recommend...
MediaStreamTrack.onoverconstrained - Web APIs
an event handler always has one single parameter, containing the event, here of type mediastreamerrorevent. ...
...an event handler always has one single parameter, containing the event, here of type mediastreamerrorevent. ...
...an event handler always has one single parameter, containing the event, here of type mediastreamerrorevent. ...
MediaStreamTrack.onunmute - Web APIs
mediastream
track's onunmute event handler is called when the unmute event is received. such an event is sent when the
track is again able to send data. when the onunmute event handler is called, the
track's muted flag is false. syntax
track.onunmute = unmutehandler; value unmutehandler is a function which is called when the mediastream
track receives the unmute event. the event handler receives as input a single parameter: an event whose kind is "unmute". example this example creates an unmute event handler which changes the state of a visual indicator to display the emoji character representing a "speaker" icon. ...
... candidate recommendation initial specification. ...
...nt whose kind is "unmute". example this example creates an unmute event handler which changes the state of a visual indicator to display the emoji character representing a "speaker" icon. my
track.onunmute = function(evt) { playstateicon.innerhtml = "🔈"; }; specifications specification status comment media capture and streamsthe definition of 'mediastream
track.onunmute' in that specification. candidate recommendation initial specification. ...
MediaStreamTrackAudioSourceNode - Web APIs
the mediastream
trackaudiosourcenode interface is a type of audionode which represents a source of audio data taken from a specific mediastream
track obtained through the webrtc or media capture and streams apis. the audio itself might be input from a microphone or other audio sampling device, or might be received through a rtcpeerconnection, among other posible options. a mediastream
trackaudiosourcenode has no inputs and exactly one output, and is created using the audiocontext.createmediastream
tracksource() method. this interface is similar to mediastreamaudiosourcenode, except it lets you specifically state the
track to use, rather than assuming the first audio
track on a stream. number of inputs 0 number of outputs 1 channel count defined by the first ...
...s and exactly one output, and is created using the audiocontext.createmediastream
tracksource() method. this interface is similar to mediastreamaudiosourcenode, except it lets you specifically state the
track to use, rather than assuming the first audio
track on a stream. number of inputs 0 number of outputs 1 channel count defined by the first audio mediastream
track passed to the audiocontext.createmediastream
tracksource() method that created it. constructor new mediastream
trackaudiosourcenode() creates a new mediastream
trackaudiosourcenode object instance with the specified options. properties the mediastream
trackaudiosourcenode interface has no properties of its own; however, it inherits the properties of its parent, audionode. methods inhe...
... working draft ...
MediaTrackConstraints.deviceId - Web APIs
the media
trackconstraints dictionary's deviceid property is a constraindomstring describing the requested or mandatory constraints placed upon the value of the deviceid constrainable property. if needed, you can determine whether or not this constraint is supported by checking the value of media
tracksupportedconstraints.deviceid as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. because rtp doesn't include this information,
tracks associated with a webrtc rtcpeerconnection will never include this property. syntax var constraintsobject = { deviceid: constraint }; constraintsobject.deviceid = constraint; value an object based on constraindomstring specifying one...
...object.deviceid = constraint; value an object based on constraindomstring specifying one or more acceptable, ideal, and/or exact (mandatory) device ids which are acceptable as the source of media content. device ids are unique for a given origin, and are guaranteed to be the same across browsing sessions on the same origin. ...
...e ids which are acceptable as the source of media content. device ids are unique for a given origin, and are guaranteed to be the same across browsing sessions on the same origin. however, the value of the deviceid is determined by the source of the
track's content, and there's no particular format mandated by the specification (although some kind of guid is recommended). that means that a given
track will only return one value for the deviceid when you call getcapabilities(). because of this, there's no use for the device id when calling mediastream
track.applyconstraints(), since there is only one possible value; however, you can record a deviceid and use it to ensure that you get the same source for multiple calls to getusermedia(). an exception to the rule that device ids are the same ac...
MediaTrackSettings.channelCount - Web APIs
the media
tracksettings dictionary's channelcount property is an integer indicating how many audio channel the mediastream
track is currently configured to have. this lets you determine what value was selected to comply with your specified constraints for this property's value as described in the media
trackconstraints.channelcount property you provided when calling either getusermedia() or mediastream
track.applyconstraints(). if needed, you can determine whether or not this constraint is supported by checking the value of media
tracksupportedconstraints.channelcount as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. ...
...a value of 1 indicates monaural sound, 2 means stereo, and so forth. example see example: constraint exerciser in capabilities, constraints, and settings for an example. ...
...a value of 1 indicates monaural sound, 2 means stereo, and so forth. example see example: constraint exerciser in capabilities, constraints, and settings for an example. specifications specification status comment media capture and streamsthe definition of 'channelcount' in that specification. ...
MediaTrackSettings.cursor - Web APIs
motion the mouse cursor should always be included in the video if it's moving, and for a short time after it stops moving. never the mouse cursor is never included in the shared video. ...
... motion the mouse cursor should always be included in the video if it's moving, and for a short time after it stops moving. never the mouse cursor is never included in the shared video. ...
... working draft initial definition ...
MediaTrackSettings.displaySurface - Web APIs
the media
tracksettings dictionary's displaysurface property indicates the type of display surface being captured. syntax displaysurface = media
tracksettings.displaysurface; value the value of displaysurface is a string that comes from the displaycapturesurfacetype enumerated type, and is one of the following: application the stream's video
track contains all of the windows belonging to the application chosen by the user. the windows are aggragated into a single video
track, with any empty space filled with a backdrop; that backdrop is selected by the user agent. browser the stream's video
track presents the entire contents of a single browser tab which the user selected during the getdisplaymedia() call. ...
...the window may be from any application, not necessarily just from within the user agent. ...
.... browser the stream's video
track presents the entire contents of a single browser tab which the user selected during the getdisplaymedia() call. monitor the video
track in the stream presents the complete contents of one or more of the user's screens. any empty space (if the displays are of different dimensions) is filled with a backdrop chosen by the user agent. window the stream's video
track presents the contents of a single window selected by the user. the window may be from any application, not necessarily just from within the user agent. not all user agents support all of these surface types. specifications specification status comment screen capturethe definition of 'media
tracksettings.displaysurface' in that specification. working draft initial ...
MediaTrackSettings.echoCancellation - Web APIs
the media
tracksettings dictionary's echocancellation property is a boolean value whose value indicates whether or not echo cancellation is enabled on an audio
track. this lets you determine what value was selected to comply with your specified constraints for this property's value as described in the media
trackconstraints.echocancellation property you provided when calling either getusermedia() or mediastream
track.applyconstraints(). echo cancellation is a feature which attempts to prevent echo effects on a two-way audio connection by attempting to reduce or eliminate crosstalk between the user's output device and their input device. for example, it might apply a filter that negates the sound being produced on the speakers from being included in the input
track generated from the microphone. ...
... on a two-way audio connection by attempting to reduce or eliminate crosstalk between the user's output device and their input device. for example, it might apply a filter that negates the sound being produced on the speakers from being included in the input
track generated from the microphone. if needed, you can determine whether or not this constraint is supported by checking the value of media
tracksupportedconstraints.echocancellation as returned by a call to mediadevices.getsupportedconstraints(). ...
...rated from the microphone. if needed, you can determine whether or not this constraint is supported by checking the value of media
tracksupportedconstraints.echocancellation as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. because rtp doesn't include this information,
tracks associated with a webrtc rtcpeerconnection will never include this property. syntax var echocancellation = media
tracksettings.echocancellation; value a boolean value which is true if the
track has echo cancellation functionality enabled or false if echo cancellation is disabled. example see example: constraint exerciser in capabilities, constraints, and settings for an example. specifica...
MediaTrackSettings.height - Web APIs
the media
tracksettings dictionary's height property is an integer indicating the number of pixels tall mediastream
track is currently configured to be. this lets you determine what value was selected to comply with your specified constraints for this property's value as described in the media
trackconstraints.height property you provided when calling either getusermedia() or mediastream
track.applyconstraints(). if needed, you can determine whether or not this constraint is supported by checking the value of media
tracksupportedconstraints.height as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. ...
... example see example: constraint exerciser in capabilities, constraints, and settings for an example. ...
... example see example: constraint exerciser in capabilities, constraints, and settings for an example. ...
MediaTrackSettings.logicalSurface - Web APIs
the most common scenario in which a display surface may be a logical one is if the selected surface contains the entire content area of a window which is too large to display onscreen at once. ...
...s dictionary's logicalsurface property indicates whether or not the display area being captured is a logical surface. logical surfaces are those which are not necessarily entirely onscreen, or may even be off-screen, such as windows' backing buffers (where only part of the buffer is visible without scrolling the containing window) and offscreen rendering contexts. syntax islogicalsurface = media
tracksettings.logicalsurface; value a boolean value which is true if the video
track in the stream of captured video is taken from a logical display surface. the most common scenario in which a display surface may be a logical one is if the selected surface contains the entire content area of a window which is too large to display onscreen at once. since the window that contains the surface has to b...
...currently visible onscreen. for example, a user agent may choose to allow the user to choose whether to share the entire document (a browser with logicalsurface value of true), or just the currently visible portion of the document (where the logicalsurface of the browser surface is false). specifications specification status comment screen capturethe definition of 'media
tracksettings.logicalsurface' in that specification. working draft initial definition ...
MediaTrackSettings.sampleSize - Web APIs
the media
tracksettings dictionary's samplesize property is an integer indicating the linear sample size (in bits per sample) the mediastream
track is currently configured for. this lets you determine what value was selected to comply with your specified constraints for this property's value as described in the media
trackconstraints.samplesize property you provided when calling either getusermedia() or mediastream
track.applyconstraints(). if needed, you can determine whether or not this constraint is supported by checking the value of media
tracksupportedconstraints.samplesize as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. ...
...rmedia() or mediastream
track.applyconstraints(). if needed, you can determine whether or not this constraint is supported by checking the value of media
tracksupportedconstraints.samplesize as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. syntax var samplesize = media
tracksettings.samplesize; value an integer value indicating how many bits each audio sample is represented by. the most commonly used sample size for many years now is 16 bits per sample, which was used for cd audio among others. other common sample sizes are 8 (for reduced bandwidth requirements) and 24 (for high-resolution professional audio). ...
...that means that a given sample actually uses (samplesize/8)*channelcount bytes of data. for example, 16-bit stereo audio requires (16/8)*2 or 4 bytes per sample. example see example: constraint exerciser in capabilities, constraints, and settings for an example. ...
MediaTrackSettings.width - Web APIs
the media
tracksettings dictionary's width property is an integer indicating the number of pixels wide mediastream
track is currently configured to be. this lets you determine what value was selected to comply with your specified constraints for this property's value as described in the media
trackconstraints.width property you provided when calling either getusermedia() or mediastream
track.applyconstraints(). if needed, you can determine whether or not this constraint is supported by checking the value of media
tracksupportedconstraints.width as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. ...
... example see example: constraint exerciser in capabilities, constraints, and settings for an example. ...
... example see example: constraint exerciser in capabilities, constraints, and settings for an example. ...
MediaTrackSupportedConstraints.frameRate - Web APIs
see the example to see how this can be used. ...
...an value which is present (and set to true) in the object returned by mediadevices.getsupportedconstraints() if and only if the user agent supports the framerate constraint. if the constraint isn't supported, it's not included in the list, so this value will never be false. the framerate constraint can be used to establish acceptable upper and lower bounds on the video frame rate for a new video
track, or to specify an exact frame rate that must be provided for the request to succeed. checking the value of this property lets you determine if the user agent allows constraining the video
track configuration by frame rate. see the example to see how this can be used. syntax framerateconstraintsupported = supportedconstraintsdictionary.framerate; value this property is present in the dictionar...
...lows constraining the video
track configuration by frame rate. see the example to see how this can be used. syntax framerateconstraintsupported = supportedconstraintsdictionary.framerate; value this property is present in the dictionary if the user agent supports the framerate constraint. if the property isn't present, the user agent doesn't allow specifying limits on the frame rate for video
tracks. if this property is present, its value is always true. example this simple example looks to see if your browser supports constraining the frame rate when requesting video
tracks. javascript let result = document.getelementbyid("result"); if (navigator.mediadevices.getsupportedconstraints().framerate) { result.innerhtml = "supported!"; } else { result.innerhtml = "not supported!"...
RTCPeerConnection: track event - Web APIs
the
track event is sent to the on
track event handler on rtcpeerconnections after a new
track has been added to an rtcrtpreceiver which is part of the connection. bubbles yes cancelable no interface rtc
trackevent event handler property on
track by the time this event is delivered, the new
track has been fully added to the peer connection. see
track event types in rtc
trackevent for details. examples this example shows code that creates a new rtcpeerconnection, then adds a new
track event handler. ...
...has been fully added to the peer connection. see
track event types in rtc
trackevent for details. examples this example shows code that creates a new rtcpeerconnection, then adds a new
track event handler. pc = new rtcpeerconnection({ iceservers: [ { urls: "turn:fake.turnserver.url", username: "someusername", credential: "somepassword" } ] }); pc.addeventlistener("
track", e => { videoelement.srcobject = e.streams[0]; hangupbutton.disabled = false; }, false); the event handler assigns the new
track's first stream to an existing <video> element, identified using the variable videoelement. you can also assign the event handler function to the on
track property, rather than use addeventlistener(). ...
...: "somepassword" } ] }); pc.addeventlistener("
track", e => { videoelement.srcobject = e.streams[0]; hangupbutton.disabled = false; }, false); the event handler assigns the new
track's first stream to an existing <video> element, identified using the variable videoelement. you can also assign the event handler function to the on
track property, rather than use addeventlistener(). pc.on
track = e => { videoelement.srcobject = e.streams[0]; hangupbutton.disabled = false; return false; } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of '
track' in that specification. candidate recommendation initial specification. ...
RTCRtpReceiver.track - Web APIs
candidate recommendation initial definition. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
... candidate recommendation initial definition. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
...efinition. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
RTCTrackEvent() - Web APIs
the rtc
trackevent() constructor creates and returns a new rtc
trackevent object, configured to describe the
track which has been added to the rtcpeerconnection. in general, you won't need to use this constructor, as rtc
trackevent objects are created by webrtc and delivered to your rtcpeerconnector's on
track event handler as appropriate. syntax
trackevent = new rtc
trackevent(eventinfo); parameters eventinfo an object based on the rtc
trackeventinit dictionary, providing information about the
track which has been added to the rtcpeerconnection. this object has the following properties: receiver the rtcrtpreceiver which is being used to receive the
track's media. streams optional an array of mediastream objects representing each of the streams that comprise the event's corresponding tr...
...ntinfo an object based on the rtc
trackeventinit dictionary, providing information about the
track which has been added to the rtcpeerconnection. this object has the following properties: receiver the rtcrtpreceiver which is being used to receive the
track's media. streams optional an array of mediastream objects representing each of the streams that comprise the event's corresponding
track.
track the mediastream
track the event is associated with. transceiver the rtcrtptransceiver associated with the event. return value a new rtc
trackevent describing a
track which has been added to the rtcpeerconnection. ...
...ent's corresponding
track.
track the mediastream
track the event is associated with. transceiver the rtcrtptransceiver associated with the event. return value a new rtc
trackevent describing a
track which has been added to the rtcpeerconnection. specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtc
trackevent()' in that specification. candidate recommendation initial specification. ...
TrackDefault - Web APIs
the
trackdefault interface provides a sourcebuffer with kind, label, and language information for
tracks that do not contain this information in the initialization segments of a media chunk. a
trackdefault object is provided to a sourcebuffer object by setting its sourcebuffer.
trackdefaults property. constructor
trackdefault() constructs and returns a new
trackdefault object. properties
trackdefault.type read only returns the type of
track that this sourcebuffer's media segment data relates to (i.e. audio, video, or text
track.)
trackdefault.bytestream
trackid read only returns the id of the specific
track that the sourcebuffer should apply to. ...
...rcebuffer.
trackdefaults property. constructor
trackdefault() constructs and returns a new
trackdefault object. properties
trackdefault.type read only returns the type of
track that this sourcebuffer's media segment data relates to (i.e. audio, video, or text
track.)
trackdefault.bytestream
trackid read only returns the id of the specific
track that the sourcebuffer should apply to.
trackdefault.language read only returns the default language to use when an initialization segment does not contain language information for a new
track.
trackdefault.label read only returns the default label to use when an initialization segment does not contain label information for a new
track. ...
...ackid read only returns the id of the specific
track that the sourcebuffer should apply to.
trackdefault.language read only returns the default language to use when an initialization segment does not contain language information for a new
track.
trackdefault.label read only returns the default label to use when an initialization segment does not contain label information for a new
track.
trackdefault.kinds read only returns the default kinds used when an initialization segment does not contain kind information for a new
track. ...
VideoTrack.kind - Web APIs
the kind property contains a string indicating the category of video contained in the video
track. the kind can be used to determine the scenarios in which specific
tracks should be enabled or disabled. see video
track kind strings for a list of the kinds available for video
tracks. syntax var
trackkind = video
track.kind; value a domstring specifying the type of content the media represents. the string is one of those found in video
track kind strings below. video
track kind strings the kinds available for video
tracks are: "alternative" a potential alternative to the main
track, such as a different video take or a version of the sound
track with only the music and no dialogue. "captions" a version of the main video
track with captions burnt in. "main" the primary video
track. "si...
...trings below. video
track kind strings the kinds available for video
tracks are: "alternative" a potential alternative to the main
track, such as a different video take or a version of the sound
track with only the music and no dialogue. "captions" a version of the main video
track with captions burnt in. "main" the primary video
track. "sign" a sign-language interpretation of an audio
track. "subtitles" a version of the main video
track with subtitles burnt in. "commentary" a video
track containing a commentary. this might be used to contain the director's commentary
track on a movie, for example. "" (empty string) the
track doesn't have an explicit kind, or the kind provided by the
track's metadata isn't recognized by the user agent. specifications specification ...
...commentary" a video
track containing a commentary. this might be used to contain the director's commentary
track on a movie, for example. "" (empty string) the
track doesn't have an explicit kind, or the kind provided by the
track's metadata isn't recognized by the user agent. specifications specification status comment html living standardthe definition of 'video
track: kind' in that specification. living standard ...
-ms-scrollbar-track-color - Archive of obsolete content
the -ms-scrollbar-
track-color css property is a microsoft extension that specifies the color of the
track element of a scrollbar. initial valuescrollbarapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete syntax values <color> the color of the
track element. formal syntax <color>where <color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]? ) | rgb( <number>{3} [ / <alpha-value> ]? ) | rgb( <percentage>#{3} , <alpha-value>? ) | rgb( <number>#{3} , <alpha-value>? )<rgba()> = rgba( <percentage>{3} [ / <alpha-value> ]? ) | rgba( <number>{3} [ / <alpha-value> ]? ) | rgba( <percentage>#{3} , <alpha-value>? ) | rgba( <number>#{3} , ...
... div { width: 150px; height: 150px; border-style: solid; border-width: thin; overflow-y: scroll; font-family: sans-serif; float: left; margin-right: 10px; } .bluescroll { -ms-scrollbar-highlight-color: aqua; -ms-scrollbar-face-color: blue; -ms...
AudioTrack.id - Web APIs
the id property contains a string which uniquely identifies the
track represented by the audio
track. this id can be used with the audio
tracklist.get
trackbyid() method to locate a specific
track within the media associated with a media element. the
track id can also be used as the fragment of a url that loads the specific
track (if the media supports media fragments). syntax var
trackid = audio
track.id; value a domstring which identifies the
track, suitable for use when calling get
trackbyid() on an audio
tracklist such as the one specified by a media element's audio
tracks property. specifications specification status comment html living standardthe definition of 'audio
track.id' in that specification. living standard html5the definition of 'au...
...; value a domstring which identifies the
track, suitable for use when calling get
trackbyid() on an audio
tracklist such as the one specified by a media element's audio
tracks property. specifications specification status comment html living standardthe definition of 'audio
track.id' in that specification. living standard html5the definition of 'audio
track.id' in that specification. recommendation ...
CanvasCaptureMediaStreamTrack.requestFrame() - Web APIs
applications that need to carefully control the timing of rendering and frame capture can use requestframe() to directly specify when it's time to capture a frame. to prevent automatic capture of frames, so that frames are only captured when requestframe() is called, specify a value of 0 for the capturestream() method when creating the stream. syntax stream.requestframe(); return value undefined usage notes there is currently an issue flagged in the specification pointing out that at this time, no exceptions are being thrown if the canvas isn't origin-clean. ...
...ceptions such as securityerror (although the specific error that might be thrown is not mentioned in the spec, this is a likely candidate). example // find the canvas element to capture var canvaselt = document.getelementsbytagname("canvas")[0]; // get the stream var stream = canvaselt.capturestream(25); // 25 fps // send the current state of the canvas as a frame to the stream stream.getvideo
tracks()[0].requestframe(); specifications specification status comment media capture from dom elementsthe definition of 'canvascapturemediastream.requestframe()' in that specification. working draft initial definition ...
CanvasCaptureMediaStreamTrack - Web APIs
the canvascapturemediastream
track interface represents the video
track contained in a mediastream being generated from a <canvas> following a call to htmlcanvaselement.capturestream(). part of the media capture and streams api. properties this interface inherits the properties of its parent, mediastream
track. canvascapturemediastream
track.canvas read only returns the htmlcanvaselement object whose surface is captured in real-time. methods this interface inherits the methods of its parent, mediastream
track. canvascapturemediastream
track.requestframe() manually forces a frame to be captured and sent to the stream. this lets applications that wish to specify the frame capture times directly do so, if they specified a framerate of 0 when calling capturestream(). specifications ...
...apturemediastream
track.requestframe() manually forces a frame to be captured and sent to the stream. this lets applications that wish to specify the frame capture times directly do so, if they specified a framerate of 0 when calling capturestream(). specifications specification status comment media capture from dom elementsthe definition of 'canvascapturemediastream
track' in that specification. working draft initial definition ...
HTMLMediaElement.videoTracks - Web APIs
the read-only video
tracks property on htmlmediaelement objects returns a video
tracklist object listing all of the video
track objects representing the media element's video
tracks. the returned list is live; that is, as
tracks are added to and removed from the media element, the list's contents change dynamically. once you have a reference to the list, you can monitor it for changes to detect when new video
tracks are added or existing ones removed. see event handlers in video
tracklist to learn more about watching for changes to a media element's
track list. syntax var video
tracks = mediaelement.video
tracks; value a video
tracklist object representing the list of video
tracks included in the media element. ...
... reference to the list, you can monitor it for changes to detect when new video
tracks are added or existing ones removed. see event handlers in video
tracklist to learn more about watching for changes to a media element's
track list. syntax var video
tracks = mediaelement.video
tracks; value a video
tracklist object representing the list of video
tracks included in the media element. the list of
tracks can be accessed using array notation, or using the object's get
trackbyid() method. each
track is represented by a video
track object which provides information about the
track. specifications specification status comment html living standardthe definition of 'htmlmediaelement.video
tracks' in that specification. living standard no change from html5 ...
MediaStream.getTrackById() - Web APIs
the mediastream.get
trackbyid() method returns a mediastream
track object representing the
track with the specified id string. if there is no
track with the specified id, this method returns null. syntax var
track = mediastream.get
trackbyid(id); parameters id a domstring which identifies the
track to be returned. return value if a
track is found for which mediastream
track.id matches the specified id string, that mediastream
track object is returned. otherwise, the returned value is null. example this example activates a commentary
track on a video by ducking the audio level of the main audio
track to 50%, then enabling the commentary
track. ...
...mstring which identifies the
track to be returned. return value if a
track is found for which mediastream
track.id matches the specified id string, that mediastream
track object is returned. otherwise, the returned value is null. example this example activates a commentary
track on a video by ducking the audio level of the main audio
track to 50%, then enabling the commentary
track. stream.get
trackbyid("primary-audio-
track").applyconstraints({ volume: 0.5 }); stream.get
trackbyid("commentary-
track").enabled = true; specifications specification status comment media capture and streamsthe definition of 'get
trackbyid()' in that specification. candidate recommendation initial specification. ...
MediaStream.getTracks() - Web APIs
the get
tracks() method of the mediastream interface returns a sequence that represents all the mediastream
track objects in this stream's
track set, regardless of mediastream
track.kind. syntax var mediastream
tracks = mediastream.get
tracks() parameters none. return value an array of mediastream
track objects. example navigator.mediadevices.getusermedia({audio: false, video: true}) .then(mediastream => { document.queryselector('video').srcobject = mediastream; // stop the stream after 5 seconds settimeout(() => { const
tracks = mediastream.get
tracks()
tracks[0].stop() }, 5000) }) specifications specification status comment media capture and streamsthe definition of 'get
tracks()' in that specification. candidate recommendation initial d...
...ition. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
MediaStreamTrack.muted - Web APIs
the muted read-only property of the mediastream
track interface returns a boolean value indicating whether or not the
track is currently unable to provide media output. to implement a way for users to mute and unmute a
track, use the enabled property. when a
track is disabled by setting enabled to false, it generates only empty frames (audio frames in which every sample is 0, or video frames in which every pixel is black). syntax const mutedflag =
track.muted value a boolean which is true if the
track is currently muted, or false if the
track is currently unmuted. when possible, avoid polling muted to monitor the
track's muting status. instead, add event listeners for the mute and unmute events. ...
...ch every sample is 0, or video frames in which every pixel is black). syntax const mutedflag =
track.muted value a boolean which is true if the
track is currently muted, or false if the
track is currently unmuted. when possible, avoid polling muted to monitor the
track's muting status. instead, add event listeners for the mute and unmute events. example this example counts the number of
tracks in an array of mediastream
track objects which are currently muted. let mutedcount = 0;
tracklist.foreach((
track) => { if (
track.muted) { mutedcount += 1; } }); specifications specification status comment media capture and streamsthe definition of 'muted' in that specification. candidate recommendation initial definition. ...
MediaStreamTrack.onended - Web APIs
the mediastream
track.onended event handler is used to specify a function which serves as an eventhandler to be called when the ended event occurs on the
track. this event occurs when the
track will no longer provide data to the stream for any reason, including the end of the media input being reached, the user revoking needed permissions, the source device being removed, or the remote peer ending a connection. syntax mediastream
track.onended = function; value a function to serve as an eventhandler for the ended event. the event handler function receives a single parameter: the event object, which is a simple event object. examples this example sets up an event handler for the ended event which changes an on-screen icon to indicate that the
track is no longer active. ...
...te peer ending a connection. syntax mediastream
track.onended = function; value a function to serve as an eventhandler for the ended event. the event handler function receives a single parameter: the event object, which is a simple event object. examples this example sets up an event handler for the ended event which changes an on-screen icon to indicate that the
track is no longer active.
track.onended = function(event) { let statuselem = document.getelementbyid("status-icon"); statuselem.src = "/images/stopped-icon.png"; } specifications specification status comment media capture and streamsthe definition of 'mediastream
track.onended' in that specification. candidate recommendation initial specification. ...
MediaStreamTrack.remote - Web APIs
the mediastream
track.remote read-only property allows javascript to know whether a webrtc mediastream
track is from a remote source or a local one. it returns a boolean with a value of true if the
track is sourced remotely (that is, sourced by an rtcpeerconnection), or false if it is sourced locally. ...
... the mediastream
track.remote read-only property allows javascript to know whether a webrtc mediastream
track is from a remote source or a local one. it returns a boolean with a value of true if the
track is sourced remotely (that is, sourced by an rtcpeerconnection), or false if it is sourced locally. ...
MediaStreamTrackEvent() - Web APIs
the mediastream
trackevent() constructor returns a newly created mediastream
trackevent object, which represents an event announcing that a mediastream
track has been added to or removed from a mediastream. syntax var
trackevent = new mediastream
trackevent(type, {
track: amediastream
track}); parameters the mediastream
trackevent() constructor also inherits arguments from event(). type a domstring representing the name of the type of the mediastream
trackevent. it is case-sensitive and can be "add
track" or "remove
track".
track a mediastream
track object representing the
track which was added to or removed from the stream. return value a new mediastream
trackevent, initialized based on the provided options. specifications specification status comment media capture...
...ediastream
trackevent. it is case-sensitive and can be "add
track" or "remove
track".
track a mediastream
track object representing the
track which was added to or removed from the stream. return value a new mediastream
trackevent, initialized based on the provided options. specifications specification status comment media capture and streamsthe definition of 'mediastream
trackevent()' in that specification. candidate recommendation ...
MediaTrackConstraints.autoGainControl - Web APIs
however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. automatic gain control is typically a feature provided by microphones, although it can be provided by other input sources as well. ...
...however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. automatic gain control is typically a feature provided by microphones, although it can be provided by other input sources as well. ...
MediaTrackConstraints.channelCount - Web APIs
however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. ...
...however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. ...
MediaTrackConstraints.facingMode - Web APIs
the media
trackconstraints dictionary's facingmode property is a constraindomstring describing the requested or mandatory constraints placed upon the value of the facingmode constrainable property. if needed, you can determine whether or not this constraint is supported by checking the value of media
tracksupportedconstraints.facingmode as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. because rtp doesn't include this information,
tracks associated with a webrtc rtcpeerconnection will never include this property. syntax var constraintsobject = { facingmode: constraint }; constraintsobject.facingmode = constraint; value an object based on constraindomstring spec...
... an exact value in this case indicates that the specified facing mode is specifically required; for example: var constraints = { facingmode: { exact: "user" } }; this indicates that only a user-facing camera is acceptable; if there is no user-facing camera, or the user declines permission to use that camera, the media request will fail. ...
MediaTrackConstraints.height - Web APIs
however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. ...
...however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. ...
MediaTrackConstraints.latency - Web APIs
the media
trackconstraints dictionary's latency property is a constraindouble describing the requested or mandatory constraints placed upon the value of the latency constrainable property. if needed, you can determine whether or not this constraint is supported by checking the value of media
tracksupportedconstraints.latency as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. because rtp doesn't include this information,
tracks associated with a webrtc rtcpeerconnection will never include this property. syntax var constraintsobject = { latency: constraint }; constraintsobject.latency = constraint; value a constraindouble describing the acceptable or required valu...
...cessary since browsers will simply ignore any constraints they're unfamiliar with. because rtp doesn't include this information,
tracks associated with a webrtc rtcpeerconnection will never include this property. syntax var constraintsobject = { latency: constraint }; constraintsobject.latency = constraint; value a constraindouble describing the acceptable or required value(s) for an audio
track's latency, with values specified in seconds. in audio processing, latency is the time between the start of processing (when sound occurs in the real world, or is generated by a hardware device) and the data being made available to the next step in the audio input or output process. in most cases, low latency is desirable for performance and user experience purposes, but when power consumption is ...
MediaTrackConstraints.noiseSuppression - Web APIs
however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. noise suppression is typically provided by microphones, although it can be provided by other input sources as well. ...
...however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. noise suppression is typically provided by microphones, although it can be provided by other input sources as well. ...
MediaTrackConstraints.sampleRate - Web APIs
however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. ...
...however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. ...
MediaTrackConstraints.sampleSize - Web APIs
however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. ...
...however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. ...
MediaTrackConstraints.width - Web APIs
however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. ...
...however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. ...
MediaTrackSettings.latency - Web APIs
the media
tracksettings dictionary's latency property is a double-precision floating-point number indicating the estimated latency (specified in seconds) of the mediastream
track as currently configured. this lets you determine what value was selected to comply with your specified constraints for this property's value as described in the media
trackconstraints.latency property you provided when calling either getusermedia() or mediastream
track.applyconstraints(). this is, of course, an approximation, since latency can vary for many reasons including cpu, transmission, and storage overhead. if needed, you can determine whether or not this constraint is supported by checking the value of media
tracksupportedconstraints.latency as returned by a call to mediadevices.getsupportedconstraints(). howeve...
...transmission, and storage overhead. if needed, you can determine whether or not this constraint is supported by checking the value of media
tracksupportedconstraints.latency as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. because rtp doesn't include this information,
tracks associated with a webrtc rtcpeerconnection will never include this property. syntax var latency = media
tracksettings.latency; value a double-precision floating-point number indicating the estimated latency, in seconds, of the audio
track as currently configured. example see example: constraint exerciser in capabilities, constraints, and settings for an example. specifications s...
MediaTrackSettings.sampleRate - Web APIs
the media
tracksettings dictionary's samplerate property is an integer indicating how many audio samples per second the mediastream
track is currently configured for. this lets you determine what value was selected to comply with your specified constraints for this property's value as described in the media
trackconstraints.samplerate property you provided when calling either getusermedia() or mediastream
track.applyconstraints(). if needed, you can determine whether or not this constraint is supported by checking the value of media
tracksupportedconstraints.samplerate as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. ...
...common values include 44,100 (standard cd audio), 48,000 (standard digital audio), 96,000 (commonly used in audio mastering and post-production), and 192,000 (used for high-resolution audio in professional recording and mastering sessions). ...
MediaTrackSettings.volume - Web APIs
the media
tracksettings dictionary's volume property is a double-precision floating-point number indicating the volume of the mediastream
track as currently configured, as a value from 0.0 (silence) to 1.0 (maximum supported volume for the device). this lets you determine what value was selected to comply with your specified constraints for this property's value as described in the media
trackconstraints.volume property you provided when calling either getusermedia() or mediastream
track.applyconstraints(). if needed, you can determine whether or not this constraint is supported by checking the value of media
tracksupportedconstraints.volume as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints th...
...r getusermedia() or mediastream
track.applyconstraints(). if needed, you can determine whether or not this constraint is supported by checking the value of media
tracksupportedconstraints.volume as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. syntax var volume = media
tracksettings.volume; value a double-precision floating-point number indicating the volume, from 0.0 to 1.0, of the audio
track as currently configured. example see example: constraint exerciser in capabilities, constraints, and settings for an example. ...
MediaTrackSupportedConstraints.cursor - Web APIs
the supported constraints list is obtained by calling navigator.mediadevices.getsupportedconstraints(). syntax iscursorsupported = supportedconstraints.cursor; value a boolean value which is true if the cursor constraint is supported by the device and user agent. example this method sets up the constraints object specifying the options for the call to getdisplaymedia(). it adds the cursor constraint only if it is known to be supported by the browser. ...
... unknown initial definition ...
MediaTrackSupportedConstraints.displaySurface - Web APIs
the supported constraints list is obtained by calling navigator.mediadevices.getsupportedconstraints(). syntax isdisplaysurfacesupported = supportedconstraints.displaysurface; value a boolean value which is true if the displaysurface constraint is supported by the device and user agent. example this method sets up the constraints object specifying the options for the call to getdisplaymedia(). it adds the displaysurface constraint (requesting that only full-screen sharing be allowed) only if it is known to be supported by the browser. ...
... working draft initial definition ...
MediaTrackSupportedConstraints.logicalSurface - Web APIs
the supported constraints list is obtained by calling navigator.mediadevices.getsupportedconstraints(). syntax islogicalsurfacesupported = supportedconstraints.logicalsurface; value a boolean value which is true if the logicalsurface constraint is supported by the device and user agent. example this method sets up the constraints object specifying the options for the call to getdisplaymedia(). ...
... working draft initial definition ...
MediaTrackSupportedConstraints.noiseSuppression - Web APIs
the media
tracksupportedconstraints dictionary's noisesuppression property is a read-only boolean value which is present (and set to true) in the object returned by mediadevices.getsupportedconstraints() if and only if the user agent supports the noisesuppression constraint. if the constraint isn't supported, it's not included in the list, so this value will never be false. you can access the supported constraints dictionary by calling navigator.mediadevices.getsupportedconstraints(). the noisesuppression constraint indicates whether or not the browser offers the ability to automatically control the gain (volume) on media
tracks; this obviously is contingent on whether or not the individual device supports automatic gain control as well. syntax noisesuppressionsupported = supportedconstrain...
...if the property isn't present, this property is missing from the supported constraints dictionary, and you'll get undefined if you try to look at its value. example this example simply displays whether or not your browser supports the noisesuppression constraint. ...
RTCTrackEventInit.receiver - Web APIs
the rtc
trackeventinit dictionary's receiver property specifies the rtcrtpreceiver associated with the event. syntax var
trackeventinit = { receiver: rtpreceiver,
track: mediastream
track, streams: [videostream], transceiver: rtptransceiver }; var rtpreceiver =
trackeventinit.receiver; value the rtcrtptransceiver which pairs the receiver with a sender and other properties which establish a single bidirectional srtp stream for use by the
track associated with the rtc
trackevent. note: the transceiver includes its own receiver property, which will always be the same rtcrtpreceiver as this one. ...
...nder and other properties which establish a single bidirectional srtp stream for use by the
track associated with the rtc
trackevent. note: the transceiver includes its own receiver property, which will always be the same rtcrtpreceiver as this one. specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtc
trackeventinit.receiver' in that specification. candidate recommendation initial specification. ...
RTCTrackEventInit.transceiver - Web APIs
the rtc
trackeventinit dictionary's transceiver property specifies the rtcrtptransceiver associated with the
track event. the transceiver pairs the
track's receiver with an rtcrtpsender to allow bidirectional communication. syntax var
trackeventinit = { receiver: rtpreceiver,
track: mediastream
track, streams: [videostream], transceiver: rtptransceiver }; var rtptransceiver =
trackeventinit.transceiver; value the rtcrtptransceiver which pairs the receiver with a sender and other properties which establish a single bidirectional srtp stream for use by the
track associated with the rtc
trackevent. note: the rtcrtpreceiver referred to by this rtcrtpreceiver's receiver property will always be the same as the rtc
trackevent's receiver property. specifications specification ...
...h establish a single bidirectional srtp stream for use by the
track associated with the rtc
trackevent. note: the rtcrtpreceiver referred to by this rtcrtpreceiver's receiver property will always be the same as the rtc
trackevent's receiver property. specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtc
trackeventinit.transceiver' in that specification. candidate recommendation initial specification. ...
RTCTrackEventInit - Web APIs
the webrtc api's rtc
trackeventinit dictionary is used to provide information describing an rtc
trackevent when instantiating a new
track event using new rtc
trackevent(). properties rtc
trackeventinit inherits properties from the eventinit dictionary, and also includes the following properties: receiver the rtcrtpreceiver which is being used to receive the
track's media. streams optional an array of mediastream objects representing each of the streams that comprise the event's corresponding
track.
track the mediastream
track the event is associated with. transceiver the rtcrtptransceiver associated with the event. ...
...reams optional an array of mediastream objects representing each of the streams that comprise the event's corresponding
track.
track the mediastream
track the event is associated with. transceiver the rtcrtptransceiver associated with the event. specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtc
trackeventinit' in that specification. candidate recommendation initial specification. ...
getTrackById() - Web APIs
the text
tracklist method get
trackbyid() returns the first text
track object from the
track list whose id matches the specified string. this lets you find a specified
track if you know its id string. syntax var the
track = text
tracklist.get
trackbyid(id); paramters id a domstring indicating the id of the
track to locate within the
track list. return value a text
track object indicating the first
track found within the text
tracklist whose id matches the specified string. if no match is found, this method returns null. the
tracks are searched in their natural order; that is, in the order defined by the media resource itself, or, if the resource doesn't define an order, the relative order in which the
tracks are declared by the media resource. specifications specification stat...
...ring. if no match is found, this method returns null. the
tracks are searched in their natural order; that is, in the order defined by the media resource itself, or, if the resource doesn't define an order, the relative order in which the
tracks are declared by the media resource. specifications specification status comment html living standardthe definition of 'text
tracklist.get
trackbyid()' in that specification. living standard ...
TextTrackList.length - Web APIs
the read-only text
tracklist property length returns the number of entries in the text
tracklist, each of which is a text
track representing one
track in the media element. a value of 0 indicates that there are no text
tracks in the media. syntax var
trackcount = text
tracklist.length; value a number indicating how many text
tracks are included in the text
tracklist. each
track can be accessed by treating the text
tracklist as an array of objects of type text
track. example this snippet gets the number of text
tracks in the first media element found in the dom by queryselector(). ...
...kcount = text
tracklist.length; value a number indicating how many text
tracks are included in the text
tracklist. each
track can be accessed by treating the text
tracklist as an array of objects of type text
track. example this snippet gets the number of text
tracks in the first media element found in the dom by queryselector(). var mediaelem = document.queryselector("video, audio"); var numtext
tracks = 0; if (mediaelem.text
tracks) { numtext
tracks = mediaelem.text
tracks.length; } note that this sample checks to be sure htmlmediaelement.text
tracks is defined, to avoid failing on browsers without support for text
track. specifications specification status comment html living standardthe definition of 'text
tracklist: length' in that specification. living stan...
TextTrackList.onchange - Web APIs
the text
tracklist property onchange is an event handler which is called when the change event occurs, indicating that a change has occurred on a text
track in the video
tracklist. note: you can also add a handler for the change event using addeventlistener(). syntax text
tracklist.onchange = eventhandler; example this snippet establishes a handler for the change event that looks at each of the
tracks in the list, calling a function to update the state of a user interface control that indicates the current state of the
track. var
tracklist = document.queryselector("video, audio").text
tracks;
tracklist.onchange = function(event) { .... ...
...ch of the
tracks in the list, calling a function to update the state of a user interface control that indicates the current state of the
track. var
tracklist = document.queryselector("video, audio").text
tracks;
tracklist.onchange = function(event) { .... /* do something */ }; specifications specification status comment html living standardthe definition of 'text
tracklist: onchange' in that specification. living standard ...
getTrackById - Web APIs
the video
tracklist method get
trackbyid() returns the first video
track object from the
track list whose id matches the specified string. this lets you find a specified
track if you know its id string. syntax var the
track = video
tracklist.get
trackbyid(id); paramters id a domstring indicating the id of the
track to locate within the
track list. return value a video
track object indicating the first
track found within the video
tracklist whose id matches the specified string. if no match is found, this method returns null. the
tracks are searched in their natural order; that is, in the order defined by the media resource itself, or, if the resource doesn't define an order, the relative order in which the
tracks are declared by the media resource. specifications specification ...
...ing. if no match is found, this method returns null. the
tracks are searched in their natural order; that is, in the order defined by the media resource itself, or, if the resource doesn't define an order, the relative order in which the
tracks are declared by the media resource. specifications specification status comment html living standardthe definition of 'video
tracklist.get
trackbyid()' in that specification. living standard ...
VideoTrackList.length - Web APIs
the read-only video
tracklist property length returns the number of entries in the video
tracklist, each of which is a video
track representing one video
track in the media element. a value of 0 indicates that there are no video
tracks in the media. syntax var
trackcount = video
tracklist.length; value a number indicating how many video
tracks are included in the video
tracklist. each
track can be accessed by treating the video
tracklist as an array of objects of type video
track. example this snippet gets the number of video
tracks in the first <video> element found in the dom by queryselector(). ...
...ount = video
tracklist.length; value a number indicating how many video
tracks are included in the video
tracklist. each
track can be accessed by treating the video
tracklist as an array of objects of type video
track. example this snippet gets the number of video
tracks in the first <video> element found in the dom by queryselector(). var videoelem = document.queryselector("video"); var numvideo
tracks = 0; if (videoelem.video
tracks) { numvideo
tracks = videoelem.video
tracks.length; } note that this sample checks to be sure htmlmediaelement.video
tracks is defined, to avoid failing on browsers without support for video
track. specifications specification status comment html living standardthe definition of 'video
tracklist: length' in that specification. livin...
Blocked: Storage access requests from trackers
message firefox: cookieblocked
tracker=request to access cookies or storage on “x” was blocked because it came from a
tracker and content blocking is enabled. what went wrong? a request to access cookies or storage was blocked because the browser identified it as coming from a
tracker and content blocking is enabled. the permission can be changed or removed by: going to preferences > content blocking and either adding an exception with the manage exceptions… button choosing the custom content blocking and unchecking the
tracker checkbox if the blocked resource doesn't need authentication, you can fix the warning message by adding a crossorigin="anonymous" attribute to the relevant element. ...
AudioTrack.sourceBuffer - Web APIs
the read-only audio
track property sourcebuffer returns the sourcebuffer that created the
track, or null if the
track was not created by a sourcebuffer or the sourcebuffer has been removed from the mediasource.sourcebuffers attribute of its parent media source. syntax var sourcebuffer = audio
track.sourcebuffer; value a sourcebuffer or null. specifications specification status comment media source extensionsthe definition of 'audio
track: sourcebuffer' in that specification. recommendation ...
CanvasCaptureMediaStreamTrack.canvas - Web APIs
the canvascapturemediastream
track canvas read-only property returns the htmlcanvaselement from which frames are being captured. syntax var elt = stream.canvas; value an htmlcanvaselement indicating the canvas which is the source of the frames being captured. example // find the canvas element to capture var canvaselt = document.getelementsbytagname("canvas")[0]; // get the stream var stream = canvaselt.capturestream(25); // 25 fps // do things to the stream ... // obtain the canvas associated with the stream var canvas = stream.canvas; specifications specification status comment media capture from dom elementsthe definition of 'canvascapturemediastream
track.canvas' in that specification. working draft initial definition ...
MediaStream.addTrack() - Web APIs
the mediastream.add
track() method adds a new
track to the stream. the
track is specified as a parameter of type mediastream
track. if the specified
track is already in the stream's
track set, this method has no effect. syntax stream.add
track(
track); parameters
track a mediastream
track to add to the stream. return value undefined example specifications specification status comment media capture and streamsthe definition of 'add
track()' in that specification. candidate recommendation initial specification. ...
MediaStream: addtrack event - Web APIs
the add
track event is fired when a new mediastream
track object has been added to a mediastream. bubbles no cancelable no interface mediastream
trackevent event handler property onadd
track examples using addeventlistener(): let stream = new mediastream(); stream.addeventlistener('add
track', (event) => { console.log(`new ${event.
track.kind}
track added`); }); using the onadd
track event handler property: let stream = new mediastream(); stream.onadd
track = (event) => { console.log(`new ${event.
track.kind}
track added`); }; specifications specification status media capture and streamsthe definition of 'add
track' in that specification. candidate recommendation ...
MediaStream: removetrack event - Web APIs
the remove
track event is fired when a new mediastream
track object has been removed from a mediastream. bubbles no cancelable no interface mediastream
trackevent event handler property onremove
track examples using addeventlistener(): let stream = new mediastream(); stream.addeventlistener('remove
track', (event) => { console.log(`${event.
track.kind}
track removed`); }); using the onremove
track event handler property: let stream = new mediastream(); stream.onremove
track = (event) => { console.log(`${event.
track.kind}
track removed`); }; specifications specification status media capture and streamsthe definition of 'remove
track' in that specification. candidate recommendation ...
MediaStreamTrack.getCapabilities() - Web APIs
the getcapabilities() method of the mediastream
track interface returns a media
trackcapabilities object which specifies the values or range of values which each constrainable property, based upon the platform and user agent. once you know what the browser's capabilities are, your script can use applyconstraints() to ask for the
track to be configured to match ideal or acceptable settings. see capabilities, constraints, and settings for details on how to work with constrainable properties. syntax const capabilities =
track.getcapabilities() return value a media
trackcapabilities object which specifies the value or range of values which are supported for each of the user agent's supported constrainable properties. specifications specification status comment media cap...
MediaStreamTrack.getSettings() - Web APIs
the getsettings() method of the mediastream
track interface returns a media
tracksettings object containing the current values of each of the constrainable properties for the current mediastream
track. see capabilities, constraints, and settings for details on how to work with constrainable properties. syntax const settings =
track.getsettings() returns a media
tracksettings object describing the current configuration of the
track's constrainable properties. note: the returned object identifies the current values of every constrainable property, including those which are platform defaults rather than having been expressly set by the site's code. to instead fetch the most-recently established constraints for the
track's properties, as specified by the site's code, use getconstraints(). spec...
MediaStreamTrack.id - Web APIs
the mediastream
track.id read-only property returns a domstring containing a unique identifier (guid) for the
track, which is generated by the user agent. syntax const id =
track.id specifications specification status comment media capture and streamsthe definition of 'mediastream
track.id' in that specification. candidate recommendation initial specification. ...
MediaStreamTrack.kind - Web APIs
the mediastream
track.kind read-only property returns a domstring set to "audio" if the
track is an audio
track and to "video", if it is a video
track. it doesn't change if the
track is deassociated from its source. syntax const type =
track.kind value the possible values are a domstring with on of the following values: "audio": the
track is an audio
track. "video": the
track is a video
track. specifications specification status comment media capture and streamsthe definition of 'mediastream
track.kind' in that specification. candidate recommendation initial specification. ...
MediaStreamTrack.label - Web APIs
the mediastream
track.label read-only property returns a domstring containing a user agent-assigned label that identifies the
track source, as in "internal microphone". the string may be left empty and is empty as long as no source has been connected. when the
track is deassociated from its source, the label is not changed. syntax const label =
track.label specifications specification status comment media capture and streamsthe definition of 'mediastream
track.label' in that specification. candidate recommendation initial specification. ...
MediaStreamTrack.onmute - Web APIs
mediastream
track's onmute event handler is called when the mute event is received. such an event is sent when the
track is temporarily not able to send data. syntax
track.onmute = mutehandler; value a function to serve as an eventhandler for the mute event. the event handler function receives a single parameter: the event object, which is a simple event object. example in this example, an onmute handler is established to set the content html of an element to display the "muted speaker" emoji. my
track.onmute = function(evt) { playstateicon.innerhtml = "f507;"; }; specifications specification status comment media capture and streamsthe definition of 'mediastream
track.onmute' in that specification. candidate recommendation initial specification. ...
MediaStreamTrack.readyState - Web APIs
the mediastream
track.readystate read-only property returns an enumerated value giving the status of the
track. syntax const state =
track.readystate value it takes one of the following values: "live" which indicates that an input is connected and does its best-effort in providing real-time data. in that case, the output of data can be switched on or off using the mediastream
track.enabled property. "ended" which indicates that the input is not giving any more data and will never provide new data. specifications specification status comment media capture and streamsthe definition of 'mediastream
track.readystate' in that specification. candidate recommendation initial specification. ...
MediaStreamTrackAudioSourceOptions - Web APIs
the mediastream
trackaudiosourceoptions dictionary is used when specifying options to the mediastream
trackaudiosourcenode() constructor. it isn't needed when using the audiocontext.createmediastream
tracksource() method. properties mediastream
track the mediastream
track from which to take audio data for this node's output. specifications specification status comment web audio apithe definition of 'mediastream
trackaudiosourceoptions' in that specification. working draft ...
MediaTrackConstraints.aspectRatio - Web APIs
the media
trackconstraints dictionary's aspectratio property is a constraindouble describing the requested or mandatory constraints placed upon the value of the aspectratio constrainable property. if needed, you can determine whether or not this constraint is supported by checking the value of media
tracksupportedconstraints.aspectratio as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. syntax var constraintsobject = { aspectratio: constraint }; constraintsobject.aspectratio = constraint; value a constraindouble describing the acceptable or required value(s) for a video
track's aspect ratio. the value is the width divided by the height and is rounded to ten decim...
MediaTrackConstraints.echoCancellation - Web APIs
the media
trackconstraints dictionary's echocancellation property is a constrainboolean describing the requested or mandatory constraints placed upon the value of the echocancellation constrainable property. if needed, you can determine whether or not this constraint is supported by checking the value of media
tracksupportedconstraints.echocancellation as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. because rtp doesn't include this information,
tracks associated with a webrtc rtcpeerconnection will never include this property. syntax var constraintsobject = { echocancellation: constraint }; constraintsobject.echocancellation = constraint; value if this value ...
MediaTrackConstraints.frameRate - Web APIs
the media
trackconstraints dictionary's framerate property is a constraindouble describing the requested or mandatory constraints placed upon the value of the framerate constrainable property. if needed, you can determine whether or not this constraint is supported by checking the value of media
tracksupportedconstraints.framerate as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. syntax var constraintsobject = { framerate: constraint }; constraintsobject.framerate = constraint; value a constraindouble describing the acceptable or required value(s) for a video
track's frame rate, in frames per second. if this value is a number, the user agent will attempt to obt...
RTCRtpStreamStats.trackId - Web APIs
the rtcrtpstreamstats dictionary's
trackid property is a string which uniquely identifies the rtcmediastream
trackstats object which contains the
track statistics for the mediastream
track for which statistics are provided in this object. syntax var
trackid = rtcrtpstreamstats.
trackid; value a domstring which uniquely identifies the rtcmediastream
trackstats object that provides statistics for the
track for which statistics are being collected by this rtcstatsreport. note: this value is not the same as the value of mediastram
track.id. specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcrtpstreamstats.
trackid' in that specification. candidate recommendation initial definition. ...
RTCTrackEvent.receiver - Web APIs
the read-only receiver property of the rtc
trackevent interface indicates the rtcrtpreceiver which is used to receive data containing media for the
track to which the event refers. syntax var rtpreceiver =
trackevent.receiver; value the rtcrtptransceiver which pairs the receiver with a sender and other properties which establish a single bidirectional srtp stream for use by the
track associated with the rtc
trackevent. note: the transceiver includes its own receiver property, which will always be the same rtcrtpreceiver as this one. specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtc
trackevent.receiver' in that specification. candidate recommendation initial specification. ...
RTCTrackEvent.streams - Web APIs
the webrtc api interface rtc
trackevent's read-only streams property specifies an array of mediastream objects, one for each of the streams that comprise the
track being added to the rtcpeerconnection. syntax var streams =
trackevent.streams; value an array of mediastream objects, one for each stream that make up the new
track. specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtc
trackevent.streams' in that specification. candidate recommendation initial specification. ...
RTCTrackEvent.transceiver - Web APIs
the webrtc api interface rtc
trackevent's read-only transceiver property indicates the rtcrtptransceiver affiliated with the event's
track. the transceiver pairs the
track's receiver with an rtcrtpsender. syntax var rtptransceiver =
trackevent.transceiver; value the rtcrtptransceiver which pairs the receiver with a sender and other properties which establish a single bidirectional srtp stream for use by the
track associated with the rtc
trackevent. note: the rtcrtpreceiver referred to by this rtcrtpreceiver's receiver property will always be the same as the rtc
trackevent's receiver property. specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtc
trackevent.transceiver' in that specification. ca...
SourceBuffer.audioTracks - Web APIs
the audio
tracks read-only property of the sourcebuffer interface returns a list of the audio
tracks currently contained inside the sourcebuffer. syntax var myaudio
tracks = sourcebuffer.audio
tracks; value an audio
tracklist object. example tbd specifications specification status comment media source extensionsthe definition of 'audio
tracks' in that specification. recommendation initial definition. ...
SourceBuffer.textTracks - Web APIs
the text
tracks read-only property of the sourcebuffer interface returns a list of the text
tracks currently contained inside the sourcebuffer. syntax var mytext
tracks = sourcebuffer.text
tracks; value an text
tracklist object. example tbd specifications specification status comment media source extensionsthe definition of 'text
tracks' in that specification. recommendation initial definition. ...
SourceBuffer.trackDefaults - Web APIs
exceptions the following exceptions may be thrown when setting a new value for this property. exception explanation invalidstateerror one or more of the sourcebuffer objects in mediasource.sourcebuffers are being updated (i.e. their sourcebuffer.updating property is currently true), or this sourcebuffer has been removed from the mediasource. ...
SourceBuffer.videoTracks - Web APIs
the video
tracks read-only property of the sourcebuffer interface returns a list of the video
tracks currently contained inside the sourcebuffer. syntax var myvideo
tracks = sourcebuffer.video
tracks; value an video
tracklist object. example tbd specifications specification status comment media source extensionsthe definition of 'video
tracks' in that specification. recommendation initial definition. ...
TextTrackList: change event - Web APIs
the change event is fired when a text
track is made active or inactive, or a text
tracklist is otherwise changed. bubbles no cancelable no interface event event handler property onchange examples using addeventlistener(): const mediaelement = document.queryselectorall('video, audio')[0]; mediaelement.text
tracks.addeventlistener('change', (event) => { console.log(`'${event.type}' event fired`); }); using the onchange event handler property: const mediaelement = document.queryselector('video, audio'); mediaelement.text
tracks.onchange = (event) => { console.log(`'${event.type}' event fired`); }; specifications specification status html living standardthe definition of 'change' in that specification. liv...
TrackDefault.kinds - Web APIs
the kinds read-only property of the
trackdefault interface returns default kinds for an associated sourcebuffer to use when an initialization segment does not contain label information for a new
track. syntax var mykinds =
trackdefault.kinds; value an array of domstrings. example tbd ...
TrackDefault.label - Web APIs
the label read-only property of the
trackdefault interface returns the default label for an associated sourcebuffer to use when an initialization segment does not contain label information for a new
track. syntax var mylabel =
trackdefault.label; value a domstring. example tbd ...
TrackDefault.language - Web APIs
the language read-only property of the
trackdefault interface returns a default language for an associated sourcebuffer to use when an initialization segment does not contain language information for a new
track. this should be a valid language code, e.g. en-us. syntax var mylanguage =
trackdefault.language; value a domstring. example tbd ...
TrackDefault.type - Web APIs
the type read-only property of the
trackdefault interface returns the type of
track that this sourcebuffer's media segment data relates to (i.e. audio, video, or text
track.) syntax var mytype =
trackdefault.type; value a domstring — one of audio, video or text. example tbd ...
TrackDefaultList.length - Web APIs
the length read-only property of the
trackdefaultlist interface returns the number of
trackdefault objects in the list. syntax var mylistlength =
trackdefaultlist.length; value an unsigned long number. example tbd ...
TrackDefaultList - Web APIs
the
trackdefaultlist interface represents a simple container list for multiple
trackdefault objects. the
trackdefaultlist associated with a particular sourcebuffer can be retrieved using the sourcebuffer.
trackdefaults property. constructor
trackdefaultlist() constructs and returns a new
trackdefaultlist object. properties inherits properties from its parent interface, eventtarget.
trackdefaultlist.length read only returns the number of
trackdefault objects in the list. methods inherits properties from its parent interface, eventtarget.
trackdefaultlist.
trackdefault() this getter allows the
trackdefault objects in the list to be accessed with an array operator (i.e. [].) examples tbd. ...
VideoTrack.id - Web APIs
the id property contains a string which uniquely identifies the
track represented by the video
track. this id can be used with the video
tracklist.get
trackbyid() method to locate a specific
track within the media associated with a media element. the
track id can also be used as the fragment of a url that loads the specific
track (if the media supports media fragments). syntax var
trackid = video
track.id; value a domstring which identifies the
track, suitable for use when calling get
trackbyid() on an video
tracklist such as the one specified by a media element's video
tracks property. specifications specification status comment html living standardthe definition of 'video
track: id' in that specification. living standard ...
VideoTrack.selected - Web APIs
the video
track property selected controls whether or not a particular video
track is active. syntax isvideoselected = video
track.selected; video
track.selected = true | false; value the selected property is a boolean whose value is true if the
track is active. only a single video
track can be active at any given time, so setting this property to true for one
track while another
track is active will make that other
track inactive. specifications specification status comment html living standardthe definition of 'video
track: selected' in that specification. living standard ...
VideoTrack.sourceBuffer - Web APIs
the read-only video
track property sourcebuffer returns the sourcebuffer that created the
track, or null if the
track was not created by a sourcebuffer or the sourcebuffer has been removed from the mediasource.sourcebuffers attribute of its parent media source. syntax var sourcebuffer = video
track.sourcebuffer; value a sourcebuffer or null. specifications specification status comment media source extensionsthe definition of 'video
track: sourcebuffer' in that specification. recommendation ...
VideoTrackList.selectedIndex - Web APIs
the read-only video
tracklist property selectedindex returns the index of the currently selected
track, if any, or -1 otherwise. syntax var index = video
tracklist.selectedindex; value a number indicating the index of the currently selected
track, if any, or -1 otherwise. specifications specification status comment html living standardthe definition of 'video
tracklist: selectedindex' in that specification. living standard ...
::-moz-range-track - CSS: Cascading Style Sheets
the ::-moz-range-
track css pseudo-element is a mozilla extension that represents the
track (i.e., groove) in which the indicator slides in an <input> of type="range". note: using ::-moz-range-
track with anything but an <input type="range"> doesn't match anything and has no effect. syntax ::-moz-range-
track examples html <input type="range" min="0" max="100" step="5" value="50"/> css input[type=range]::-moz-range-
track { background-color: green; } result a progress bar using this style might look something like this: specifications not part of any standard. ...
Feature-Policy: xr-spatial-tracking - HTTP
the http feature-policy header xr-spatial-
tracking directive controls whether the current document is allowed to use the webxr device api. this policy controls whether navigator.xr.requestsession() can return xrsession that requires spatial
tracking and whether user agent can indicate support for sessions supporting spatial
tracking via navigator.xr.issessionsupported() and devicechange event on navigator.xr object. syntax feature-policy: xr-spatial-
tracking <allowlist>; <allowlist> an allowlist is a list of origins that takes one or more of the following values, separated by spaces: *: the feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin. 'self': the feature will be allowed in this document, and in all nested browsing...
Index - Web APIs
ted and is accessible via the mediastreamaudiodestinationnode's stream attribute. this stream can be used in a similar way as a mediastream obtained via navigator.getusermedia — it can, for example, be sent to a remote peer using the rtcpeerconnection addstream() method. ...
...nnection addstream() method. 129 audiocontext.createmediastreamsource() api, audio, audiocontext, audionode, media, mediastream, mediastream
track, method, reference, web, web audio, web audio api, createmediastreamsource for more details about media stream audio source nodes, check out the mediastreamaudiosourcenode reference page. 130 audiocontext.createmediastream
tracksource() api, audio, audiocontext, mediastream
track, mediastream
trackaudiosource, method, node, reference, web audio api, createmediastream
tracksource, sound, source,
track a mediastream
trackaudiosourcenode object which acts as a source for audio data found in the specified audio
track. 131 audiocontext.createwavetable() api, audiocontext, method, obsolete, reference, web ...
... playback at the specified time. if no time is specified, then the sound stops playing immediately. 185 audioscheduledsourcenode: ended event audio, html dom, htmlmediaelement, media, media streams api, reference, video, web audio api, ended, events the ended event of the audioscheduledsourcenode interface is fired when the source node has stopped playing. ...
...And 354 more matches
Capabilities, constraints, and settings - Web APIs
hange information about what constrainable properties the browser's implementation supports and what values it supports for each one. this article discusses capabilities and constraints, as well as media settings, and includes an example we call the constraint exerciser. the constraint exerciser lets you experiment with the results of different constraint sets being applied to the audio and video
tracks coming from the computer's a/v input devices (such as its webcam and microphone). overview the process works like this (using mediastream
track as an example): if needed, call mediadevices.getsupportedconstraints() to get the list of supported constraints, which tells you what constrainable properties the browser knows about. this isn't always necessary, since any that aren't known will simp...
...lways necessary, since any that aren't known will simply be ignored when you specify them—but if you have any that you can't get by without, you can start by checking to be sure they're on the list. ...
...can start by checking to be sure they're on the list. once the script knows whether the property or properties it wishes to use are supported, it can then check the capabilities of the api and its implementation by examining the object returned by the
track's getcapabilities() method; this object lists each supported constraint and the values or range of values which are supported. ...
...And 49 more matches
Using DTMF with WebRTC - Web APIs
try of credit card or other payment information passcode entry note: while the dtmf is not sent to the remote peer as audio, browsers may choose to play the corresponding tone to the local user as part of their user experience, since users are typically used to hearing their phone play the tones audibly. sending dtmf on an rtcpeerconnection a given rtcpeerconnection can have multiple media
tracks sent or received on it. when you wish to transmit dtmf signals, you first need to decide which
track to send them on, since dtmf is sent as a series of out-of-band payloads on the rtcrtpsender responsible for transmitting that
track's data to the other peer. once the
track is selected, you can obtain from its rtcrtpsender the rtcdtmfsender object you'll use for sending dtmf. from there, you can...
... each time a tone is sent, the rtcpeerconnection receives a tonechange event with a tone property specifying which tone finished playing, which is an opportunity to update interface elements, for example. ...
... each time a tone is sent, the rtcpeerconnection receives a tonechange event with a tone property specifying which tone finished playing, which is an opportunity to update interface elements, for example. ...
...And 25 more matches
Audio for Web games - Game development
ridden. buffering and preloading likely as an attempt to mitigate runaway mobile network data use, we also often find that buffering is disabled before playback has been initiated. buffering is the process of the browser downloading the media in advance, which we often need to do to ensure smooth playback. the htmlmediaelement interface comes with lots of properties to help determine whether a
track is in a state to be playable. note: in many ways the concept of buffering is an outdated one. as long as byte-range requests are accepted (which is the default behavior), we should be able to jump to a specific point in the audio without having to download the preceding content. however, preloading is still useful — without it, there would always need to be some client-server communication re...
...web audio api is ideal for implementing a more dynamic musical experience. you may want music to change depending on whether you are trying to build suspense or encourage the player in some way. music is an important part of the gaming experience and depending on the type of game you are making you may wish to invest significant effort into getting it right. one way you can make your music sound
track more dynamic is by splitting it up into component loops or
tracks. this is often the way that musicians compose music anyway, and the web audio api is extremely good at keeping these parts in sync. once you have the various
tracks that make up your piece you can bring
tracks in and out as appropriate. you can also apply filters or effects to music. is your character in a cave? increase the echo.
...s in sync. once you have the various
tracks that make up your piece you can bring
tracks in and out as appropriate. you can also apply filters or effects to music. is your character in a cave? increase the echo. maybe you have underwater scenes, during which you could apply a filter that muffles the sound. let's look at some web audio api techniques for dynamically adjusting music from its base
tracks. loading your
tracks with the web audio api you can load separate
tracks and loops individually using xmlhttprequest or the fetch api, which means you can load them synchronously or in parallel. loading synchronously might mean parts of your music are ready earlier and you can start playing them while others load. either way you may want to synchronize
tracks or loops. the web audio api conta...
...And 23 more matches
Signaling and video calling - Web APIs
list item, that clicking on a user name calls our invite() method, which we'll look at in the next section. finally, we append the new item to the <ul> that contains all of the user names. starting a call when the user clicks on a username they want to call, the invite() function is invoked as the event handler for that click event: var mediaconstraints = { audio: true, // we want an audio
track video: true // ...and we want a video
track }; function invite(evt) { if (mypeerconnection) { alert("you can't start a call because you already have one open!"); } else { var clickedusername = evt.target.textcontent; if (clickedusername === myusername) { alert("i'm afraid i can't let you talk to yourself. that would be weird."); return; } targetusername = ...
...nt; if (clickedusername === myusername) { alert("i'm afraid i can't let you talk to yourself. that would be weird."); return; } targetusername = clickedusername; createpeerconnection(); navigator.mediadevices.getusermedia(mediaconstraints) .then(function(localstream) { document.getelementbyid("local_video").srcobject = localstream; localstream.get
tracks().foreach(
track => mypeerconnection.add
track(
track, localstream)); }) .catch(handlegetusermediaerror); } } this begins with a basic sanity check: is the user already connected? if there's already a rtcpeerconnection, they obviously can't make a call. then the name of the user that was clicked upon is obtained from the event target's textcontent property, and we check to be sure that i...
...ect passed into getusermedia(). in practice, this is rarely if ever necessary, since most of that work is done for you by getusermedia(). we attach the incoming stream to the local preview <video> element by setting the element's srcobject property. since the element is configured to automatically play incoming video, the stream begins playing in our local preview box. we then iterate over the
tracks in the stream, calling add
track() to add each
track to the rtcpeerconnection. even though the connection is not fully established yet, you can begin sending data when you feel it's appropriate to do so. media received before the ice negotiation is completed may be used to help ice decide upon the best connectivity approach to take, thus aiding in the negotiation process. note that for native ap...
...And 22 more matches
Basic Concepts of grid layout - CSS: Cascading Style Sheets
part of the css grid layout level 1 specification. the features shown in this overview will then be explained in greater detail in the rest of this guide. what is a grid? a grid is a set of intersecting horizontal and vertical lines defining columns and rows. elements can be placed onto the grid within these column and row lines. css grid layout has the following features: fixed and flexible
track sizes you can create a grid with fixed
track sizes – using pixels for example. this sets the grid to the specified pixel which fits to the layout you desire. you can also create a grid using flexible sizes with percentages or with the new fr unit designed for this purpose. item placement you can place items into a precise location on the grid using line numbers, names or by targeting an area...
...t you desire. you can also create a grid using flexible sizes with percentages or with the new fr unit designed for this purpose. item placement you can place items into a precise location on the grid using line numbers, names or by targeting an area of the grid. grid also contains an algorithm to control the placement of items not given an explicit position on the grid. creation of additional
tracks to hold content you can define an explicit grid with grid layout. the grid layout specification is flexible enough to add additional rows and columns when needed. features such as adding “as many columns that will fit into a container” are included. alignment control grid contains alignment features so we can control how the items align once placed into a grid area, and how the entire gri...
...you view this example in firefox and inspect the grid, you will see a small icon next to the value grid. click this and then the grid on this element will be overlaid in the browser window. as you learn and then work with the css grid layout this tool will give you a better idea of what is happening with your grids visually. if we want to start making this more grid-like we need to add column
tracks. grid
tracks we define rows and columns on our grid with the grid-template-columns and grid-template-rows properties. these define grid
tracks. a grid
track is the space between any two lines on the grid. in the below image you can see a
track highlighted – this is the first row
track in our grid. i can add to our earlier example by adding the grid-template-columns property, then defining...
...And 22 more matches
RTCPeerConnection - Web APIs
e to execute when the removestream event, of type mediastreamevent, is received by this rtcpeerconnection. ...
..., of type mediastreamevent, is received by this rtcpeerconnection. ...
... event is sent when a mediastream is removed from this connection.onsignalingstatechangethe onsignalingstatechange event handler property of the rtcpeerconnection interface specifies a function to be called when the signalingstatechange event occurs on an rtcpeerconnection interface.on
track the rtcpeerconnection property on
track is an eventhandler which specifies a function to be called when the
track event occurs, indicating that a
track has been added to the rtcpeerconnection.methodsalso inherits methods from: eventtargetaddicecandidate()when a web site or app using rtcpeerconnection receives a new ice candidate from the remote peer over its signaling channel, it delivers the newly-received candidate to the browser's ice agent by calling rtcpeerconnection.addicecandidate().addstream() the...
...And 18 more matches
Grids - Learn web development
ke flexbox, the items will not immediately look any different. declaring display: grid gives you a one column grid, so your items will continue to display one below the other as they do in normal flow. to see something that looks more grid-like, we will need to add some columns to the grid. let's add three 200-pixel columns here. you can use any length unit, or percentages to create these column
tracks. .container { display: grid; grid-template-columns: 200px 200px 200px; } add the 2nd declaration to your css rule, then reload the page, and you should see that the items have rearranged themselves one into each cell of the created grid. simple grid example body { width: 90%; max-width: 900px; margin: 2em auto; font: .9em/1.2 arial, helvetica, sans-serif; } .container > di...
...r</div> <div>five</div> <div>six</div> <div>seven</div> </div> .container { display: grid; grid-template-columns: 200px 200px 200px; } flexible grids with the fr unit in addition to creating grids using lengths and percentages, we can use the fr unit to flexibly size grid rows and columns. this unit represents one fraction of the available space in the grid container. ...
...iv> .container { display: grid; grid-template-columns: 200px 200px 200px; } flexible grids with the fr unit in addition to creating grids using lengths and percentages, we can use the fr unit to flexibly size grid rows and columns. this unit represents one fraction of the available space in the grid container. change your
track listing to the following definition, creating three 1fr
tracks. ...
...And 17 more matches
Adding captions and subtitles to HTML5 video - Developer guides
captioned video example in this article, we will refer to the video player with captions example. this example uses an excerpt from the sintel open movie, created by the blender foundation. ...
...captions versus subtitles captions and subtitles are not the same thing: they have significantly different audiences, and convey different information, and it is recommended that you read up on the differences if you are not sure what they are. they are however implemented in the same way technically, so the material in this article will apply to both. for this article we will refer to the text
tracks displayed as subtitles, as their content is aimed at hearing people who have difficulty understanding the language of the film, rather than deaf or hard-of-hearing people. the <
track> element html5 allows us to specify subtitles for a video using the <
track> element. the various attributes of this element allow us to specify such things as the type of content that we're adding, the language it...
...the webvtt specification is still being worked on, but major parts of it are stable so we can use it today. video providers (such as the blender foundation) provide captions and subtitles in a text format with their videos, but they're usually in the subrip text (srt) format. these can be easily converted to webvtt using an online converter such as srt2vtt. ...
...And 16 more matches
JavaScript Client API - Archive of obsolete content
gy syncengine the main sync client object. it's what starts all the magic. engine governs the synchronizing of a specific set of information. e.g. there is an engine for bookmarks, tabs, history, preferences, etc. record piece of information that gets synchronized. records are transformed to wbo's, uploaded to a collection in a sync server and eventually downloaded by other sync clients.
tracker entity that
tracks changes to data. each engine has a corresponding
tracker which listens for changes to data or events it is interested in. when something of interest occurs, it interacts with the engine to let it know something has happened and it might want to take action store entity that serves as a data store/proxy for information in an engine. the name store is somewhat of a misnomer,...
... refactoring in future releases. before developing against the javascript api, it is recommended to speak to developers of the api. see https://wiki.mozilla.org/services/sync for their contact information. to create a custom sync engine to synchronize a new data you, you'll need to define an engine object that extends the base syncengine object. this involves writing types that extend the store,
tracker, and record types as well. it will be very helpful to look at an existing sync engine for guidance. have a look at one of the following files: services/sync/modules/engines/bookmarks.js services/sync/modules/engines/history.js setting up a js module the code for your custom sync engine should live in a js module. first off we're going to import the files mentioned above at the top the f...
...ch extends store, as defined in services/sync/modules/engines.js) has the job of creating and maintaining a set of record objects from the underlying data. the store must also make updates to the underlying data itself based on incoming record objects. the majority of the code you write for syncing a new data type will most likely be in the store implementation. each record that the store keeps
track of must be identified by a unique id (unique among all records in the store) called guid. depending of what type of data you're working with, you might already have guids built into your data that you can make use of (note that guids must be allowed to change and should be url friendly). if not, you may have to invent your own mapping from data objects to guids as long as it's consistent. in th...
...And 14 more matches
Video and audio content - Learn web development
an older version of safari. the video won't play, because different browsers support different video (and audio) formats. fortunately, there are things you can do to help prevent this from being a problem. contents of a media file first, let's go through the terminology quickly. formats like mp3, mp4 and webm are called container formats. they define a structure in which the audio and/or video
tracks that make up the media are stored, along with metadata describing the media, what codecs are used to encode its channels, and so forth. a webm file containing a movie which has a main video
track and one alternate angle
track, plus audio for both english and spanish, in addition to audio for an english commentary
track can be conceptualized as shown in the diagram below. also included are text ...
...s that make up the media are stored, along with metadata describing the media, what codecs are used to encode its channels, and so forth. a webm file containing a movie which has a main video
track and one alternate angle
track, plus audio for both english and spanish, in addition to audio for an english commentary
track can be conceptualized as shown in the diagram below. also included are text
tracks containing closed captions for the feature film, spanish subtitles for the film, and english captions for the commentary. ...
...ontaining a movie which has a main video
track and one alternate angle
track, plus audio for both english and spanish, in addition to audio for an english commentary
track can be conceptualized as shown in the diagram below. also included are text
tracks containing closed captions for the feature film, spanish subtitles for the film, and english captions for the commentary. the audio and video
tracks within the container hold data in the appropriate format for the codec used to encode that media. different formats are used for audio
tracks versus video
tracks. each audio
track is encoded using an audio codec, while video
tracks are encoded using (as you probably have guessed) a video codec. as we talked about before, different browsers support different video and audio formats, and different...
...And 11 more matches
grid-template-rows - CSS: Cascading Style Sheets
the grid-template-rows css property defines the line names and
track sizing functions of the grid rows. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
... the grid-template-rows css property defines the line names and
track sizing functions of the grid rows. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...ples and send us a pull request. ...
...And 11 more matches
<audio>: The Embed Audio element - HTML: Hypertext Markup Language
/audio> tags is shown as a fallback in browsers that don't support the element. attributes this element's attributes include the global attributes. autoplay a boolean attribute: if specified, the audio will automatically begin playback as soon as it can do so, without waiting for the entire audio file to finish downloading. note: sites that automatically play audio (or videos with an audio
track) can be an unpleasant experience for users, so should be avoided when possible. if you must offer autoplay functionality, you should make it opt-in (requiring a user to specifically enable it). however, this can be useful when creating media elements whose source will be set at a later time, under user control. see our autoplay guide for additional information about how to properly use autoplay. ...
...s, you'll need to create custom controls; these can be marked up and styled in whatever way you want, and then javascript can be used along with the htmlmediaelement api to wire up their functionality. video player styling basics provides some useful styling techniques — it is written in the context of <video>, but much of it is equally applicable to <audio>. ...
...tom controls; these can be marked up and styled in whatever way you want, and then javascript can be used along with the htmlmediaelement api to wire up their functionality. video player styling basics provides some useful styling techniques — it is written in the context of <video>, but much of it is equally applicable to <audio>. ...
...And 11 more matches
Index - Archive of obsolete content
ing a particular line of code ("cvsblame"). 378 bookmark keywords user_documentation practically every web surfer has bookmarks, of course, and power surfers usually have hundreds stuffed into folders within folders. in addition to being handy pointers to useful resources, bookmarks in mozilla can be used to make the address bar itself a power tool. searches, lookups, package
tracking, and even word definitions can all be retrieved from user-customized bookmarks. 379 build this page was auto-generated because a user created a sub-page to this page. 380 building transformiix standalone needshelp, needsrewrite, xslt no summary! 381 chromeless update [this project may not be active — check github https://github.
...ntext menu for opening multiple links in a document or selection). this tutorial walks you through the process of building a mozilla extension that adds an icon to mozilla's status bar showing the current status of the mozilla source code (i.e. whether or not the latest version of the code is compiling successfully and passing tests). the extension will access tinderbox, mozilla.org's webtool for
tracking source code status, to get the status of the code. 386 adding the structure add-ons, extensions the ui for our extension is an icon in the status bar. to implement this ui, we'll add a statusbarpanel element to the statusbar element in the navigator.xul file. 387 conclusion add-ons, extensions you now have a working mozilla extension installer! to test...
...at we have defined a panel in which to display an icon, we use css to specify which icon to display. for this we have to first create four icons, one for each tinderbox state (none, success, test failed, and busted), then create a set of css rules that displays the icon corresponding to the current tinderbox state: 398 tinderbox add-ons, extensions tinderbox is a web tool for
tracking the status of the mozilla source code. it consists of a set of client machines that continuously build and test mozilla and report their results back to a server that makes those results available via a web page. the tool enables mozilla.org to be immediately notified of changes to the code that prevent mozilla from compiling and running (or compromise performance and footprint) so they can ge...
...And 10 more matches
<video>: The Video Embed element - HTML: Hypertext Markup Language
o></video> tags is shown as a fallback in browsers that don't support the element. attributes like all other html elements, this element supports the global attributes. autoplay a boolean attribute; if specified, the video automatically begins to play back as soon as it can do so without stopping to finish loading the data. note: sites that automatically play audio (or videos with an audio
track) can be an unpleasant experience for users, so should be avoided when possible. if you must offer autoplay functionality, you should make it opt-in (requiring a user to specifically enable it). however, this can be useful when creating media elements whose source will be set at a later time, under user control. see our autoplay guide for additional information about how to properly use autoplay. ...
...e progress of both download and playback of the media, as well as the playback state and position. you can use the object-position property to adjust the positioning of the video within the element's frame, and the object-fit property to control how the video's size is adjusted to fit within the frame. to show subtitles/captions along with your video, you can use some javascript along with the <
track> element and the webvtt format. see adding captions and subtitles to html5 video for more information. you can play audio files using a <video> element. this can be useful if, for example, you need to perform audio with a webvtt transcript, since the <audio> element doesn't allow captions using webvtt. to test the fallback content on browsers that support the element, you can replace <video> wi...
...by default, but its default width and height in the viewport is defined by the video being embedded. there are no special considerations for styling <video>; a common strategy is to give it a display value of block to make it easier to position, size, etc., and then provide styling and layout information as required. video player styling basics provides some useful styling techniques. ...
...And 10 more matches
Ember interactivity: Events, classes and state - Learn web development
previous overview: client-side javascript frameworks next at this point we'll start adding some interactivity to our app, providing the ability to add and display new todo items. along the way, we'll look at using events in ember, creating component classes to contain javascript code to control interactive features, and setting up a service to keep
track of the data state of our app. prerequisites: at minimum, it is recommended that you are familiar with the core html, css, and javascript languages, and have knowledge of the terminal/command line. a deeper understanding of modern javascript features (such as classes, modules, etc), will be extremely beneficial, as ember makes heavy use of them. objective: to learn how to create component ...
...nded that you are familiar with the core html, css, and javascript languages, and have knowledge of the terminal/command line. a deeper understanding of modern javascript features (such as classes, modules, etc), will be extremely beneficial, as ember makes heavy use of them. objective: to learn how to create component classes and use events to control interactivity, and keep
track of app state using a service. adding interactivity now we've got a refactored componentized version of our todo app, lets walk through how we can add the interactivity we need to make the app functional. when beginning to think about interactivity, it's good to declare what each component's goals and responsibilities are. in the below sections we’ll do this for each component, and then...
...@action decorator declares that the function is an "action", meaning it's a type of function that will be invoked from an event that occurred in the template. @action also binds the this of the function to the class instance. note: a decorator is basically a wrapper function, which wraps and calls other functions or properties, providing additional functionality along the way. for example, the @
tracked decorator (see slightly later on) runs code it is applied to, but additionally
tracks it and automatically updates the app when values change. read javascript decorators: what they are and when to use them for more general information on decorators. coming back to our browser tab with the app running, we can type whatever we want, and when we hit enter we'll be greeted with an alert message t...
...And 9 more matches
grid-auto-columns - CSS: Cascading Style Sheets
this can happen either by explicitly positioning into a column that is out of range, or by the auto-placement algorithm creating additional columns. ...
...this can happen either by explicitly positioning into a column that is out of range, or by the auto-placement algorithm creating additional columns. ...
... grid-auto-columns: 33.3%; /* <flex> values */ grid-auto-columns: 0.5fr; grid-auto-columns: 3fr; /* minmax() values */ grid-auto-columns: minmax(100px, auto); grid-auto-columns: minmax(max-content, 2fr); grid-auto-columns: minmax(20%, 80vmax); /* fit-content() values */ grid-auto-columns: fit-content(400px); grid-auto-columns: fit-content(5cm); grid-auto-columns: fit-content(20%); /* multiple
track-size values */ grid-auto-columns: min-content max-content auto; grid-auto-columns: 100px 150px 390px; grid-auto-columns: 10% 33.3%; grid-auto-columns: 0.5fr 3fr 1fr; grid-auto-columns: minmax(100px, auto) minmax(max-content, 2fr) minmax(20%, 80vmax); grid-auto-columns: 100px minmax(100px, auto) 10% 0.5fr fit-content(400px); /* global values */ grid-auto-columns: inherit; grid-auto-columns: initi...
...And 9 more matches
grid-template-columns - CSS: Cascading Style Sheets
the grid-template-columns css property defines the line names and
track sizing functions of the grid columns. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...the grid-template-columns css property defines the line names and
track sizing functions of the grid columns. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...request. ...
...And 9 more matches
RTCPeerConnection.addStream() - Web APIs
if the signalingstate is set to closed, an invalidstateerror is raised. if the signalingstate is set to stable, the event negotiationneeded is sent on the rtcpeerconnection to indicate that ice negotiation must be repeated to consider the new stream. ...
...meters mediastream a mediastream object indicating the stream to add to the webrtc peer connection. return value none. example this simple example adds the audio and video stream coming from the user's camera to the connection. ...
...rtc peer connection. return value none. example this simple example adds the audio and video stream coming from the user's camera to the connection. navigator.mediadevices.getusermedia({video:true, audio:true}, function(stream) { var pc = new rtcpeerconnection(); pc.addstream(stream); }); migrating to add
track() compatibility allowing, you should update your code to instead use the add
track() method: navigator.getusermedia({video:true, audio:true}, function(stream) { var pc = new rtcpeerconnection(); stream.get
tracks().foreach(function(
track) { pc.add
track(
track, stream); }); }); the newer add
track() api avoids confusion over whether later changes to the
track-makeup of a stream affects a peer connection (they do not). the exception is in chrome, where addstream() does ...
...And 8 more matches
Inputs and input sources - Web APIs
nput sources are available and how to then monitor those sources for inputs in order to handle user interactivity with your virtual or augmented environment. inputs in webxr fundamentally, inputs in webxr fall into two basic categories: targeting and actions. targeting is the specification of a point in space by the user's input. this may involve the user simply tapping on a spot on the screen,
tracking their eyes, or the use of a joystick or motion-sensing controller to move a cursor. actions include both selection actions, such as clicking on a button, and squeeze actions, such as pulling a trigger or tightening your grip while wearing haptic gloves. by combining these two types of input with the changing of viewing position and/or orientation through the headset or other mechanisms, you ...
...put device types webxr supports a variety of different types of devices to handle targeting and action inputs. these devices include but aren't limited to: screen taps (particularly but not necessarily only on phones or tablets) can be used to simultaneously perform both targeting and selection. ...
...lers, which use accelerometers, magnetometers, and other sensors for motion
tracking and targeting and may additionally include any number of buttons, joysticks, thumbpads, touchpads, force sensors, and so on to provide additional input sources for both targeting and selection. squeezable triggers or glove grip pads to provide squeeze actions. voice commands using speech recognition. spatially-
tracked articulated hands, such as haptic gloves can provide both targeting and squeeze actions, as well as selection if outfitted with buttons or other sources of selection actions. single-button click devices. gaze
tracking (following the movements of the eye to choose targets). input sources each source of webxr input data is represented by an xrinputsource object which describes the input sour...
...And 8 more matches
Realizing common layouts using CSS Grid Layout - CSS: Cascading Style Sheets
ea: footer; } this will not create any layout, however our items now have names we can use to do so. staying outside of any media queries i am now going to set up the layout for the mobile width. here i am keeping everything in source order, trying to avoid any disconnect between the source and display as described in the guide grid layout and accessibility. i have not defined any column or row
tracks but this layout dictates a single column, and rows will be created as needed for each of the items in the implicit grid. .wrapper { display: grid; grid-gap: 20px; grid-template-areas: "header" "nav" "content" "sidebar" "ad" "footer"; } after setting up a mobile layout we will get this single column at all screen sizes, we can now add a media query and redefine ou...
... to show two columns. @media (min-width: 500px) { .wrapper { grid-template-columns: 1fr 3fr; grid-template-areas: "header header" "nav nav" "sidebar content" "ad footer"; } nav ul { display: flex; justify-content: space-between; } } you can see the layout taking shape in the value of grid-template-areas. the header spans over two column
tracks, as does the nav. in the third row
track we have the sidebar alongside the content. in the fourth row
track i have chosen to place my ad content – so it appears under the sidebar, then the footer next to it under the content. i’m using a flexbox on the navigation to display it in a row spaced out. i can now add a final breakpoint to move to a three-column layout. @media (min-width: 700px) ...
... to a three-column layout. @media (min-width: 700px) { .wrapper { grid-template-columns: 1fr 4fr 1fr; grid-template-areas: "header header header" "nav content sidebar" "nav content ad" "footer footer footer" } nav ul { flex-direction: column; } } the three-column layout has two 1fr unit side columns and a middle column that has 4fr as the
track size. this means that the available space in the container is split into 6 and assigned in proportion to our three
tracks – one part each to the side columns and 4 parts to the center. in this layout i am displaying the nav in the left column, alongside the content. in the right column we have the sidebar and underneath it the advertisements (ad). the footer now spans right across the bottom o...
...And 8 more matches
grid-auto-rows - CSS: Cascading Style Sheets
this can happen either by explicitly positioning into a row that is out of range, or by the auto-placement algorithm creating additional rows. ...
...this can happen either by explicitly positioning into a row that is out of range, or by the auto-placement algorithm creating additional rows. ...
...id-auto-rows: auto; /* <length> values */ grid-auto-rows: 100px; grid-auto-rows: 20cm; grid-auto-rows: 50vmax; /* <percentage> values */ grid-auto-rows: 10%; grid-auto-rows: 33.3%; /* <flex> values */ grid-auto-rows: 0.5fr; grid-auto-rows: 3fr; /* minmax() values */ grid-auto-rows: minmax(100px, auto); grid-auto-rows: minmax(max-content, 2fr); grid-auto-rows: minmax(20%, 80vmax); /* multiple
track-size values */ grid-auto-rows: min-content max-content auto; grid-auto-rows: 100px 150px 390px; grid-auto-rows: 10% 33.3%; grid-auto-rows: 0.5fr 3fr 1fr; grid-auto-rows: minmax(100px, auto) minmax(max-content, 2fr) minmax(20%, 80vmax); grid-auto-rows: 100px minmax(100px, auto) 10% 0.5fr fit-content(400px); /* global values */ grid-auto-rows: inherit; grid-auto-rows: initial; grid-auto-rows: unse...
...And 8 more matches
MediaStream - Web APIs
the mediastream interface represents a stream of media content. a stream consists of several
tracks such as video or audio
tracks. each
track is specified as an instance of mediastream
track.you can obtain a mediastream object either by using the constructor or by calling mediadevices.getusermedia(). some user agents subclass this interface to provide more precise information or functionality, like in canvascapturemediastream. constructor mediastream() creates and returns a new mediastream object. you can create an empty stream, a stream which is based upon an existing stream, or a stream that contains a specified list of
tracks (specified as an array of mediastream
track objects). properties this interface inherits properties from its parent, eventtarget. mediastream.active read onl...
...s). properties this interface inherits properties from its parent, eventtarget. mediastream.active read only a boolean value that returns true if the mediastream is active, or false otherwise. mediastream.ended read only a boolean value set to true if the end of the stream has been reached. ...
...rom its parent, eventtarget. mediastream.active read only a boolean value that returns true if the mediastream is active, or false otherwise. mediastream.ended read only a boolean value set to true if the end of the stream has been reached. this has been removed from the specification; you should instead check the value of mediastream
track.readystate to see if its value is ended for the
track or
tracks you want to ensure have finished playing. ...
...And 7 more matches
MediaStreamConstraints.video - Web APIs
the mediastreamconstraints dictionary's video property is used to indicate what kind of video
track, if any, should be included in the mediastream returned by a call to getusermedia(). to learn more about how constraints work, see capabilities, constraints, and settings. ...
... the mediastreamconstraints dictionary's video property is used to indicate what kind of video
track, if any, should be included in the mediastream returned by a call to getusermedia(). to learn more about how constraints work, see capabilities, constraints, and settings. ...
...be included in the mediastream returned by a call to getusermedia(). to learn more about how constraints work, see capabilities, constraints, and settings. ...
...And 7 more matches
NavigationPreloadManager - Web APIs
opera full support 49safari ? webview android full support 62chrome android full support 62firefox android no support nonotes ...
...full support 49safari ? webview android full support 62chrome android full support 62firefox android no support nonotes no support nonotes notes implementation
tracked in bug 1290958opera android full support 46safari ios ? samsung internet android full support 8.0disable experimentalchrome full support 62edge full support 18firefox no s...
... opera full support 49safari ? webview android full support 62chrome android full support 62firefox android no support nonotes ...
...And 7 more matches
Geometry and reference spaces in WebXR - Web APIs
cenes in true 3d using xr headsets and other such equipment, webxr has additional concepts that must be understood. in this article, we introduce the ways in which webxr expands upon the geometry of webgl, and how the positions and orientations of objects—both physical and virtual—are described in relation to one another using spaces and, in particular, reference spaces. the article spatial
tracking in webxr builds upon the information provided here to cover how the physical position and orientation of the user's head, as well as potentially other parts of their body such as the hands, are mapped into the digital world, as well as how the relative positions of both physical and virtual objects are
tracked as they move around, so that the scene can be properly rendered and composited. fun...
...long one the three axes. the position of any given point in the world is described by indicating how far along each of three axes the point is located from the center of the space, which is the position at which those the three axes meet. this is the native origin of the space, corresponding to a specific physical location in the user's environment. each space has its own native origin, which is
tracked by the xr device's
tracking system. this may be different from the effective origin, which is the origin point for the space's local coordinate system. the directionality of the coordinate system can be seen in the following diagram: an xrrigidtransform called the origin offset is used to transform points from the space's own effective coordinate system to the xr device's native coordinate ...
...nto the screen, with the farthest away point in the world having a z of -1.0. every object is, at the simplest level, a set of polygons defined by points in 3d space and an offset transform, indicating how to move and rotate the object to position it at the desired point in space. if the offset transform is an identity matrix, the object is located at the origin point. to be useful for spatial
tracking and scene geometry, though, you need to be able to correlate the xr device's perceived position with the space's coordinate system. that's where reference spaces come in. reference spaces because of the variety of xr hardware available, coming in a wide variety of form factors from many developers, it's impractical and non-scalable to expect developers to have to directly communicate with th...
...And 7 more matches
Using the Web Audio API - Web APIs
let's take a look at getting started with the web audio api. we'll briefly look at some concepts, then study a simple boombox example that allows us to load an audio
track, play and pause it, and change its volume and stereo panning. the web audio api does not replace the <audio> media element, but rather complements it, just like <canvas> coexists alongside the <img> element. your use case will determine what tools you use to implement audio. if you simply want to control playback of an audio
track, the <audio> media element provides a better, quicker solution than the web audio api. if you want to carry out more complex audio processing, as well as playback, the web audio api provides much more power and control. a powerful feature of the web audio api is that it does not have a strict "so...
...d. note: if you just want to process audio data, for instance, buffer and stream it but not play it, you might want to look into creating an offlineaudiocontext. loading sound now, the audio context we've created needs some sound to play through it. there are a few ways to do this with the api. let's begin with a simple method — as we have a boombox, we most likely want to play a full song
track. also, for accessibility, it's nice to expose that
track in the dom. we'll expose the song on the page using an <audio> element. <audio src="mycool
track.mp3"></audio> note: if the sound file you're loading is held on a different domain you will need to use the crossorigin attribute; see cross origin resource sharing (cors) for more information. to use all the nice things we get with the web...
...) for more information. to use all the nice things we get with the web audio api, we need to grab the source from this element and pipe it into the context we have created. lucky for us there's a method that allows us to do just that — audiocontext.createmediaelementsource: // get the audio element const audioelement = document.queryselector('audio'); // pass it into the audio context const
track = audiocontext.createmediaelementsource(audioelement); note: the <audio> element above is represented in the dom by an object of type htmlmediaelement, which comes with its own set of functionality. all of this has stayed intact; we are merely allowing the sound to be available to the web audio api. controlling sound when playing sound on the web, it's important to allow the user to control...
...And 7 more matches
Implementing a Microsoft Active Accessibility (MSAA) Server - Accessibility
n, read gecko info for windows accessibility vendors to learn how msaa clients can utilize gecko's msaa support. intro: what is msaa? msaa is the microsoft active accessibility (msaa) api, used on windows operating systems to support assistive technologies for users with disabilities. third party assistive technology, such as screen readers, screen magnifiers and voice input software, want to
track what's happening inside mozilla. they need to know about focus changes and other events, and it needs to know what objects are contained in the current document or dialog box. using this information, a screen reader will speak out loud important changes to the document or ui, and allow the user to
track where they navigate. the screen reader user can navigate the web page using screen reader comm...
...tants page. check with your assistive technology partners to find out what states you need to support. ...
...nting. this can lead to crashes where it releases something and the wrong time, when some of your dll's are unloaded but not others, and a destructor is called in an unloaded dll. solution: create a "shutdown" method for each internal accessible object, to remove any references to other internal objects before any of your dll's are unloaded. in order to do this effectively, you will have to keep
track of every accessible object that you create. the shutdown method for an accessibility object should be called whenever the document or ui object it refers to goes away. the easiest way to do that is to keep a pointer to an accessible in each internal ui object. if that pointer is non-null, then there is an accessible object for it. whenever the ui object is destroyed, shutdown it's accessible obje...
...And 7 more matches
Box alignment in CSS Grid Layout - CSS: Cascading Style Sheets
he inline axis. the block axis is the axis upon which blocks are laid out in block layout. if you have two paragraphs on your page they display one below the other, so it is this direction we describe as the block axis. the inline axis runs across the block axis, it is the direction in which text in regular inline flow runs. we are able to align the content inside grid areas, and the grid
tracks themselves on these two axes. aligning items on the block axis the align-self and align-items properties control alignment on the block axis. when we use these properties, we are changing the alignment of the item within the grid area you have placed it. in the following example, i have four grid areas within my grid. i can use the align-items property on the grid container, to align the item...
... background-color: #ffd8a8; padding: 1em; color: #d9480f; } .wrapper { display: grid; grid-template-columns: repeat(4, 1fr); grid-gap: 10px; grid-auto-rows: 200px; grid-template-areas: ". a a ." ". a a ."; } .item1 { grid-area: a; align-self: center; justify-self: center; } <div class="wrapper"> <div class="item1">item 1</div> </div> aligning the grid
tracks on the block axis if you have a situation where your grid
tracks use an area that is smaller than the grid container, then you can align the grid
tracks themselves, inside that container. once again, this operates on the block and inline axes, with align-content aligning
tracks on the block axis, and justify-content performing alignment on the inline axis. the place-content property is shorthan...
... on the inline axis. the place-content property is shorthand for align-content and justify-content. the values for align-content, justify-content and place-content are: normal start end center stretch space-around space-between space-evenly baseline first baseline last baseline in the below example i have a grid container of 500 pixels by 500 pixels. ...
...And 7 more matches
Subgrid - CSS: Cascading Style Sheets
introduction to subgrid when you add display: grid to a grid container, only the direct children become grid items and can then be placed on the grid that you have created. the children of these items display in normal flow. you can "nest" grids by making a grid item a grid container. ...
...mal flow. you can "nest" grids by making a grid item a grid container. these grids however are independent of the parent grid and of each other, meaning that they do not take their
track sizing from the parent grid. this makes it difficult to line nested grid items up with the main grid. if you set the value subgrid on grid-template-columns, grid-template-rows or both, instead of creating a new
track listing the nested grid uses the
tracks defined on the parent. for example, if you use grid-template-columns: subgrid and the nested grid spans three column
tracks of the parent, the nested grid will have three column
tracks of the same size as the parent grid. gaps are inherited but can also be overridden with a different gap value. line names can be passed from the parent into the subgrid, and...
...i can then place .subitem on this grid. ...
...And 7 more matches
grid-template - CSS: Cascading Style Sheets
o none, meaning there is no explicit grid. there are no named grid areas. rows and columns will be implicitly generated; their size will be determined by the grid-auto-rows and grid-auto-columns properties. <'grid-template-rows'> / <'grid-template-columns'> sets grid-template-rows and grid-template-columns to the specified values, and sets grid-template-areas to none. [ <line-names>? <string> <
track-size>? <line-names>? ]+ [ / <explicit-
track-list> ]? sets grid-template-areas to the strings listed, grid-template-rows to the
track sizes following each string (filling in auto for any missing sizes), and splicing in the named lines defined before/after each size, and grid-template-columns to the
track listing specified after the slash (or none, if not specified). note: the repeat() functio...
... note: the grid shorthand accepts the same syntax, but also resets the implicit grid properties to their initial values. use grid (as opposed to grid-template) to prevent these values from cascading in seperately. ...
... note: the grid shorthand accepts the same syntax, but also resets the implicit grid properties to their initial values. use grid (as opposed to grid-template) to prevent these values from cascading in seperately. ...
...And 7 more matches
MediaStreamAudioSourceNode - Web APIs
the mediastreamaudiosourcenode interface is a type of audionode which operates as an audio source whose media is received from a mediastream obtained using the webrtc or media capture and streams apis. this media could be from a microphone (through getusermedia()) or from a remote peer on a webrtc call (using the rtcpeerconnection's audio
tracks). a mediastreamaudiosourcenode has no inputs and exactly one output, and is created using the audiocontext.createmediastreamsource() method. the mediastreamaudiosourcenode takes the audio from the first mediastream
track whose kind attribute's value is audio. see
track ordering for more information about the order of
tracks. the number of channels output by the node matches the number of
tracks found in the selected audio
track. number of...
... constructor new mediastreamaudiosourcenode() creates a new mediastreamaudiosourcenode object instance with the specified options. ...
.... properties in addition to the following properties, mediastreamaudiosourcenode inherits the properties of its parent, audionode. mediastream read only the mediastream used when constructing this mediastreamaudiosourcenode. methods inherits methods from its parent, audionode. ...
...And 6 more matches
MediaStreamConstraints.audio - Web APIs
the mediastreamconstraints dictionary's audio property is used to indicate what kind of audio
track, if any, should be included in the mediastream returned by a call to getusermedia(). to learn more about how constraints work, see capabilities, constraints, and settings. ...
... the mediastreamconstraints dictionary's audio property is used to indicate what kind of audio
track, if any, should be included in the mediastream returned by a call to getusermedia(). to learn more about how constraints work, see capabilities, constraints, and settings. ...
...e included in the mediastream returned by a call to getusermedia(). to learn more about how constraints work, see capabilities, constraints, and settings. ...
...And 6 more matches
RTCRtpStreamStats - Web APIs
ts dictionary is based on rtcstats, and inherits its properties. in addition, some or all of the following properties are available. standard fields included for all media types codecid a domstring which uniquely identifies the object which was inspected to produce the rtccodecstats object associated with this rtp stream. ...
...d inherits its properties. in addition, some or all of the following properties are available. standard fields included for all media types codecid a domstring which uniquely identifies the object which was inspected to produce the rtccodecstats object associated with this rtp stream. kind a domstring whose value is "audio" if the associated mediastream
track is audio-only or "video" if the
track contains video. ...
...uded for all media types codecid a domstring which uniquely identifies the object which was inspected to produce the rtccodecstats object associated with this rtp stream. kind a domstring whose value is "audio" if the associated mediastream
track is audio-only or "video" if the
track contains video. this value will match that of the media type indicated by rtccodecstats.codec, as well as the
track's kind property. previously called mediatype. ...
...And 6 more matches
Introduction to the Real-time Transport Protocol (RTP) - Web APIs
es within the webrtc infrastructure. for example, rtcp handles qos monitoring. rtcpeerconnection and rtp each rtcpeerconnection has methods which provide access to the list of rtp transports that service the peer connection. these correspond to the following three types of transport supported by rtcpeerconnection: rtcrtpsender rtcrtpsenders handle the encoding and transmission of mediastream
track data to a remote peer. the senders for a given connection can be obtained by calling rtcpeerconnection.getsenders(). rtcrtpreceiver rtcrtpreceivers provide the ability to inspect and obtain information about incoming mediastream
track data. a connection's receivers can be obtained by calling rtcpeerconnection.getreceivers(). rtcrtptransceiver an rtcrtptransceiver is a pair of one rtp sender an...
...d" mode on and off as the local peer and the user being placed on hold as the remote peer. activating hold mode local peer when the local user decides to enable hold mode, the enablehold() method below is called. it accepts as input a mediastream containing the audio to play while the call is on hold. async function enablehold(audiostream) { try { await audiotransceiver.sender.replace
track(audiostream.getaudio
tracks()[0]); audiotransceiver.receiver.
track.enabled = false; audiotransceiver.direction = "sendonly"; } catch(err) { /* handle the error */ } } the three lines of code within the try block perform the following steps: replace their outgoing audio
track with a mediastream
track containing hold music. disable the incoming audio
track. switch the audio tran...
...se htmlaudioelement.capturestream() to get its audio stream. remote peer on the remote peer, when we receive an sdp offer with the directionality set to "sendonly", we handle it using the holdrequested() method, which accepts as input an sdp offer string. async function holdrequested(offer) { try { await peerconnection.setremotedescription(offer); await audiotransceiver.sender.replace
track(null); audiotransceiver.direction = "recvonly"; await sendanswer(); } catch(err) { /* handle the error */ } } the steps taken here are: set the remote description to the specified offer by calling rtcpeerconnection.setremotedescription(). replace the audio transceiver's rtcrtpsender's
track with null, meaning no
track. this stops sending audio on the transceiver. set the au...
...And 6 more matches
XRReferenceSpace - Web APIs
all reference spaces—with the sole exception being bounded reference spaces—are described using the xrreferencespace type. bounded spaces are implemented as xrboundedreferencespace objects. ...
... all reference spaces—with the sole exception being bounded reference spaces—are described using the xrreferencespace type. bounded spaces are implemented as xrboundedreferencespace objects. ...
... all reference spaces—with the sole exception being bounded reference spaces—are described using the xrreferencespace type. bounded spaces are implemented as xrboundedreferencespace objects. these are special spaces which let you establish a perimeter within which it's "safe" for the viewer to move. ...
...And 6 more matches
Layout using named grid lines - CSS: Cascading Style Sheets
once you work through some examples it should become clearer and easier to work with. naming lines when defining a grid you can assign some or all of the lines in your grid a name when you define your grid with the grid-template-rows and grid-template-columns properties. ...
...once you work through some examples it should become clearer and easier to work with. naming lines when defining a grid you can assign some or all of the lines in your grid a name when you define your grid with the grid-template-rows and grid-template-columns properties. ...
...ed lines it is worth taking a little bit of time to plan your naming strategy when starting out creating your grid layout. by selecting names that will make sense to you and your team you will help everyone to use the layouts you create more easily. ...
...And 6 more matches
Line-based placement with CSS Grid - CSS: Cascading Style Sheets
ed according to the writing mode of the document. in a left to right language such as english line 1 is on the left-hand side of the grid. if you are working in a right-to-left language then line 1 will be the far right of the grid. we will learn more about the interaction between writing modes and grids in a later guide. a basic example as a very simple example we can take a grid with 3 column
tracks and 3 row
tracks. this gives us 4 lines in each dimension. inside our grid container i have four child elements. if we do not place these on to the grid in any way they will lay out according to the auto-placement rules, one item in each of the first four cells. if you use the firefox grid highlighter you can see how the grid has defined columns and rows. * {box-sizing: border-box;} .wrapp...
...-template-rows: repeat(3, 100px); } <div class="wrapper"> <div class="box1">one</div> <div class="box2">two</div> <div class="box3">three</div> <div class="box4">four</div> </div> positioning items by line number we can use line-based placement to control where these items sit on the grid. i would like the first item to start on the far left of the grid and span a single column
track. it should also start on the first row line, at the top of the grid and span to the fourth row line. .box1 { grid-column-start: 1; grid-column-end: 2; grid-row-start: 1; grid-row-end: 4; } as you position some items, other items on the grid will continue to be laid out using the auto-placement rules. we will take a proper look at how these work in a later guide but you can see as ...
...d-row-start: 1; grid-row-end: 4; } as you position some items, other items on the grid will continue to be laid out using the auto-placement rules. we will take a proper look at how these work in a later guide but you can see as you work that grid is laying out un-placed items into empty cells of the grid. addressing each item individually we can place all four items spanning row and column
tracks. note that we can leave cells empty if we wish. one of the very nice things about grid layout is this ability to have white space in our designs without having to push things around using margins to prevent floats from rising up into the space we have left. * {box-sizing: border-box;} .wrapper { border: 2px solid #f76707; border-radius: 5px; background-color: #fff4e6; display:...
...And 6 more matches
Relationship of grid layout to other layout methods - CSS: Cascading Style Sheets
comes a new flex container. space distribution happens across the row. a common question then is how to make those items line up. this is where you want a two-dimensional layout method: you want to control the alignment by row and column, and this is where grid comes in. the same layout with css grids in this next example, i create the same layout using grid. this time we have three 1fr column
tracks. we do not need to set anything on the items themselves; they will lay themselves out one into each cell of the created grid. as you can see they stay in a strict grid, lining up in rows and columns. with five items, we get a gap on the end of row two. * {box-sizing: border-box;} .wrapper { border: 2px solid #f76707; border-radius: 5px; background-color: #fff4e6; } .wrapper > div { ...
...space each item takes up. if the items wrap onto a new line, they will work out their spacing based on their size and the available space on that line. grid works from the layout in. when you use css grid layout you create a layout and then you place items into it, or you allow the auto-placement rules to place the items into the grid cells according to that strict grid. it is possible to create
tracks that respond to the size of the content, however, they will also change the entire
track. if you are using flexbox and find yourself disabling some of the flexibility, you probably need to use css grid layout. an example would be if you are setting a percentage width on a flex item to make it line up with other items in a row above. in that case, a grid is likely to be a better choice. box ali...
...the fr unit, when combined with the minmax() function can give us very similar behavior to the flex properties in flexbox while still enabling the creation of a layout in two dimensions. if we look back at the example where i demonstrated the difference between one and two-dimensional layouts, you can see there is a difference between the way of the two layouts work responsively. with the flex...
...And 6 more matches
Media container formats (file types) - Web media technologies
th audio and video in it, of course): the audio and/or video codecs used and the media container format (or file type) used. in this guide, we'll look at the container formats used most commonly on the web, covering basics about their specifications as well as their benefits, limitations, and ideal use cases. webrtc does not use a container at all. instead, it streams the encoded audio and video
tracks directly from one peer to another using mediastream
track objects to represent each
track. see codecs used by webrtc for information about codecs commonly used for making webrtc calls, as well as browser compatibility information around codec support in webrtc. common container formats while there are a vast number of media container formats, the ones listed below are the ones you are most like...
...me movie (mov), and the wavefile audio file format (wav). however, you may also encounter mp3, ogg, webm, avi, and other formats. not all of these are broadly supported by browsers, however; some combinations of container and codec are sometimes given their own file extensions and mime types as a matter of convenience, or because of their ubiquity. ...
...these files use the audio/mp3 mime type and the .mp3 extension, even though their containers are just mpeg. ...
...And 6 more matches
Codecs used by WebRTC - Web media technologies
the webrtc api makes it possible to construct web sites and apps that let users communicate in real time, using audio and/or video as well as optional data and other information. to communicate, the two devices need to be able to agree upon a mutually-understood codec for each
track so they can successfully communicate and present the shared media. this guide reviews the codecs that browsers are required to implement as well as other codecs that some or all browsers support for webrtc. containerless media webrtc uses bare mediastream
track objects for each
track being shared from one peer to another, without a container or even a mediastream associated with the
tracks. which codecs can be within those
tracks is not mandated by the webrtc specification. however, rfc 7742 specifies that all web...
...rs support additional codecs as well. those are listed in the following table. other video codecs codec name profile(s) browser compatibility vp9 — chrome (48+), firefox vp8 vp8, which we describe in general in the main guide to video codecs used on the web, has some specific requirements that must be followed when using it to encode or decode a video
track on a webrtc connection. unless signaled otherwise, vp8 will use square pixels (that is, pixels with an aspect ratio of 1:1). other notes the network payload format for sharing vp8 using rtp (such as when using webrtc) is described in rfc 7741: rtp payload format for vp8 video. avc / h.264 support for avc's constrained baseline (cb) profile is required in all fully-compliant webrtc implementa...
...rocess of starting up, you can use the icegatheringstatechange event to watch for the completion of ice candidate gathering, then fetch the list. let codeclist = null; peerconnection.addeventlistener("icegatheringstatechange", (event) => { if (peerconnection.icegatheringstate === "complete") { const senders = peerconnection.getsenders(); senders.foreach((sender) => { if (sender.
track.kind === "video") { codeclist = sender.getparameters().codecs; return; } }); } codeclist = null; }); the event handler for icegatheringstatechange is established; in it, we look to see if the ice gathering state is complete, indicating that no further candidates will be collected. the method rtcpeerconnection.getsenders() is called to get a list of all the rtcrtpse...
...And 6 more matches
ImageCapture - Web APIs
the imagecapture interface of the mediastream image capture api provides methods to enable the capture of images or photos from a camera or other photographic device. it provides an interface for capturing images from a photographic device referenced through a valid mediastream
track. constructor imagecapture() creates a new imagecapture object which can be used to capture still frames (photos) from a given mediastream
track which represents a video stream. properties imagecapture.
track read only returns a reference to the mediastream
track passed to the constructor. methods the imagecapture interface is based on eventtarget, so it includes the methods defined by that interface as well as the ones listed below. imagecapture.takephoto() takes a single exposure using the video ca...
... imagecapture.getphotocapabilities() returns a promise that resolves with a photocapabilities object containing the ranges of available configuration options. ...
...ning the data. imagecapture.getphotocapabilities() returns a promise that resolves with a photocapabilities object containing the ranges of available configuration options. imagecapture.getphotosettings() returns a promise that resolves with a photosettings object containing the current photo configuration settings. ...
...And 5 more matches
Screen Capture API - Web APIs
getdisplaymedia() method is added to the mediadevices interface. similar to getusermedia(), this method creates a promise that resolves with a mediastream containing the display area selected by the user, in a format that matches the specified options. additions to existing dictionaries the screen capture api adds properties to the following dictionaries defined by other specifications. media
trackconstraints media
trackconstraints.cursor a constraindomstring indicating whether or not the cursor should be included in the captured display surface's stream, and if it should always be visible or if it should only be visible while the mouse is in motion. media
trackconstraints.displaysurface a constraindomstring indicating what type of display surface is to be captured. the value is one of ...
...onstraindomstring indicating whether or not the cursor should be included in the captured display surface's stream, and if it should always be visible or if it should only be visible while the mouse is in motion. media
trackconstraints.displaysurface a constraindomstring indicating what type of display surface is to be captured. the value is one of application, browser, monitor, or window. ...
... type of display surface is to be captured. the value is one of application, browser, monitor, or window. media
trackconstraints.logicalsurface indicates whether or not the video in the stream represents a logical display surface (that is, one which may not be entirely visible onscreen, or may be completely offscreen). a value of true indicates a logical display surface is to be captured. media
tracksettings media
tracksettings.cursor a string which indicates whether or not the display surface currently being captured includes the mouse cursor, and if so, whether it's only visible while the mouse is in motion or if it's always visible. the value is one of always, motion, or never. ...
...And 5 more matches
Linear-gradient Generator - CSS: Cascading Style Sheets
= 'hsl' + a + hsl + v + ')'; return value; }; color.prototype.getcolor = function getcolor() { if (this.a | 0 === 1) return this.gethexa(); return this.getrgba(); }; /*=======================================================================*/ /*=======================================================================*/ /*========== capture mouse movement ==========*/ var setmouse
tracking = function setmouse
tracking(elem, callback) { elem.addeventlistener('mousedown', function(e) { callback(e); document.addeventlistener('mousemove', callback); }); document.addeventlistener('mouseup', function(e) { document.removeeventlistener('mousemove', callback); }); }; /*====================*/ // color picker class /*====================*/ function colorpicker(node)...
...ting the color-picker /*************************************************************************/ colorpicker.prototype.createpickingarea = function createpickingarea() { var area = document.createelement('div'); var picker = document.createelement('div'); area.classname = 'picking-area'; picker.classname = 'picker'; this.picking_area = area; this.color_picker = picker; setmouse
tracking(area, this.updatecolor.bind(this)); area.appendchild(picker); this.node.appendchild(area); }; colorpicker.prototype.createhuearea = function createhuearea() { var area = document.createelement('div'); var picker = document.createelement('div'); area.classname = 'hue'; picker.classname ='slider-picker'; this.hue_area = area; this.hue_picker = picker; setmouse
tracking(are...
...(area, this.updatehueslider.bind(this)); area.appendchild(picker); this.node.appendchild(area); }; colorpicker.prototype.createalphaarea = function createalphaarea() { var mask = document.createelement('div'); var picker = document.createelement('div'); mask.classname = 'alpha'; picker.classname = 'slider-picker'; this.alpha_mask = mask; this.alpha_picker = picker; setmouse
tracking(mask, this.updatealphaslider.bind(this)); mask.appendchild(picker); this.node.appendchild(mask); }; colorpicker.prototype.createpreviewbox = function createpreviewbox(e) { var preview_box = document.createelement('div'); var preview_color = document.createelement('div'); preview_box.classname = 'preview'; preview_color.classname = 'preview-color'; this.preview_color = previ...
...And 5 more matches
repeat() - CSS: Cascading Style Sheets
the repeat() css function represents a repeated fragment of the
track list, allowing a large number of columns or rows that exhibit a recurring pattern to be written in a more compact form. this function can be used in the css grid properties grid-template-columns and grid-template-rows. ...
... the repeat() css function represents a repeated fragment of the
track list, allowing a large number of columns or rows that exhibit a recurring pattern to be written in a more compact form. this function can be used in the css grid properties grid-template-columns and grid-template-rows. ...
...at(4, [col-start] 250px [col-end]) repeat(4, [col-start] 60% [col-end]) repeat(4, [col-start] minmax(100px, 1fr) [col-end]) repeat(4, [col-start] fit-content(200px) [col-end]) repeat(4, 10px [col-start] 30% [col-middle] 400px [col-end]) syntax values <length> a positive integer length. <percentage> a non-negative percentage relative to the inline size of the grid container in column grid
tracks, and the block size of the grid container in row grid
tracks. if the size of the grid container depends on the size of its
tracks, then the <percentage> must be treated as auto. the user-agent may adjust the intrinsic size contributions of the
track to the size of the grid container and increase the final size of the
track by the minimum amount that would result in honoring the percentage. <fle...
...And 5 more matches
Index - MDN Web Docs Glossary: Definitions of Web-related terms
ached: 61 caldav caldav, glossary, infrastructure caldav (calendaring extensions to webdav) is a protocol standardized by the ietf and used to remotely access calendar data from a server. 62 call stack call stack, codingscripting, glossary, javascript a call stack is a mechanism for an interpreter (like the javascript interpreter in a web browser) to keep
track of its place in a script that calls multiple functions — what function is currently being run and what functions are called from within that function, etc. 63 callback function callback, callback function, codingscripting, glossary a callback function is a function passed into another function as an argument, which is then invoked inside the outer function to complete some ...
...fore in any grid we have two axes. the block or column axis, and the inline or row axis. 182 grid cell css grids in a css grid layout, a grid cell is the smallest unit you can have on your css grid. it is the space between four intersecting grid lines and conceptually much like a table cell. ...
...nes and conceptually much like a table cell. 183 grid column css, codingscripting a grid column is a vertical
track in a css grid layout, and is the space between two vertical grid lines. it is defined by the grid-template-columns property or in the shorthand grid or grid-template properties. 184 grid lines css grids grid lines are created when you define
tracks in the explicit grid using css grid layout. in the following example there is a grid with three column
tracks and two row
tracks. this gives us 4 column lines and 3 row lines. 185 grid row css grids a grid row is a horizontal
track in a css grid layout, that is the space between two horizontal grid lines. it is defined by the grid-template-rows property or in the shorthand g...
...And 4 more matches
Accessible multimedia - Learn web development
: an audio transcript will in general help multiple user groups. as well as giving deaf users access to the information contained in the audio, think about a user with a low bandwidth connection, who would find downloading the audio inconvenient. think also about a user in a noisy environment like a pub or bar, who is trying to access the information but can't hear it over the noise. video text
tracks to make video accessible for deaf, blind, or even other groups of users (such as those on low bandwidth, or who don't understand the language the video is recorded in), you need to include text
tracks along with your video content. note: text
tracks are also useful for potentially any user, not just those with disabilities. for example, some users may not be able to hear the audio because the...
... subtitles — include translations of the audio dialog, for users that don't unde...
...aptioning available for quite a long time: whereas many countries offer english films with subtitles written in their own native languages, and different language subtitles are often available on dvds, for example there are different types of text
track with different purposes. the main ones you'll come across are: captions — there for the benefit of deaf users who can't hear the audio
track, including the words being spoken, and contextual information such as who spoke the words, if the people were angry or sad, and what mood the music is currently creating. subtitles — include translations of the audio dialog, for users that don't understand the language being spoken. descriptions — these include descriptions for blind people who can't see the video, for example what the scen...
...And 4 more matches
Introduction to web APIs - Learn web development
, providing you with extra superpowers to use in your javascript code. they generally fall into two categories: browser apis are built into your web browser and are able to expose data from the browser and surrounding computer environment and do useful complex things with it. for example, the web audio api provides javascript constructs for manipulating audio in the browser — taking an audio
track, altering its volume, applying effects to it, etc. in the background, the browser is actually using some complex lower-level code (e.g. c++ or rust) to do the actual audio processing. but again, this complexity is abstracted away from you by the api. third-party apis are not built into the browser by default, and you generally have to retrieve their code and information from somewhere on the web...
...ebgl. such apis are often combined with apis for creating animation loops (such as window.requestanimationframe()) and others to make constantly updating scenes like cartoons and games. audio and video apis like htmlmediaelement, the web audio api, and webrtc allow you to do really interesting things with multimedia such as creating custom ui controls for playing audio and video, displaying text
tracks like captions and subtitles along with your videos, grabbing video from your web camera to be manipulated via a canvas (see above) or displayed on someone else's computer in a web conference, or adding effects to audio
tracks (such as gain, distortion, panning, etc). device apis are basically apis for manipulating and retrieving data from modern device hardware in a way that is useful for web a...
...ton class="paused">play</button> <br> <input type="range" min="0" max="1" step="0.01" value="1" class="volume"> we, first of all, include an <audio> element with which we embed an mp3 into the page. we don't include any default browser controls. ...
...And 4 more matches
Key Values - Web APIs
y_audiorewind (0x010000c5) keycode_media_rewind (89) "mediastop" stops the current media activity (such as playing, recording, pausing, forwarding, or rewinding). has no effect if the media is currently stopped already. ...
...9) "mediastop" stops the current media activity (such as playing, recording, pausing, forwarding, or rewinding). has no effect if the media is currently stopped already. vk_media_stop (0xb2) appcommand_media_stop gdk_key_audiostop (0x1008ff15) qt::key_mediastop (0x01000081) keycode_media_stop (86) "media
tracknext" [1] seeks to the next media or program
track. ...
... stops the current media activity (such as playing, recording, pausing, forwarding, or rewinding). has no effect if the media is currently stopped already. vk_media_stop (0xb2) appcommand_media_stop gdk_key_audiostop (0x1008ff15) qt::key_mediastop (0x01000081) keycode_media_stop (86) "media
tracknext" [1] seeks to the next media or program
track. ...
...And 4 more matches
Using the Screen Capture API - Web APIs
ntents are not available. options and constraints the constraints object passed into getdisplaymedia() is a displaymediastreamconstraints object which is used to configuring the resulting stream. note: unlike most uses of constraints in media apis, here it's solely used to define the stream configuration, and not to filter the available choices. there are three new constraints added to media
trackconstraints (as well as to media
tracksupportedconstraints and media
tracksettings) for configuring a screen capture stream: cursor indicates whether or not to capture the mouse cursor, and if so, whether to do so all the time or only while the mouse is in motion. the possible values are: always the mouse cursor should always be captured in the generated stream. motion the cursor sh...
...tever they want, within the limits of what the user agent supports. this could be refined further by specifying additional information for each of audio and video: const gdmoptions = { video: { cursor: "always" }, audio: { echocancellation: true, noisesuppression: true, samplerate: 44100 } } in this example the cursor will always be visible in the capture, and the audio
track should ideally have noise suppression and echo cancellation features enabled, as well as an ideal audio sample rate of 44.1khz. capturing audio is always optional, and even when web content requests a stream with both audio and video, the returned mediastream may still have only one video
track, with no audio. note: some properties are not widely implemented and might not be used by the engine...
... into the element's srcobject. the dumpoptionsinfo() function—which we will look at in a moment—dumps information about the stream to the log box for educational purposes. if any of that fails, the catch() clause outputs an error message to the log box. stopping display capture the stopcapture() method is called when the "stop capture" button is clicked. ...
...And 4 more matches
XRTargetRayMode - Web APIs
typically a target ray is drawn from the source of the targeting system along the target ray in the direction in which the user is looking or pointing. ...
... typically a target ray is drawn from the source of the targeting system along the target ray in the direction in which the user is looking or pointing. ...
...int of the ray. the targeted point or object might be indicated by drawing a shape or highlighting the targeted surface or object. a target ray emitted by a hand controller. the target ray can be anything from a simple line (ideally fading over distance) to an animated effect, such as the science-fiction "phaser" style shown in the screenshot above. ...
...And 4 more matches
Web APIs
analysernode animation animationeffect animationevent animationplaybackevent animationtimeline arraybufferview attr audiobuffer audiobuffersourcenode audioconfiguration audiocontext audiocontextlatencycategory audiocontextoptions audiodestinationnode audiolistener audionode audionodeoptions audioparam audioparamdescriptor audioparammap audioprocessingevent audioscheduledsourcenode audio
track audio
tracklist audioworklet audioworkletglobalscope audioworkletnode audioworkletnodeoptions audioworkletprocessor authenticatorassertionresponse authenticatorattestationresponse authenticatorresponse b baseaudiocontext basiccardrequest basiccardresponse batterymanager beforeinstallpromptevent beforeunloadevent biquadfilternode blob blobbuilder blobevent bluetooth bluetoothadvertisin...
...oduct cssmathsum cssmathvalue cssmediarule cssnamespacerule cssnumericvalue cssomstring csspagerule csspositionvalue cssprimitivevalue csspseudoelement cssrule cssrulelist cssstyledeclaration cssstylerule cssstylesheet cssstylevalue csssupportsrule cssunitvalue cssunparsedvalue cssvalue cssvaluelist cssvariablereferencevalue cache cachestorage canvascapturemediastream
track canvasgradient canvasimagesource canvaspattern canvasrenderingcontext2d caretposition channelmergernode channelsplitternode characterdata childnode client clients clipboard clipboardevent clipboarditem closeevent comment compositionevent constantsourcenode constrainboolean constraindomstring constraindouble constrainulong contentindex contentindexevent convolvernode countqueuingstrate...
... htmlpictureelement htmlpreelement htmlprogresselement htmlquoteelement htmlscriptelement htmlselectelement htmlshadowelement htmlslotelement htmlsourceelement htmlspanelement htmlstyleelement htmltablecaptionelement htmltablecellelement htmltablecolelement htmltableelement htmltablerowelement htmltablesectionelement htmltemplateelement htmltextareaelement htmltimeelement htmltitleelement html
trackelement htmlulistelement htmlunknownelement htmlvideoelement hashchangeevent headers history hkdfparams hmacimportparams hmackeygenparams i idbcursor idbcursorsync idbcursorwithvalue idbdatabase idbdatabaseexception idbdatabasesync idbenvironment idbenvironmentsync idbfactory idbfactorysync idbindex idbindexsync idbkeyrange idblocaleawarekeyrange idbmutablefile idbobje...
...And 4 more matches
Auto-placement in CSS Grid Layout - CSS: Cascading Style Sheets
v class="wrapper"> <div>one</div> <div>two</div> <div>three</div> <div>four <br>this cell <br>has extra <br>content. <br>max is auto <br>so the row expands. </div> <div>five</div> </div> .wrapper { display: grid; grid-template-columns: repeat(3, 1fr); grid-gap: 10px; grid-auto-rows: minmax(100px, auto); } you can also pass in a
track listing, this will repeat. the following
track listing will create an initial implicit row
track as 100 pixels and a second as 200px. this will continue for as long as content is added to the implicit grid. * {box-sizing: border-box;} .wrapper { border: 2px solid #f76707; border-radius: 5px; background-color: #fff4e6; } .wrapper > div { border: 2px solid #ffa94d; border-...
...columns: repeat(3, 1fr); grid-gap: 10px; grid-auto-rows: 100px 200px; } auto-placement by column you can also ask grid to auto-place items by column. using the property grid-auto-flow with a value of column. in this case grid will add items in rows that you have defined using grid-template-rows. when it fills up a column it will move onto the next explicit column, or create a new column
track in the implicit grid. as with implicit row
tracks, these column
tracks will be auto sized. you can control the size of implicit column
tracks with grid-auto-columns, this works in the same way as grid-auto-rows. in this next example i have created a grid with three row
tracks of 200 pixels height. i am auto-placing by column and the columns created will be a column width of 300 pixels, then a co...
...se column
tracks will be auto sized. you can control the size of implicit column
tracks with grid-auto-columns, this works in the same way as grid-auto-rows. in this next example i have created a grid with three row
tracks of 200 pixels height. i am auto-placing by column and the columns created will be a column width of 300 pixels, then a column width of 100 pixels until there are enough column
tracks to hold all of the items. .wrapper { display: grid; grid-template-rows: repeat(3, 200px); grid-gap: 10px; grid-auto-flow: column; grid-auto-columns: 300px 100px; } * {box-sizing: border-box;} .wrapper { border: 2px solid #f76707; border-radius: 5px; background-color: #fff4e6; } .wrapper > div { border: 2px solid #ffa94d; border-radius: 5px; back...
...And 4 more matches
HTTP Index - HTTP
ate the content of a cache, and sparing a useless control, to verify the integrity of a document, like when resuming a download, or when preventing to lose updates when uploading or modifying a document on the server. 45 http cookies advertising, browser, cookies, cookies article, guide, http, history, javascript, privacy, protocols, server, storage, web development, data, request,
tracking an http cookie (web cookie, browser cookie) is a small piece of data that a server sends to the user's web browser. the browser may store it and send it back with the next request to the same server. 46 http headers http, http header, headers, networking, overview, reference http headers let the client and the server pass additional information with an http request o...
...r agents will use the cookie header instead, not this one. 111 cross-origin-resource-policy http, http header, reference, response header, header the http cross-origin-resource-policy response header conveys a desire that the browser blocks no-cors cross-origin/cross-site requests to the given resource. 112 dnt dnt, http, reference, header the dnt (do not
track) request header indicates the user's
tracking preference. it lets users indicate whether they would prefer privacy rather than personalized content. 113 dpr client hints, http, http header the dpr header is a client hints headers which represents the client device pixel ratio (dpr), which is the the number of physical device pixels corresponding to every css pixel. 114...
...ive, feature-policy, http, reference, wake lock api the http feature-policy header wake-lock directive controls whether the current document is allowed to use wake lock api to indicate that device should not enter power-saving mode. ...
...And 4 more matches
CSS - Archive of obsolete content
lbar-highlight-color css property is a microsoft extension that specifies the color of the slider tray, the top and left edges of the scroll box, and the scroll arrows of a scroll bar.-ms-scrollbar-shadow-colorthe -ms-scrollbar-shadow-color css property is a microsoft extension that specifies the color of the bottom and right edges of the scroll box and scroll arrows of a scroll bar.-ms-scrollbar-
track-colorthe -ms-scrollbar-
track-color css property is a microsoft extension that specifies the color of the
track element of a scrollbar.-ms-text-autospacethe -ms-text-autospace css property is a microsoft extension that specifies the autospacing and narrow space width adjustment of text.-ms-touch-selectthe -ms-touch-select css property is a microsoft extension that toggles the gripper visual elemen...
... pseudo-element is a microsoft extension that represents the button of a <select> menu control that opens or closes the drop-down menu. ...
...lowerthe ::-ms-fill-lower css pseudo-element represents the lower portion of the
track of a slider control; that is, the portion corresponding to values less than the value currently selected by the thumb. a slider control is one possible representation of <input type="range">.::-ms-fill-upperthe ::-ms-fill-upper css pseudo-element is a microsoft extension that represents the upper portion of the
track of a slider control; that is, the portion corresponding to values greater than the value currently selected by the thumb. a slider control is one possible representation of <input type="range">.::-ms-revealthe ::-ms-reveal css pseudo-element is a microsoft extension that is used to display a password reveal button for use with a password field created by <input type="password">. the user presses ...
...And 3 more matches
Gecko info for Windows accessibility vendors
o: the rendering engine for firefox, thunderbird, nvu, mozilla seamonkey and other applications. gecko is the internal engine that mozilla uses to render any kind of web content. it supports html, xhtml, cascading style sheets (css) and the document object model (dom). microsoft active accessibility (msaa) an api devised by microsoft so that accessibility aids can
track what's going on inside the user interface of any software package that supports it. if you seriously need to understand msaa, you'll need to read the docs on msdn and play with the sample apps and code that come with msaa sdk 1.3. (i recommend sdk 1.3 because the msaa sdk 2.0 doesn't come with the source code to the testing tools. the other differences are not important). dom: document...
...nguages. it covers content, style and events. inside the gecko process, code has full access to dom apis. however, exposing the entire dom to external software packages is quite involved, partially because changes to the dom in firefox must occur on the main thread. we have chosen a subset of readonly methods in the dom needed for assistive technology vendors. events such as focus changes must be
tracked through msaa events, rather than dom events. xul: extensible user-interface language the xml-based language used by firefox and mozilla to develop the ui. similar to html in that it can be combined with css and javascript to make powerful applications. contains more desktop-style widgets than html and follows a box layout model, rather than being text-flow based. ...
...tent area, as mozilla will begin to become a windowless application, with an exception for plugins which create their own window. when you see the content window receive focus, first check the role. if it is role_pane or role_document then this should be treated as a document for the default modality of the screen reader. if it is a role_application, role_dialog or role_alert then stay in focus
tracking mode -- there is no need to parse the document. in addition, if it is a role_alert, a screen reader should treat it as a message box -- that is, to read the entire contents. these roles can occur on content because of the new accessible dhtml technology which allows the author to specify the type of document or container. once you know that you have a document, go up the ancestor chain of wi...
...And 3 more matches
Timing element visibility with the Intersection Observer API - Web APIs
the intersection observer api makes it easy to be asynchronously notified when elements of interest become more or less obscured by a shared ancestor node or element, including the document itself. in this article, we'll build a mock blog which has a number of ads interspersed among the contents of the page, then use the intersection observer api to
track how much time each ad is visible to the user. when an ad exceeds one minute of visible time, it will be replaced with a new one. although many aspects of this example will not match real world usage (in particular, the articles all have the same text and aren't loaded from a database, and there are just a handful of simple text-only ads that are selected from an array), this should provide enough understanding of the api to quickly learn how...
...spects of this example will not match real world usage (in particular, the articles all have the same text and aren't loaded from a database, and there are just a handful of simple text-only ads that are selected from an array), this should provide enough understanding of the api to quickly learn how to apply the intersection observer api to your own site. there's a good reason why the notion of
tracking visibility of ads is being used in this example. it turns out that one of the most common uses of flash or other script in advertising on the web is to record how long each ad is visible, for the purpose of billing and payment of revenues. without the intersection observer api, this winds up being done using intervals and timeouts for each individual ad, or other techniques that tend to slow t...
... the global variables: let contentbox; let nextarticleid = 1; let visibleads = new set(); let previouslyvisibleads = null; let adobserver; let refreshintervalid = 0; these are used as follows: contentbox a reference to the <main> element's htmlelement object in the dom. this is where we'll insert the articles and ads. ...
...And 3 more matches
MediaDevices.getUserMedia() - Web APIs
it returns a promise that resolves to a mediastream object. ...
... it returns a promise that resolves to a mediastream object. ...
... it returns a promise that resolves to a mediastream object. ...
...And 3 more matches
Storage Access API - Web APIs
ing worked through and will be announced once ready. user prompts when requeststorageaccess() is called by an embedded, cross-origin document, the user agent may choose to involve the user in the decision of whether to grant storage access to the requesting origin. prompting heuristics currently vary across the two implementers of the storage access api — safari shows prompts for all embedded
tracking content that has not previously received storage access, while firefox only prompts users after a
tracking origin has requested storage access on more than a threshold number of sites. see document.requeststorageaccess() for more details. safari implementation differences although the api surface is the same, websites using the storage access api should expect differences in the level and ex...
.... safari implementation differences although the api surface is the same, websites using the storage access api should expect differences in the level and extent of storage access they receive between firefox and safari. this is caused by differences in the storage access policies implemented in the two browsers. ...
...storage access they receive between firefox and safari. this is caused by differences in the storage access policies implemented in the two browsers. design properties unique to firefox are summarized here: if the embedded origin
tracker.example has already obtained first-party storage access on the top-level origin foo.example, and the user visits a page from foo.example embedding a page from
tracker.example again in less than 30 days, the embedded origin will have storage access immediately when loading. ...
...And 3 more matches
WebRTC API - Web APIs
equiring any special drivers or plug-ins, and can often be made without any intermediary servers. connections between two peers are represented by the rtcpeerconnection interface. once a connection has been established and opened using rtcpeerconnection, media streams (mediastreams) and/or data channels (rtcdatachannels) can be added to the connection. ...
...or plug-ins, and can often be made without any intermediary servers. connections between two peers are represented by the rtcpeerconnection interface. once a connection has been established and opened using rtcpeerconnection, media streams (mediastreams) and/or data channels (rtcdatachannels) can be added to the connection. media streams can consist of any number of
tracks of media information;
tracks, which are represented by objects based on the mediastream
track interface, may contain one of a number of types of media data, including audio, video, and text (such as subtitles or even chapter names). most streams consist of at least one audio
track and likely also a video
track, and can be used to send and receive both live media or stored media information (such as a streamed movie). you ca...
...ection. the only event sent with this interface is datachannel. rtcsessiondescription represents the parameters of a session. each rtcsessiondescription consists of a description type indicating which part of the offer/answer negotiation process it describes and of the sdp descriptor of the session. rtcstatsreport provides information detailing statistics for a connection or for an individual
track on the connection; the report can be obtained by calling rtcpeerconnection.getstats(). details about using webrtc statistics can be found in webrtc statistics api. rtcicecandidate represents a candidate interactive connectivity establishment (ice) server for establishing an rtcpeerconnection. rtcicetransport represents information about an ice transport. rtcpeerconnectioniceevent represents...
...And 3 more matches
Viewpoints and viewers: Simulating cameras in WebXR - Web APIs
uce new diagrams. or, if you're happy to let us continue to use the images, please let us know so we can credit you properly! cameras and relative movement when a classic live-action movie is filmed, the actors are on a set and move about the set as they perform, with one or more cameras watching their moves. the cameras may be fixed in place, but they may also be set up to move around as well,
tracking the movement of the performers, dollying in and out to achieve emotional impact, and so forth. virtual cameras in webgl (and by extension, in webxr), there is no camera object we can move and rotate, so we have to find a way to fake these movements. since there is no camera, we have to find a way to fake it. fortunately, physicists like galileo, newton, lorentz, and einstein have given us th...
...mum value of fov you support and map corresponding values in between. if you start each frame's rendering pass by computing the perspective matrix, you can then multply into that matrix all the other transforms you need to apply in order to result in the frame's desired geometry. for example: const transform = createperspectivematrix(viewport, 130, 1, 100); const translatevec = vec3.fromvalues(-
trackdistance, -cranedistance, pushdistance); mat4.translate(transform, transform, translatevec); this starts with the perspective matrix representing a 130° vertical field of view, then applies a translation that moves the camera in a manner that includes
track, crane, and push movements. scaling transforms unlike a true "zoom", scaling involves multiplying each of the x, y, and z coordinate valu...
...library, such as the rotatex() method in glmatrix's mat4 class: mat4.rotatex(viewmatrix, viewmatrix, angle); positive values for angle will tilt the camera downward, while negative values of angle will tilt upward. dollying (moving in or out) a dolly shot is one in which the entire camera is moved forward and backward. in classic filmmaking, this is typically done with the camera mounted on a
track or on a moving vehicle. the resulting motion can create impressively smooth effects, especially if moving along with the person or object that's the focus of your shot. while a dolly shot and a zoom seem like they ought to look about the same, they don't. the fact that zooming alters the camera's focal length means that the spatial relationship between the target and its surroundings doesn't c...
...And 3 more matches
XRReferenceSpace: reset event - Web APIs
the reset event is sent to an xrreferencespace object when a discontinuity is detected in either the native origin or the effective origin, causing a jump in the position or orientation of objects oriented using the reference space. this is common when the user calibrates or recalibrates an xr device, or if the device automatically changes its origin after losing
tracking of the user, then re-gaining it. in the case of xrboundedreferencespace objects, the reset event can also be fired when the boundsgeometry changes. in either case, the event is sent before any webxr animation frames which make use of the new origin are executed. bubbles yes cancelable no interface xrreferencespaceevent event handler property onreset usage notes the ...
...ronized with the user's actual position and facing. this is primarily an issue for local or local-floor reference spaces. for a bounded-floor reference space, the coordinate system can be reset if the user exits the boundaries of the reference space and enters a new one (such as by crossing from one level to another in a game, where each level is its own map with its own coordinate system). the
tracking system has temporarily lost the user, then regained them, but not until after they had moved enough to leave the immediate vicinity of the last-known position. primarily an issue for unbounded reference spaces. the user is in an unbounded reference space and has moved far enough from the starting position (the reference space's origin) that floating-point or other forms of error or drift are ...
...rence spaces. the user is in an unbounded reference space and has moved far enough from the starting position (the reference space's origin) that floating-point or other forms of error or drift are problematic. the coordinate system is thus reset with its new origin at or near the user's current position. the webxr infrastructure or hardware drivers detected that the device had temporarily lost
tracking, causing the hardware and software to be out of sync on position and orientation. note: a reset event will not occur if the reference space is able to regain
tracking of its previous origin, since that means the origin has not been forced to be relocated. this event is only fired when the origin has to be relocated to recover from the
tracking loss. manual resets if you've spent any time...
...And 3 more matches
XRSession: selectend event - Web APIs
selectend is sent to an xrsession when one of its input sources ends its primary action or when an input source that's in the process of handling an ongoing primary action is disconnected without successfully completing the action. primary actions include things like users pressing triggers or buttons, tapping a touchpad, speaking a command, or performing a recognizable gesture when using a video
tracking system or handheld controller with an accelerometer. bubbles yes cancelable no interface xrinputsourceevent event handler property onselectend for details on how the selectstart, select, and selectend events work, and how you should react to them, see primary actions in inputs and input sources. examples the following example uses addev...
...ene and move them around. in this case, a single function is used to handle all three events, allowing them to share certain code that's the same regardless of which of the three events is received. only after completing those tasks does the onselectionevent() function below dispatch the action out to a specialized function to handle things. ...
...tion to handle things. after checking to ensure that the received event is a
tracked-pointer event (the only kind we handle here), the target ray's pose is obtained using getpose(). if the target ray pose was fetched successfully, the code then uses the value of event property type to route control to an appropriate function to handle the event which arrived: for selectstart events, a mybegin
tracking() function is called with the target ray pose's matrix. the mybegin
tracking() function would presumably start the presentation of the object-dragging process, using the transform to perform a hit test, determining which object to pick up. mybegin
tracking() returns an object representing the object the user has begun to drag. upon receiving a select event, the mydropobject() function is called...
...And 3 more matches
XRSession: selectstart event - Web APIs
the webxr event selectstart is sent to an xrsession when the user begins a primary action on one of its input sources. primary actions include things like users pressing triggers or buttons, tapping a touchpad, speaking a command, or performing a recognizable gesture when using a video
tracking system or handheld controller with an accelerometer. bubbles yes cancelable no interface xrinputsourceevent event handler property onselectstart for details on how the selectstart, select, and selectend events work, and how you should react to them, see primary actions in inputs and input sources. examples the following example uses addeventlistener() to establish handlers for the selection events: selectstart, selectend, and select. this snipp...
...ene and move them around. in this case, a single function is used to handle all three events, allowing them to share certain code that's the same regardless of which of the three events is received. only after completing those tasks does the onselectionevent() function below dispatch the action out to a specialized function to handle things. ...
...tion to handle things. after checking to ensure that the received event is a
tracked-pointer event (the only kind we handle here), the target ray's pose is obtained using getpose(). if the target ray pose was fetched successfully, the code then uses the value of event property type to route control to an appropriate function to handle the event which arrived: for selectstart events, a mybegin
tracking() function is called with the target ray pose's matrix. the mybegin
tracking() function would presumably start the presentation of the object-dragging process, using the transform to perform a hit test, determining which object to pick up. mybegin
tracking() returns an object representing the object the user has begun to drag. upon receiving a select event, the mydropobject() function is called...
...And 3 more matches
XRSession: squeezeend event - Web APIs
d is sent to an xrsession when one of its input sources ends its primary action or when an input source that's in the process of handling an ongoing primary action is disconnected without successfully completing the action. primary squeeze actions include things like users pressing triggers or buttons, tapping a touchpad, speaking a command, or performing a recognizable gesture when using a video
tracking system or handheld controller with an accelerometer. bubbles yes cancelable no interface xrinputsourceevent event handler property onsqueezeend for details on how the squeezestart, squeeze, and squeezeend events work, and how you should react to them, see primary squeeze actions in inputs and input sources. examples the following exampl...
...scene and move them around. in this case, a single function is used to handle all three events, allowing them to share certain code that's the same regardless of which of the three events is received. only after completing those tasks does the onsqueezeevent() function below dispatch the action out to a specialized function to handle things. ...
...ion to handle things. after checking to ensure that the received event is a
tracked-pointer event (the only kind we handle here), the target ray's pose is obtained using getpose(). if the target ray pose was fetched successfully, the code then uses the value of event property type to route control to an appropriate function to handle the event which arrived: for squeezestart events, a mybegin
tracking() function is called with the target ray pose's matrix. the mybegin
tracking() function would presumably start the presentation of the object-dragging process, using the transform to perform a hit test, determining which object to pick up. mybegin
tracking() returns an object representing the object the user has begun to drag. upon receiving a squeeze event, the mydropobject() function is calle...
...And 3 more matches
Box-shadow generator - CSS: Cascading Style Sheets
n = min; this.max = max > 0 ? max : 100; this.step = step === 0 ? 1 : step; this.value = value <= max && value >= min ? value : (min + max) / 2 | 0; this.snap = snap === "true" ? ...
... if (value > slider.max || value < slider.min) return; var delta = slider.max - slider.min; var width = slider.node.clientwidth; var offset = slider.pointer.clientwidth; var pos = (value - slider.min) * width / delta; slider.value = value; slider.pointer.style.left = pos - offset / 2 + "px"; slider.node.setattribute('data-value', value); notify.call(slider); } var setmouse
tracking = function setmouse
tracking(elem, callback) { elem.addeventlistener("mousedown", function(e) { callback(e); document.addeventlistener("mousemove", callback); }); document.addeventlistener("mouseup", function(e) { document.removeeventlistener("mousemove", callback); }); } var subscribe = function subscribe(topic, callback) { if (subscribers[topic] === undefined) subscr...
...snan(value) === false && value >= 0 && value <= 1) color.a = value.tofixed(2); updateui(); } var inputchangehexa = function inputchangehexa(topic) { var selector = "[data-action='set-hexa-" + topic + "']"; var node = document.queryselector("#colorpicker " + selector); var value = node.value; color.sethexa(value); color.updatehsv(); updateui(); } var setmouse
tracking = function setmouse
tracking(elem, callback) { elem.addeventlistener("mousedown", function(e) { callback(e); document.addeventlistener("mousemove", callback); }); document.addeventlistener("mouseup", function(e) { document.removeeventlistener("mousemove", callback); }); } /* * observer */ var setcolor = function setcolor(obj) { if(obj instanceof color !
...And 3 more matches
Enhanced Extension Installation - Archive of obsolete content
// datasources at the install locations for // read-only information requests _profileextensions // the rdf/xml datasource for the items at the // profile install location _globalextensions // the rdf/xml datasource for the items at the // global install location. };
tracking install locations since there are only two locations, the installed location of an extension is expressed throughout the code using a boolean value, often referred to as isprofile - true if the item is installed in the profile directory's extensions folder. this boolean relationship itself is not stored directly in the datasource. rather, if the system needs to know where an item is located, ...
...opriate type container (urn:mozilla:extension:root or urn:mozilla:theme:root) in each of the two datasources. this is clumsy. item type the extension system in firefox 1.0 supports only two item types, extensions and themes. this is a by-product of the fact that there are physical per-type containers in the datasource. sections of ui that display installed items are rooted on these containers.
tracking item type item type is
tracked for the most part by containment in one or other of the two containers. in situations where an item is not yet a member of one of the containers, type is inelegantly determined by checking for presence of a theme-only property on the item's install manifest rdf file. installation initiation when an item is installed from the web, xpinstall is invoked and it c...
...c. for extensions, on the next startup, the startup system notices the presence of the .autoreg file and starts the extension manager with a "dirty" flag, telling it to finish any install operations that may be pending. the extension manager loads the xml/rdf datasources (this is allowable and necessary because a major change has happened) and gets a list of all items that need to be installed (
tracked using a tobeinstalled flag on the item in the datasource). it locates the staged copy of the xpi file, extracts its contents (logging file additions as it goes into {guid}/uninstall/uninstall), loads the install manifest file and copies all metadata into the appropriate datasource. at this time a new extensions.ini file is written locating the extension so that the component manager, preference...
...And 2 more matches
Debugger.Memory - Firefox Developer Tools
it can compute a census of items belonging to the debuggee, categorizing items in various ways, and yielding item counts. ifdbg is a debugger instance, then the methods and accessor properties of dbg.memory control howdbg observes its debuggees’ memory use. the dbg.memory object is an instance of debugger.memory; its inherited accesors and methods are described below. allocation site
tracking the javascript engine marks each new object with the call stack at which it was allocated, if: the object is allocated in the scope of a global object that is a debuggee of some debugger instancedbg; and dbg.memory.
trackingallocationsites is set to true. a bernoulli trial succeeds, with probability equal to the maximum of d.memory.allocationsamplingprobability of all debugge...
...qual to the maximum of d.memory.allocationsamplingprobability of all debugger instances d that are observing the global that this object is allocated within the scope of. given a debugger.object instancedobj referring to some object, dobj.allocationsite returns a saved call stack indicating wheredobj’s referent was allocated. allocation logging ifdbg is a debugger instance, and dbg.memory.
trackingallocationsites is set to true, then the javascript engine logs each object allocated bydbg’s debuggee code. you can retrieve the current log by calling dbg.memory.drainallocationslog. you can control the limit on the log’s size by setting dbg.memory.maxallocationsloglength. censuses a census is a complete traversal of the graph of all reachable memory items belonging to a particular debu...
...oduces a count of those items, broken down by various criteria. ifdbg is a debugger instance, you can call dbg.memory.takecensus to conduct a census of its debuggees’ possessions. accessor properties of the debugger.memory.prototype object ifdbg is a debugger instance, then <i>dbg</i>.memory is a debugger.memory instance, which inherits the following accessor properties from its prototype:
trackingallocationsites a boolean value indicating whether this debugger.memory instance is capturing the javascript execution stack when each object is allocated. this accessor property has both a getter and setter: assigning to it enables or disables the allocation site
tracking. reading the accessor produces true if the debugger is capturing stacks for object allocations, and false otherwise. all...
...And 2 more matches
DisplayMediaStreamConstraints.audio - Web APIs
the displaymediastreamconstraints dictionary's audio property is used to specify whether or not to request that the mediastream containing screen display contents also include an audio
track. this value may simply be a boolean, where true indicates that an audio
track should be included an false (the default) indicates that no audio should be included in the stream. more precise control over the audio data may be exercised by instead providing a media
trackconstraints object, which is used to process the audio prior to adding it to the stream. note: the specification for the screen capture api does not define what the contents of the audio
track should be. this is left up to the user agent to decide. likely sources are the computer's system audio output and the user's microphone, but there i...
...note: the specification for the screen capture api does not define what the contents of the audio
track should be. this is left up to the user agent to decide. likely sources are the computer's system audio output and the user's microphone, but there is no way to specify which source to use. syntax displaymediastreamconstraints.audio = allowaudioflag; displaymediastreamconstraints.audio = media
trackconstraints; displaymediastreamconstraints = { audio: allowaudioflag|media
trackconstraints; } value the value may be either a boolean or a media
trackconstraints object. ...
...re is no way to specify which source to use. syntax displaymediastreamconstraints.audio = allowaudioflag; displaymediastreamconstraints.audio = media
trackconstraints; displaymediastreamconstraints = { audio: allowaudioflag|media
trackconstraints; } value the value may be either a boolean or a media
trackconstraints object. if a boolean is specified, a value of true indicates that an audio
track should be included in the stream returned by getdisplaymedia(), if an appropriate audio source exists and the user agent supports audio on display media. ...
...And 2 more matches
DisplayMediaStreamConstraints.video - Web APIs
the displaymediastreamconstraints dictionary's video property is used to configure the video
track in the stream returned by getdisplaymedia(). this value may simply be a boolean, where true specifies that a default selection of input source be made (typically the entire display area of the device in use, spanning every screen in a multiple screen configuration). since a video
track must always be included, a value of false results in a typeerror exception being thrown. more precise control over the format of the returned video
track may be exercised by instead providing a media
trackconstraints object, which is used to process the video data after obtaining it from the device but prior to adding it to the stream. syntax displaymediastreamconstraints.video = allowvideoflag; displaymediastrea...
...sults in a typeerror exception being thrown. more precise control over the format of the returned video
track may be exercised by instead providing a media
trackconstraints object, which is used to process the video data after obtaining it from the device but prior to adding it to the stream. syntax displaymediastreamconstraints.video = allowvideoflag; displaymediastreamconstraints.video = media
trackconstraints; displaymediastreamconstraints = { video: allowvideoflag | media
trackconstraints; } value the value may be either a boolean or a media
trackconstraints object. if a boolean is specified, a value of true (the default) indicates that the stream returned by getdisplaymedia() should be in whatever format the user agent feels is best. a value of false is not permitted and will throw a...
...diastreamconstraints = { video: allowvideoflag | media
trackconstraints; } value the value may be either a boolean or a media
trackconstraints object. if a boolean is specified, a value of true (the default) indicates that the stream returned by getdisplaymedia() should be in whatever format the user agent feels is best. a value of false is not permitted and will throw a typeerror. if a media
trackconstraints object is given instead, the video
track will be processed to match the settings given in the constraints object. constraints specific to screen sharing these constraints apply to media
trackconstraints objects specified as part of the displaymediastreamconstraints object's video property when using getdisplaymedia() to obtain a stream for screen sharing. cursor a constraindomst...
...And 2 more matches
GlobalEventHandlers.oncuechange - Web APIs
syntax element.oncuechange = handlerfunction; var handlerfunction = element.oncuechange; handlerfunction is either null or a javascript function specifying the handler for the event. ...
... syntax element.oncuechange = handlerfunction; var handlerfunction = element.oncuechange; handlerfunction is either null or a javascript function specifying the handler for the event. ...
... syntax element.oncuechange = handlerfunction; var handlerfunction = element.oncuechange; handlerfunction is either null or a javascript function specifying the handler for the event. ...
...And 2 more matches
ImageCapture.getPhotoCapabilities() - Web APIs
nst capabilitiespromise = imagecaptureobj.getphotocapabilities() return value a promise that resolves with a photocapabilities object. example the following example, extracted from chrome's image capture / photo resolution sample, uses the results from getphotocapabilities() to modify the size of an input range. ...
...ilities() to modify the size of an input range. this example also shows how the imagecapture object is created using a mediastream
track retrieved from a device's mediastream. ...
... of an input range. this example also shows how the imagecapture object is created using a mediastream
track retrieved from a device's mediastream. ...
...And 2 more matches
ImageCapture.getPhotoSettings() - Web APIs
f it only supports discrete widths. redeyereduction: a boolean indicating whether the red-eye reduction should be used if it is available. example the following example, extracted from chrome's image capture / photo resolution sample, uses the results from getphotosettings() to modify the size of an input range. ...
...settings() to modify the size of an input range. this example also shows how the imagecapture object is created using a mediastream
track retrieved from a device's mediastream. ...
...e of an input range. this example also shows how the imagecapture object is created using a mediastream
track retrieved from a device's mediastream. ...
...And 2 more matches
MediaDevices.getDisplayMedia() - Web APIs
d using the mediastream recording api or transmitted as part of a webrtc session. see using the screen capture api for more details and an example. syntax var promise = navigator.mediadevices.getdisplaymedia(constraints); parameters constraints optional an optional mediastreamconstraints object specifying requirements for the returned mediastream. ...
...rt of a webrtc session. see using the screen capture api for more details and an example. syntax var promise = navigator.mediadevices.getdisplaymedia(constraints); parameters constraints optional an optional mediastreamconstraints object specifying requirements for the returned mediastream. since getdisplaymedia() requires a video
track, the returned stream will have one even if no video
track is expressly requested by the constraints object. ...
...ices.getdisplaymedia(constraints); parameters constraints optional an optional mediastreamconstraints object specifying requirements for the returned mediastream. since getdisplaymedia() requires a video
track, the returned stream will have one even if no video
track is expressly requested by the constraints object. return value a promise that resolves to a mediastream containing a video
track whose contents come from a user-selected screen area, as well as an optional audio
track. note: browser support for audio
tracks varies, both in terms of whether or not they're supported at all by the media recorder and in terms of the which audio source or sourcoes are supported. check the compatibility table for details for each browser. exceptions rejections of the returned promise are ma...
...And 2 more matches
MediaDevices - Web APIs
e fired when a media input or output device is attached to or removed from the user's computer. also available via the ondevicechange property. methods inherits methods from its parent interface, eventtarget. enumeratedevices() obtains an array of information about the media input and output devices available on the system. getsupportedconstraints() returns an object conforming to media
tracksupportedconstraints indicating which constrainable properties are supported on the mediastream
track interface. see capabilities and constraints in media capture and streams api (media stream) to learn more about constraints and how to use them. getdisplaymedia() prompts the user to select a display or portion of a display (such as a window) to capture as a mediastream for sharing or recording p...
...aints and how to use them. getdisplaymedia() prompts the user to select a display or portion of a display (such as a window) to capture as a mediastream for sharing or recording purposes. returns a promise that resolves to a mediastream. getusermedia() with the user's permission through a prompt, turns on a camera and/or a microphone on the system and provides a mediastream containing a video
track and/or an audio
track with the input. example 'use strict'; // put variables in global scope to make them available to the browser console. var video = document.queryselector('video'); var constraints = window.constraints = { audio: false, video: true }; var errorelement = document.queryselector('#errormsg'); navigator.mediadevices.getusermedia(constraints) .then(function(stream) { var...
...r an audio
track with the input. example 'use strict'; // put variables in global scope to make them available to the browser console. ...
...And 2 more matches
MediaStreamConstraints - Web APIs
the mediastreamconstraints dictionary is used when calling getusermedia() to specify what kinds of
tracks should be included in the returned mediastream, and, optionally, to establish constraints for those
tracks' settings. to learn more about how constraints work, see capabilities, constraints, and settings. properties some combination—but not necessarily all—of the following properties will exist on the object.
track constraints audio either a boolean (which indicates whether or not an audio
track is requested) or a media
trackconstraints object providing the constraints which must be met by the audio
track included in the returned mediastream. if constraints are specified, an audio
track is inherently requested. video either a boolean (which indicates whether or not a video tra...
... security peeridentity a domstring identifying the peer who has sole access to the stream. ...
... security peeridentity a domstring identifying the peer who has sole access to the stream. if this property is specified, only the indicated peer can receive and use the stream. ...
...And 2 more matches
Media Capture and Streams API (Media Stream) - Web APIs
the media capture and streams api, often called the media streams api or simply mediastream api, is an api related to webrtc which provides support for streaming audio and video data. it provides the interfaces and methods for working with the streams and their constituent
tracks, the constraints associated with data formats, the success and error callbacks when using the data asynchronously, and the events that are fired during the process. concepts and usage the api is based on the manipulation of a mediastream object representing a flux of audio- or video-related data. see an example in get the video. a mediastream consists of zero or more mediastream
track objects, representing various audio or video
tracks. each mediastream
track may have one or more channels. the channel represents the ...
... mediastream objects have a single input and a single output. a mediastream object generated by getusermedia() is called local, and has as its source input one of the user's cameras or microphones. ...
... the mediastream object is linked to a consumer. it can be a media elements, like <audio> or <video>, the webrtc rtcpeerconnection api or a web audio api mediastreamaudiosourcenode. interfaces in these reference articles, you'll find the fundamental information you'll need to know about each of the interfaces that make up the media capture and streams api. ...
...And 2 more matches
PhotoCapabilities - Web APIs
photocapabilities.filllightmode read only returns an array of available fill light options. options may include auto, off, or flash. example the following example, extracted from chrome's image capture / photo resolution sample, uses the results from getphotocapabilities() to modify the size of an input range. ...
...ilities() to modify the size of an input range. this example also shows how the imagecapture object is created using a mediastream
track retrieved from a device's mediastream. ...
... of an input range. this example also shows how the imagecapture object is created using a mediastream
track retrieved from a device's mediastream. ...
...And 2 more matches
RTCConfiguration.bundlePolicy - Web APIs
treams used by the rtcpeerconnection. this string, which must be a member of the rtcbundlepolicy enumeration, has the following possible values: balanced the ice agent begins by creating one rtcdtlstransport to handle each type of content added: one for audio, one for video, and one for the rtc data channel, if applicable. if the remote peer isn't bundle-aware, the ice agent chooses one audio
track and one video
track and those two
tracks are each assigned to the corresponding rtcdtlstransport. all other
tracks are ignored by the connection. this is the default, and most compatible, policy. max-compat the ice agent intially creates one rtcdtlstransport for each media
track and a separate one for the rtcdatachannel, if one is created. if the remote endpoint can't handle bundling, each medi...
...nd one video
track and those two
tracks are each assigned to the corresponding rtcdtlstransport. all other
tracks are ignored by the connection. this is the default, and most compatible, policy. max-compat the ice agent intially creates one rtcdtlstransport for each media
track and a separate one for the rtcdatachannel, if one is created. if the remote endpoint can't handle bundling, each media
track is negotiated on its own separate transport. this introduces bundling but will fall back to not bundling if the remote peer can't handle it. max-bundle the ice agent starts by creating a single rtcdtlstransport to handle all of the connection's media. if the remote peer isn't bundle-compatible, only one media
track is negotiated and the rest are ignored. this maximizes bundling at the risk of l...
...gotiated on its own separate transport. this introduces bundling but will fall back to not bundling if the remote peer can't handle it. max-bundle the ice agent starts by creating a single rtcdtlstransport to handle all of the connection's media. if the remote peer isn't bundle-compatible, only one media
track is negotiated and the rest are ignored. this maximizes bundling at the risk of losing
tracks if the remote peer can't do bundling. if any other value is specified, no configuration is specified when creating the rtcpeerconnection, or if the bundlepolicy property isn't included in the rtcconfiguration object specified when creating the connection, balanced is assumed. description the bundlepolicy configuration option for an rtcpeerconnection specifies how the ice agent should handle ...
...And 2 more matches
RTCRtpSender.setStreams() - Web APIs
the rtcrtpsender method setstreams() associates the sender's
track with the specified mediastream or array of mediastream objects. syntax rtcrtpsender.setstreams(mediastream); rtcrtpsender.setstreams([mediastream...]); parameters mediastream or [mediastream...] optional an mediastream object—or an array of multiple mediastream objects—identifying the streams to which the rtcrtpsender's
track belongs. if this parameter isn't specified, no new streams will be associated with the
track. return value none. exceptions invalidstateerror the sender's connection is closed. description setstreams() is purely additive. it doesn't remove the
track from any streams; it simply adds it to new ones. if you specify streams to which the
track already belongs, that stream is unaffected. ...
...s. if this parameter isn't specified, no new streams will be associated with the
track. return value none. exceptions invalidstateerror the sender's connection is closed. description setstreams() is purely additive. it doesn't remove the
track from any streams; it simply adds it to new ones. if you specify streams to which the
track already belongs, that stream is unaffected. once the
track has been added to all of the streams, renegotiation of the connection will be triggered by the negotiationneeded event being dispatched to the rtcpeerconnection to which the sender belongs. example this example adds all of an rtcpeerconnection's
tracks to the specified stream. ...
...nes. if you specify streams to which the
track already belongs, that stream is unaffected. once the
track has been added to all of the streams, renegotiation of the connection will be triggered by the negotiationneeded event being dispatched to the rtcpeerconnection to which the sender belongs. example this example adds all of an rtcpeerconnection's
tracks to the specified stream. function add
trackstostream(stream) { let senders = pc.getsenders(); senders.foreach((sender) => { if (sender.
track && (sender.transport.state === connected)) { sender.setstreams(stream); } }); } after calling the rtcpeerconnection method getsenders() to get the list of the connection's senders, the add
trackstostream() function iterates over the list. ...
...And 2 more matches
Touch events - Web APIs
the touch events interfaces are relatively low-level apis that can be used to support application-specific multi-touch interactions such as a two-finger gesture. a multi-touch interaction starts when a finger (or stylus) first touches the contact surface. other fingers may subsequently touch the surface and optionally move across the touch surface. the interaction ends when the fingers are removed from the surface. ...
...y support simultaneous touches and at different locations on the touch surface. the touchevent interface encapsulates all of the touchpoints that are currently active. the touch interface, which represents a single touchpoint, includes information such as the position of the touch point relative to the browser viewport. definitions surface the touch-sensitive surface. this may be a screen or
trackpad. touch point a point of contact with the surface. this may be a finger (or elbow, ear, nose, whatever, but typically a finger) or stylus. interfaces touchevent represents an event that occurs when the state of touches on the surface changes. touch represents a single point of contact between the user and the touch surface. touchlist represents a group of touches; this is used wh...
...atever, but typically a finger) or stylus. interfaces touchevent represents an event that occurs when the state of touches on the surface changes. touch represents a single point of contact between the user and the touch surface. touchlist represents a group of touches; this is used when the user has, for example, multiple fingers on the surface at the same time. example this example
tracks multiple touchpoints at a time, allowing the user to draw in a <canvas> with more than one finger at a time. it will only work on a browser that supports touch events. note: the text below uses the term "finger" when describing the contact with the surface, but it could, of course, also be a stylus or other contact method. create a canvas <canvas id="canvas" width="600" height="600" style="bo...
...And 2 more matches
Establishing a connection: The WebRTC perfect negotiation pattern - Web APIs
-view and the view of the incoming stream from the remote peer. connecting to a remote peer the start() function shown here can be called by either of the two end-points that want to talk to one another. it doesn't matter who does it first; the negotiation will just work. ...
...of the incoming stream from the remote peer. connecting to a remote peer the start() function shown here can be called by either of the two end-points that want to talk to one another. it doesn't matter who does it first; the negotiation will just work. async function start() { try { const stream = await navigator.mediadevices.getusermedia(constraints); for (const
track of stream.get
tracks()) { pc.add
track(
track, stream); } selfvideo.srcobject = stream; } catch(err) { console.error(err); } } this isn't appreciably different from older webrtc connection establishment code. the user's camera and microphone are obtained by calling getusermedia(). the resulting media
tracks are then added to the rtcpeerconnection by passing them into add
track(). then, finally, ...
...ode. the user's camera and microphone are obtained by calling getusermedia(). the resulting media
tracks are then added to the rtcpeerconnection by passing them into add
track(). then, finally, the media source for the self-view <video> element indicated by the selfvideo constant is set to the camera and microphone stream, allowing the local user to see what the other peer sees. handling incoming
tracks we next need to set up a handler for
track events to handle inbound video and audio
tracks that have been negotiatied to be received by this peer connection. to do this, we implement the the rtcpeerconnection's on
track event handler. ...
...And 2 more matches
Using bounded reference spaces - Web APIs
uch as virtual paint studios or 3d construction, modeling, or sculpting systems; training simulations or lesson scenarios; dance or other performance-based games; or the preview of 3d objects in the real world using augmented reality. introduction a bounded reference space is one which represents an xr environment in which the user is able to move around physically in the real world while being
tracked by the xr hardware, with their movements being then transposed into the simulation. the boundaries established by the bounded reference space, then, represent the edges of the safely passable,
tracked space in the user's real world environment that are available for their movement while in the simulation. requirements because a bounded reference space establishes a limited area in which the u...
... can be. it's difficult (and would probably be fairly confusing) to create a virtual world that's larger than the physical space available to the user if you're mapping their real-world movement into the virtual environment. imagine how uncomfortable it would feel if you moved 100 meters each time you took a step! the requirements, then, for a bounded reference space are: xr hardware that can
track the user's movement in the real world, such as a camera-based system. a physical space with enough room to move around safely. basics the xrreferencespacetype of all bounded reference spaces is bounded-floor. this is the only type of bounded reference space currently available; in all others, if you need boundaries, you will have to manage them yourself. because bounded-floor is a floor-boun...
...since y is always 0. these points go around the room in a clockwise direction. note that if the underlying platform defines a fixed room-scale origin and boundary, it may initialize any uninitialized values to match that predefined information; this is not unexpected behavior for users of these platforms. the space inside the boundary is then the user's safe movement area, within which they are
tracked and their movements replicated into the virtual world. although the user's xr system may provide automated detection and protection against exiting the safe area, it is always good practice to handle this yourself, watching for collisions between the user's position and the boundary of the world, and providing guidance to move back toward the origin point, or at least to stay inside the safe zo...
...And 2 more matches
WebXR Device API - Web APIs
ding graphical imagery to the real world, (augmented reality, or ar). the webxr device api implements the core of the webxr feature set, managing the selection of output devices, render the 3d scene to the chosen device at the appropriate frame rate, and manage motion vectors created using input controllers. webxr-compatible devices include fully-immersive 3d headsets with motion and orientation
tracking, eyeglasses which overlay graphics atop the real world scene passing through the frames, and handheld mobile phones which augment reality by capturing the world with a camera and augment that scene with computer-generated imagery. to accomplish these things, the webxr device api provides the following key capabilities: find compatible vr or ar output devices render a 3d scene to the devic...
...bxr api is exposed. if this property is missing or null, webxr is not available. webxr interfaces xr the navigator.xr property returns the window's instance of xrsystem, which is the mechanism by which your code accesses the webxr api. using the xrsystem interface, you can create xrsessions to represent actual ar and/or vr sessions. xrframe while presenting an xr session, the state of all
tracked objects which make up the session are represented by an xrframe. to get an xrframe, call the session's requestanimationframe() method, providing a callback which will be called with the xrframe once available. events which communicate
tracking states will also use xrframe to contain that information. xrrenderstate provides a set of configurable properties which change how the imagery output b...
...tion, and the other view is offset to the right by the same distance. the view list can also be used to represent the perspectives of each of the spectators of a scene, in a multi-user environment. xrinputsource represents any input device the user can use to perform targeted actions within the same virtual space as the viewer. input sources may include devices such as hand controllers, optical
tracking systems, and other devices which are explicitly associated with the xr device. other input devices such as keyboards, mice, and gamepads are not presented as xrinputsource instances. xrwebgllayer a layer which serves as a webgl frame buffer into which a scene's view is rendered. using webgl to render the scene gains substantial performance benefits due to graphics acceleration. event inter...
...And 2 more matches
XRInputSource.targetRayMode - Web APIs
indicates the method by which the target ray for the input source should be generated and how it should be presented to the user. syntax let raymode = xrinputsource.targetraymode; value a domstring taken from the xrtargetraymode enumerated type, indicating which method to use when generating and presenting the target ray to the user. ...
...the target ray extends from the hand (or the object in the hand) in the targeted direction. ...
...ystem (or gaze input) which detects the direction in which the user is looking. the target ray will be drawn originating at the viewer's eyes and will follow the direction in which they're looking. screen the direction of the target ray is indicated using a tap on a touch screen, mouse, or other tactile input device.
tracked-pointer targeting is being performed using a handheld device or hand-
tracking system which the user points in the direction of the target. the target ray extends from the hand (or the object in the hand) in the targeted direction. the direction is determined using platform-specific rules, though if no such rules exist, the direction is chosen by assuming the user is pointing their index finger straight out from their hand. usage notes the input source's targetrayspac...
...And 2 more matches
XRSession: squeezestart event - Web APIs
scene and move them around. in this case, a single function is used to handle all three events, allowing them to share certain code that's the same regardless of which of the three events is received. only after completing those tasks does the onsqueezeevent() function below dispatch the action out to a specialized function to handle things. ...
...ion to handle things. after checking to ensure that the received event is a
tracked-pointer event (the only kind we handle here), the target ray's pose is obtained using getpose(). if the target ray pose was fetched successfully, the code then uses the value of event property type to route control to an appropriate function to handle the event which arrived: for squeezestart events, a mybegin
tracking() function is called with the target ray pose's matrix. the mybegin
tracking() function would presumably start the presentation of the object-dragging process, using the transform to perform a hit test, determining which object to pick up. mybegin
tracking() returns an object representing the object the user has begun to drag. upon receiving a squeeze event, the mydropobject() function is calle...
...ct the user has begun to drag. upon receiving a squeeze event, the mydropobject() function is called with the target object and the current target ray pose transform as inputs. this places the object into its new position in the world and triggers any effects that may arise from doing so (like scheduling an animation of a splash if dropped in water, etc). the squeezeend event results in a mystop
tracking() function being called with the object being dragged and the final target ray pose's transform. xrsession.addeventlistener("squeezestart", onsqueezeevent); xrsession.addeventlistener("squeeze", onsqueezeevent); xrsession.addeventlistener("squeezeend", onsqueezeevent); function onsqueezeevent(event) { let source = event.inputsource; let targetobj = null; if (source.targetraymode != "...
...And 2 more matches
CSS grids, logical values, and writing modes - CSS: Cascading Style Sheets
set to the default <code>horizontal-tb</code></p> <p style="writing-mode: vertical-rl">i have writing mode set to <code>vertical-rl</code></p> </div> writing modes in grid layouts if we now take a look at a grid layout example, we can see how changing the writing mode means changing our idea of where the block and inline axis are. ...
...-tb</code></p> <p style="writing-mode: vertical-rl">i have writing mode set to <code>vertical-rl</code></p> </div> writing modes in grid layouts if we now take a look at a grid layout example, we can see how changing the writing mode means changing our idea of where the block and inline axis are. the grid in my next example has three columns and two row
tracks. this means there are three
tracks running down the block axis. ...
...mode means changing our idea of where the block and inline axis are. the grid in my next example has three columns and two row
tracks. this means there are three
tracks running down the block axis. in default writing mode, grid auto-places items starting at the top left, moving along to the right, filling up the three cells on the inline axis. ...
...And 2 more matches
Grid template areas - CSS: Cascading Style Sheets
wrapper { display: grid; grid-auto-rows: minmax(100px, auto); grid-template-columns: 1fr; grid-template-areas: "hd" "main" "sd" "ft"; } we can then redefine that layout inside media queries to go to our two columns layout, and perhaps take it to a three column layout if the available space is even wider. note that for the wide layout i keep my nine column
track grid, i redefine where items are placed using grid-template-areas. @media (min-width: 500px) { .wrapper { grid-template-columns: repeat(9, 1fr); grid-template-areas: "hd hd hd hd hd hd hd hd hd" "sd sd sd main main main main main main" "sd sd sd ft ft ft ft ft ft"; } } @media (min-width: 700px) { .wrapper { gri...
...r small elements as those larger ones. using grid-template-areas can be especially nice as it is easy to see in the code what your element looks like. as a very simple example we can create a “media object”. this is a component with space for an image or other media on one side and content on the other. the image might be displayed on the right or left of the box. our grid is a two-column
track grid, with the column for the image sized at 1fr and the text 3fr. if you wanted a fixed width image area, then you could set the image column as a pixel width, and assign the text area 1fr. a single column
track of 1fr would then take up the rest of the space. we give the image area a grid area name of img and the text area content, then we can lay those out using the grid-template-areas proper...
...class="media"> <div class="image"></div> <div class="text">this is a media object example. we can use grid-template-areas to switch around the image and text part of the media object. </div> </div> displaying the image on the other side of the box we might want to be able to display our box with the image the other way around. to do this, we redefine the grid to put the 1fr
track last, and simply flip the values in grid-template-areas. * {box-sizing: border-box;} .media { border: 2px solid #f76707; border-radius: 5px; background-color: #fff4e6; max-width: 400px; } .media { display: grid; grid-template-columns: 1fr 3fr; grid-template-areas: "img content"; margin-bottom: 1em; } .media.flipped { grid-template-columns: 3fr 1fr; grid...
...And 2 more matches
WebKit CSS extensions - CSS: Cascading Style Sheets
bkit-text-combine -webkit-text-decoration-skip -webkit-text-decorations-in-effect -webkit-text-fill-color -webkit-text-security -webkit-text-stroke-color -webkit-text-stroke-width -webkit-text-stroke -webkit-text-zoom -webkit-transform-origin-x -webkit-transform-origin-y -webkit-transform-origin-z u -webkit-user-drag -webkit-user-modify * a few are on the standards, unprefixed
track ** new syntax has been standardized. property links to the new synax. old prefixed syntax is still supported in some browsers. webkit-prefixed properties on the standards
track -webkit-appearance -webkit-font-size-delta -webkit-mask-composite -webkit-mask-position-x -webkit-mask-position-y -webkit-mask-repeat-x -webkit-mask-repeat-y formerly proprietary properties that are now stan...
...form-style -webkit-transition -webkit-transition-delay -webkit-transition-duration -webkit-transition-property -webkit-transition-timing-function u-w -webkit-user-select -epub-word-break -epub-writing-mode supported in non-webkit browsers without a prefix, but not standard the following properties are supported in at least one browser without a prefix, but are not on the standards
track. -webkit-mask-position-x* -webkit-mask-position-y* * supported unprefixed in firefox, with prefix in safari. supported in firefox with -webkit- prefix the following properties are supported with the -webkit- prefix in firefox. many of these are supported with no prefix as well: see formerly proprietary properties that are now standard above. note: due to the legacy code in a multitude...
...tion -webkit-transition-property -webkit-transition-timing-function u -webkit-user-select *supported with -moz- and -webkit- prefix in firefox, but not supported without a prefix. microsoft edge and ie mobile support this property with the -webkit- prefix, rather than -ms- for interopability reasons as well. ** these values are supported even though they are not standard and are not on
track to becoming standard. *** use flex-box properties instead. deprecated -webkit- properties the following properties were once supported with the -webkit- prefix but are no longer supported in evergreen browsers, with or without the -webkit- prefix. -webkit-alt* -webkit-color-correction -webkit-flow-from -webkit-flow-into -webkit-grid-columns (see grid-column) -webkit-grid-rows (see gri...
...And 2 more matches
minmax() - CSS: Cascading Style Sheets
the minmax() css function defines a size range greater than or equal to min and less than or equal to max. it is used with css grids. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...o contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* <inflexible-breadth>, <
track-breadth> values */ minmax(200px, 1fr) minmax(400px, 50%) minmax(30%, 300px) minmax(100px, max-content) minmax(min-content, 400px) minmax(max-content, auto) minmax(auto, 300px) minmax(min-content, auto) /* <fixed-breadth>, <
track-breadth> values */ minmax(200px, 1fr) minmax(30%, 300px) minmax(400px, 50%) minmax(50%, min-content) minmax(300px, max-content) minmax(200px, auto) /* <inflexible-breadth>, <fixed-breadth> values */ minmax(400px, 50%) minmax(30%, 300px) minmax(min-content, 200px) minmax(max-content, 200px) minmax(auto, 300px) a function taking two parameters, min and max. each parameter can be a <length>, a <...
...30%, 300px) minmax(min-content, 200px) minmax(max-content, 200px) minmax(auto, 300px) a function taking two parameters, min and max. each parameter can be a <length>, a <percentage>, a <flex> value, or one of the keyword values max-content, min-content, or auto. if max < min, then max is ignored and minmax(min,max) is treated as min. as a maximum, a <flex> value sets the flex factor of a grid
track; it is invalid as a minimum. values <length> a non-negative length. <percentage> a non-negative percentage relative to the inline size of the grid container in column grid
tracks, and the block size of the grid container in row grid
tracks. if the size of the grid container depends on the size of its
tracks, then the <percentage> must be treated as auto. the user agent may adjust the intri...
...And 2 more matches
Using HTTP cookies - HTTP
ver. typically, it's used to tell if two requests came from the same browser — keeping a user logged-in, for example. it remembers stateful information for the stateless http protocol. cookies are mainly used for three purposes: session management logins, shopping carts, game scores, or anything else the server should remember personalization user preferences, themes, and other settings
tracking recording and analyzing user behavior cookies were once used for general client-side storage. while this was legitimate when they were the only way to store data on the client, it is now recommended to use modern storage apis. cookies are sent with every request, so they can worsen performance (especially for mobile data connections). modern apis for client storage are the web storage api (...
...t are used for sensitive information (such as indicating authentication) should have a short lifetime, with the samesite attribute set to strict or lax. (see samesite cookies, above.) in browsers that support samesite, this has the effect of ensuring that the authentication cookie is not sent with cross-origin requests, so such a request is effectively unauthenticated to the application server.
tracking and privacy third-party cookies a cookie is associated with a domain. if this domain is the same as the domain of the page you are on, the cookie is called a first-party cookie. if the domain is different, it is a third-party cookie. while the server hosting a web page sets first-party cookies, the page may contain images or other components stored on servers in other domains (for example, a...
...n is the same as the domain of the page you are on, the cookie is called a first-party cookie. if the domain is different, it is a third-party cookie. while the server hosting a web page sets first-party cookies, the page may contain images or other components stored on servers in other domains (for example, ad banners), which may set third-party cookies. ...
...And 2 more matches
Tk - HTTP
the tk response header indicates the
tracking status that applied to the corresponding request. header type response header forbidden header name no syntax tk: ! (under construction) tk: ? (dynamic) tk: g (gateway or multiple parties) tk: n (not
tracking) tk: t (
tracking) tk: c (
tracking with consent) tk: p (potential consent) tk: d (disregarding dnt) tk: u (updated) directives ! under construction. the origin server is currently testing its communication of
tracking status. ? dynamic. the origin server needs more information to determine
tracking status. g gateway or multiple parties. the server is acting as a gateway to an exchange involving multiple parties. n not
tracking. t
tracking. c
tracking with consent. the origin server belie...
...ruction. the origin server is currently testing its communication of
tracking status. ? ...
...acking status. g gateway or multiple parties. the server is acting as a gateway to an exchange involving multiple parties. n not
tracking. t
tracking. c
tracking with consent. the origin server believes it has received prior consent for
tracking this user, user agent, or device. p potential consent. ...
...And 2 more matches
Autoplay guide for media and Web Audio APIs - Web media technologies
automatically starting the playback of audio (or videos with audio
tracks) immediately upon page load can be an unwelcome surprise to users. while autoplay of media serves a useful purpose, it should be used carefully and only when needed. in order to give users control over this, browsers often provide various forms of autoplay blocking. in this guide, we'll cover autoplay functionality in the various media and web audio apis, including a brief overview of how to use autoplay and how to work with browsers to handle autoplay blocking gracefully. autoplay blocking is not applied to <video> elements when the source media does not have an audio
track, or if the audio
track is muted. media with an active audio
track are considered to be audible, and autoplay blocking applies to them. inaud...
...ps and recommended best practices to help you make the most of working with autoplay are offered here. handling autoplay failure with media controls a common use case for autoplay is to automatically begin to play a video clip that goes along with an article, an advertisement, or a preview of the page's main functionality. ...
...practices to help you make the most of working with autoplay are offered here. handling autoplay failure with media controls a common use case for autoplay is to automatically begin to play a video clip that goes along with an article, an advertisement, or a preview of the page's main functionality. to autoplay videos like these, you have two options: don't have an audio
track, or have an audio
track but configure the <video> element to mute the audio by default, like this: <video src="/videos/awesomevid.webm" controls autoplay muted> this video element is configured to include the user controls (typically play/pause, scrubbing through the video's timeline, volume control, and muting); also, since the muted attribute is included, the video will autoplay but with the audio muted. the user ha...
...And 2 more matches
Building accessible custom components in XUL - Archive of obsolete content
ow header, or column header has focus click on other cells or headers to change focus within the spreadsheet tab off the spreadsheet by pressing tab once tab back to the spreadsheet and automatically set focus to the previously focused cell or header inspect32 confirms that all of this really works; it's not just visual smoke and mirrors. when you click a spreadsheet cell, assistive technologies
track the focus change and know which cell has received focus. <caption>cells really get focus</caption> clicking a row or column headers also changes the focus properly. <caption>cells really get focus</caption> further reading key-navigable custom dhtml widgets on mozilla.org adding keyboard navigation download stage-4.zip install stage-4.xpi true accessibility requires complete...
...heet'); spreadsheet.addeventlistener('keypress', spreadsheet_keypress, true); spreadsheet.addeventlistener('focus', spreadsheet_focus, true); spreadsheet.addeventlistener('click', spreadsheet_click, true); } </code> with this new event handler and associated helper functions, we can navigate between cells and headers using the arrow keys. inspect32 confirms that assistive technologies
track the focus as we navigate within the spreadsheet. <caption>focus is
tracked properly during keyboard navigation</caption> further reading document object model events adding editing capabilities download stage-5.zip install stage-5.xpi we now have a fully accessible xul spreadsheet, correctly focusable, correctly keyboard-navigable, and correctly exposed to assistive technologies. we ...
...ing the original label and copying the new value back. if the user presses esc, we "cancel" the edit by simply recreating the original label and restoring its previous value. finally, if the user hits tab while editing, we treat this as acceptance and recreate the label with the new value, then let firefox manage changing focus to the spreadsheet's next sibling. ...
...abel element. <caption>after editing a cell</caption> further reading accessible html spreadsheet demo on mozilla.org future enhancements now that we know how to create an accessible spreadsheet, it should be possible to use xbl to create a reusable component that encapsulates the accessibility implementation. all of the dhtml accessibility roles, the keyboard navigation, and the focus
tracking could be defined within the xbl file. this would allow xul developers to add a single spreadsheet element to their xul applications (for example), with rowheader, columnheader, and cell elements as children, without requiring them to manage the accessibility support for each spreadsheet control. ...
Archived Mozilla and build documentation - Archive of obsolete content
ing a particular line of code ("cvsblame"). bookmark keywords practically every web surfer has bookmarks, of course, and power surfers usually have hundreds stuffed into folders within folders. in addition to being handy pointers to useful resources, bookmarks in mozilla can be used to make the address bar itself a power tool. searches, lookups, package
tracking, and even word definitions can all be retrieved from user-customized bookmarks. building transformiix standalone calicalendarview an object implementing calicalendarview is generally intended to serve as a way of manipulating a set of dom nodes corresonding to a visual representation of calievent and calitodo objects. because of this...
...ning multiple links in a document or selection). this tutorial walks you through the process of building a mozilla extension that adds an icon to mozilla's status bar showing the current status of the mozilla source code (i.e. whether or not the latest version of the code is compiling successfully and passing tests). the extension will access tinderbox, mozilla.org's webtool for
tracking source code status, to get the status of the code. creating a skin for firefox/getting started download the latest version of firefox and install it. be sure to install the dom inspector extension as well. creating a skin for mozilla in order to create a skin for mozilla, you will need to know three things. how to edit images, extract zip file...
... and associated classes and structures are used by block and line layout to manage rectangular regions that are occupied and available, for correct handling of floated elements and the elements that flow around them. when elements are floated to the left or right in a layout, they take up space and influence where other elements can be placed. the space manager is responsible for keeping
track of where space is taken up and where it is available. this information is used by block layout to correctly compute where other floated elements should be placed, and how much space is available to normal in-flow elements that flow around the floated bits. standalone xpcom standalone xpcom is a tree configuration that builds a minimal set of libraries (shared mos...
...2 a distinction between fixed and auto layout of tables has been introduced. the auto-layout mechanism is implemented in basictablelayoutstrategy.cpp the fixed-layout in fixedtablelayoutstrategy.cpp. all these files are in the layout/html/table/src subdirectory. tamarin the download manager schema the download manager uses an sqlite table to keep
track of downloads in progress as well as queued and past downloads. the life of an html http request the new nsstring class implementation (1999) this document is intended to briefly describe the new nsstring class architecture, and discuss the implications on memory management, optimizations, internationalization and usage patterns. tracevis ...
Mozilla XForms Specials - Archive of obsolete content
introduction this article gives an overview of where the mozilla xforms extension deviates from the official xforms 1.0 specification . this covers both limitations in the extension, and custom extensions. limitations repeat using attributes the specifications mentions "creating repeating structures via attributes", this is partially supported. (limitation
tracked in bug 280368) mixing repeat and table or ul it is not possible to mix repeats with either table or ul. that means that it is not possible to do: <table> <xf:repeat ...> <tr> ... </tr> </xf:repeat> </table> or <ul> <xf:repeat ...> <li> ... </li> </xf:repeat> </ul> section 9.3.2 states that mixing with table will probably never work. mixing with ul might suffer from the same limitation. pseudo-class support we cu...
....2 states that mixing with table will probably never work. mixing with ul might suffer from the same limitation. pseudo-class support we currently support all the css pseudo-classes in xforms (:enabled, :disabled, etc. ), except for :read-only and :read-write, because of non-specified behaviour of these for (x)html. instead you have to use :-moz-read-only and :-moz-read-write for now. (limitation
tracked in bug 313111)pseudo element support there is no support for the pseudo elements (::value, ::repeat-item, and ::repeat-index ). instead you will have to use the following normal classes instead: xf-value xf-repeat-item xf-repeat-index for example, to target the value element of an input control use: @namespace xf url("http://www.w3.org/2002/xforms"); xf|input .xf-value { ... } the pseudo e...
...ts (::value, ::repeat-item, and ::repeat-index ). instead you will have to use the following normal classes instead: xf-value xf-repeat-item xf-repeat-index for example, to target the value element of an input control use: @namespace xf url("http://www.w3.org/2002/xforms"); xf|input .xf-value { ... } the pseudo elements are defined in the css3 basic user interface specification . ...
...in the mozilla xforms extension we added a getinstancedocuments() function to the model which returns all the model's instance documents. this is documented in nsixformsnsmodelelement. ...
Index - Learn web development
er general best practices (which are demonstrated throughout the html, css, and javascript topics), cross browser testing, and some tips on enforcing accessibility from the start. we'll cover accessibility in special detail. 3 accessible multimedia accessibility, article, audio, beginner, codingscripting, html, images, javascript, learn, multimedia, video, captions, subtitles, text
tracks this chapter has provided a summary of accessibility concerns for multimedia content, along with some practical solutions. 4 assessment: accessibility troubleshooting accessibility, assessment, beginner, css, codingscripting, html, javascript, learn, wai-aria in the assessment for this module, we present to you a simple site with a number of accessibility issues that y...
...on, instance, l10n:priority, object literal, theory, this congratulations, you've reached the end of our first js objects article — you should now have a good idea of how to work with objects in javascript — including creating your own simple objects. you should also appreciate that objects are very useful as structures for storing related data and functionality — if you tried to keep
track of all the properties and methods in our person object as separate variables and functions, it would be inefficient and frustrating, and we'd run the risk of clashing with other variables and functions that have the same names. objects let us keep the information safely locked away in their own package, out of harm's way. 68 object building practice article, beginner, canvas, codin...
...phics, guide, html, image, intermediate, jpeg, png, pictures, captions, hyperlinks, img, picture, sizes, src, srcset that's a wrap for responsive images — we hope you enjoyed playing with these new techniques. as a recap, there are two distinct problems we've been discussing here: 250 video and audio content article, audio, beginner, guide, html, video, captions, subtitles,
track and that's a wrap; we hope you had fun playing with video and audio in web pages! in the next article, we'll look at other ways of embedding content on the web, using technologies like <iframe> and <object>. 251 test your skills: multimedia and embedding beginner, embedding, html, learn, multimedia, test your skills this aim of this skill test is to assess whether you'v...
...tored our html into components! in the next article we'll start looking into adding interactivity to our ember application. 281 ember interactivity: events, classes and state beginner, classes, ember, frameworks, javascript, learn, services, client-side, decorators, events ok, so that's great progress for now. we can now add todo items to our app, and the state of the data is
tracked using our service. next we'll move on to getting our footer functionality working, including the todo counter, and look at conditional rendering, including correctly styling todos when they've been checked. we'll also wire up our "clear completed" button. 282 ember resources and troubleshooting beginner, ember, frameworks, javascript, learn, client-side, resources our final...
Localizing with Koala
pository already set up by l10n-drivers, the steps are the same as above. just hg clone from the right bitbucket url. for example: c:\users\stas> cd c:\mozilla\l10n\locale\x-testing c:\mozilla\l10n\locale\x-testing> rmdir 3.6 c:\mozilla\l10n\locale\x-testing> hg clone http://bitbucket.org/mozillal10n/x-testing 3.6 otherwise, it's a good idea to create your local repository in order to be able to
track changes you make to the localization files. to do this, open the console and type: c:\users\stas> cd c:\mozilla\l10n\locale\x-testing\3.6 c:\mozilla\l10n\locale\x-testing\3.6> hg init you should now see the the koala's starpage in komodo. you are ready to start localizing firefox! comparing and translating now that we have set up koala to localize firefox from en-us into x-testing, we can s...
...s commit your work to the local hg repository that you created in the "creating a new project" section. committing your work hopefully by now, you have translated 3 strings in the following 2 files: searchbar.dtd: cmd_enginemanager.label searchendcap.label search.properties: cmd_addfoundengine it's time to put these files under mercurial's version control system. this will allow you to
track changes, export them to remote repositories (first on bitbucket, later on hg.mozilla.org) and revert files to earlier versions in case of errors. version control systems add a lot of transparency to your work and allow others to get involved easily, so it's best to commit often (e.g. after you finish translating every file, or even more frequently). koala supports mercurial and allows you to add ...
...fully issue "hg cmd" commands in that directory (where "cmd" might be "status", "log", "commit" etc.). for example, try issuing "hg status" inside c:\mozilla\l10n\locale\x-testing\3.6: c:\mozilla\l10n\locale\x-testing\3.6> hg status ? browser\chrome\browser\search.properties ? browser\chrome\browser\searchbar.dtd the question marks ("?") in front of the file names indicate that the files are not
tracked by mercurial in this repository (yet). to start
tracking them, you will need to "hg add" them. this can be done from koala. once you "hg add" every new file in the repository that you want to
track in mercurial, you will need to "hg commit" these new files so as to create a new revision in the repository's history. this process need to be repeated for every new file that you add. also, removing...
...see "hg help add", "hg help remove" and "hg help addremove" for more details. let's now add and commit these two files from koala. in the "locale files" view in the sidebar, right click on search.properties and choose "add file to repository". ...
Debugger - Firefox Developer Tools
he debugger.object instance whose referent is the designated global object. the debugger instance does not hold a strong reference to its debuggee globals: if a debuggee global is not otherwise reachable, then it is dropped from the debugger’s set of debuggees. ...
...erent is the designated global object. the debugger instance does not hold a strong reference to its debuggee globals: if a debuggee global is not otherwise reachable, then it is dropped from the debugger’s set of debuggees. ...
...otherwise this method returns undefined. this method is only available to debuggers running in privileged code (“chrome”, in firefox). ...
...otherwise this method returns undefined. this method is only available to debuggers running in privileged code (“chrome”, in firefox). ...
Tutorial: Show Allocations Per Call Path - Firefox Developer Tools
in this // scratchpad; it doesn't actually start debugging anything. components.utils.import('resource://gre/modules/jsdebugger.jsm'); adddebuggertoglobal(window); (function () { // the debugger we'll use to observe a tab's allocation. var dbg; // start measuring the selected tab's main window's memory // consumption. this function is available in the browser // console. ...
...w's memory // consumption. this function is available in the browser // console. window.demo
trackallocations = function() { dbg = new debugger; // this makes hacking on the demo *much* more // pleasant. dbg.uncaughtexceptionhook = handleuncaughtexception; // find the current tab's main content window. var w = gbrowser.selectedbrowser.contentwindow; console.log("
tracking allocations in page: " + w.location.href); // make that window a debuggee of our debugger. dbg.adddebuggee(w.wrappedjsobject); // enable allocation
tracking in dbg's debuggees. dbg.memory.
trackingallocationsites = true; } window.demoplotallocations = function() { // grab the allocation log. var log = dbg.memory.drainallocationslog(); // neutr...
...er. dbg.adddebuggee(w.wrappedjsobject); // enable allocation
tracking in dbg's debuggees. dbg.memory.
trackingallocationsites = true; } window.demoplotallocations = function() { // grab the allocation log. var log = dbg.memory.drainallocationslog(); // neutralize the debugger, and drop it on the floor // for the gc to collect. console.log("stopping allocation
tracking."); dbg.removealldebuggees(); dbg = undefined; // analyze and display the allocation log. plot(log); } function handleuncaughtexception(ex) { console.log('debugger hook threw:'); console.log(ex.tostring()); console.log('stack:'); console.log(ex.stack); }; function plot(log) { // given the log, compute a map from allocation sites to // allocati...
...this begins logging allocations in the current browser tab. in the browser tab, click on the text that says "click here…". the event handler should add some text to the end of the page. back in the browser console, evaluate the expression demoplotallocations(). this stops logging allocations, and displays a tree of allocations: an allocatio...
BaseAudioContext.decodeAudioData() - Web APIs
a() method of the baseaudiocontext interface is used to asynchronously decode audio file data contained in an arraybuffer. in this case the arraybuffer is loaded from xmlhttprequest and filereader. the decoded audiobuffer is resampled to the audiocontext's sampling rate, then passed to a callback or promise. this is the preferred method of creating an audio source for web audio api from an audio
track. this method only works on complete file data, not fragments of audio file data. syntax older callback syntax: baseaudiocontext.decodeaudiodata(arraybuffer, successcallback, errorcallback); newer promise-based syntax: promise<decodeddata> baseaudiocontext.decodeaudiodata(arraybuffer); parameters arraybuffer an arraybuffer containing the audio data to be decoded, usually grabbed from xml...
...rrorcallback an optional error callback, to be invoked if an error occurs when the audio data is being decoded. return value void, or a promise object that fulfills with the decodeddata. example in this section we will first cover the older callback-based system and then the newer promise-based syntax. older callback syntax in this example, the getdata() function uses xhr to load an audio
track, setting the responsetype of the request to arraybuffer so that it returns an array buffer as its response that we then store in the audiodata variable . we then pass this buffer into a decodeaudiodata() function; the success callback takes the successfully decoded pcm data, puts it into an audiobuffersourcenode created using audiocontext.createbuffersource(), connects the source to the audiocont...
... response that we then store in the audiodata variable . we then pass this buffer into a decodeaudiodata() function; the success callback takes the successfully decoded pcm data, puts it into an audiobuffersourcenode created using audiocontext.createbuffersource(), connects the source to the audiocontext.destination and sets it to loop. the buttons in the example simply run getdata() to load the
track and start it playing, and stop it playing, respectively. when the stop() method is called on the source, the source is cleared out. note: you can run the example live (or view the source.) // define variables var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); var source; var pre = document.queryselector('pre'); var myscript = document.queryselector('script'); var play ...
...e source is cleared out. note: you can run the example live (or view the source.) // define variables var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); var source; var pre = document.queryselector('pre'); var myscript = document.queryselector('script'); var play = document.queryselector('.play'); var stop = document.queryselector('.stop'); // use xhr to load an audio
track, and // decodeaudiodata to decode it and stick it in a buffer. // then we put the buffer into the source function getdata() { source = audioctx.createbuffersource(); var request = new xmlhttprequest(); request.open('get', 'viper.ogg', true); request.responsetype = 'arraybuffer'; request.onload = function() { var audiodata = request.response; audioctx.decodeaudiodata(audiod...
MediaSettingsRange - Web APIs
owing example, extracted from chrome's image capture / photo resolution sample, uses the results from getphotocapabilities().imagewidth to modify the size of an input range. ...
...m chrome's image capture / photo resolution sample, uses the results from getphotocapabilities().imagewidth to modify the size of an input range. ...
...ple, uses the results from getphotocapabilities().imagewidth to modify the size of an input range. ...
...ument.queryselector('input[type="range"]'); var imagecapture; navigator.mediadevices.getusermedia({video: true}) .then(mediastream => { document.queryselector('video').srcobject = mediastream; const
track = mediastream.getvideo
tracks()[0]; imagecapture = new imagecapture(
track); return imagecapture.getphotocapabilities(); }) .then(photocapabilities => { const settings = imagecapture.
track.getsettings(); input.min = photocapabilities.imagewidth.min; input.max = photocapabilities.imagewidth.max; input.step = photocapabilities.imagewidth.step; return imagecapture.getphotosettings(); }) .then(photosettings => { input.value = photosettings.imagewidth; }) .catch(error => console.log('argh!', error.name || error)); specifications specification status comment ...
Media Source API - Web APIs
ides functionality enabling plugin-free web-based streaming media. using mse, media streams can be created via javascript, and played using <audio> and <video> elements. ...
...c features offered have really only been useful for playing single whole
tracks. we can't, for example, combine/split arraybuffers. streaming media has up until recently been the domain of flash, with technologies like flash media server serving video streams using the rtmp protocol. the mse standard with media source extensions (mse), this is changing. mse allows us to replace the usual single
track src value fed to media elements with a reference to a mediasource object, which is a container for information like the ready state of the media for being played, and references to multiple sourcebuffer objects that represent the different chunks of media that make up the entire stream. mse gives us finer grained control over how much and how often content is fetched, and some control over memory...
...ebuffer represents a chunk of media to be passed into an htmlmediaelement via a mediasource object. sourcebufferlist a simple container list for multiple sourcebuffer objects. videoplaybackquality contains information about the quality of video being played by a <video> element, such as number of dropped or corrupted frames. returned by the htmlvideoelement.getvideoplaybackquality() method.
trackdefault provides a sourcebuffer with kind, label, and language information for
tracks that do not contain this information in the initialization segments of a media chunk.
trackdefaultlist a simple container list for multiple
trackdefault objects. extensions to other interfaces url.createobjecturl() creates an object url pointing to a mediasource object that can then be specified as the s...
...be specified as the src value of an html media element to play a media stream. htmlmediaelement.seekable when a mediasource object is played by an html media element, this property will return a timeranges object that contains the time ranges that the user is able to seek to. htmlvideoelement.getvideoplaybackquality() returns a videoplaybackquality object for the currently played video. audio
track.sourcebuffer, video
track.sourcebuffer, text
track.sourcebuffer returns the sourcebuffer that created the
track in question. specifications specification status comment media source extensions recommendation initial definition. ...
Pointer Lock API - Web APIs
osition of the ball on the canvas (x and y), and also includes if() statements to check whether the ball has gone off the edges of the canvas. if so, it makes the ball wrap around to the opposite edge. it also includes a check whether a requestanimationframe() call has previously been made, and if so, calls it again as required, and calls the canvasdraw() function that updates the canvas scene. ...
...ether the ball has gone off the edges of the canvas. if so, it makes the ball wrap around to the opposite edge. it also includes a check whether a requestanimationframe() call has previously been made, and if so, calls it again as required, and calls the canvasdraw() function that updates the canvas scene. a
tracker is also set up to write out the x and y values to the screen, for reference. ...
...es of the canvas. if so, it makes the ball wrap around to the opposite edge. it also includes a check whether a requestanimationframe() call has previously been made, and if so, calls it again as required, and calls the canvasdraw() function that updates the canvas scene. a
tracker is also set up to write out the x and y values to the screen, for reference. ...
...alues to the screen, for reference. ...
RTCPeerConnection.getSenders() - Web APIs
the array is empty if there are no rtp senders on the connection. the order of the returned rtcrtpsenders is not defined by the specification, and may change from one call to getsenders() to the next. ...
...the array is empty if there are no rtp senders on the connection. the order of the returned rtcrtpsenders is not defined by the specification, and may change from one call to getsenders() to the next. ...
...the array is empty if there are no rtp senders on the connection. the order of the returned rtcrtpsenders is not defined by the specification, and may change from one call to getsenders() to the next. ...
.... the order of the returned rtcrtpsenders is not defined by the specification, and may change from one call to getsenders() to the next. example in this example, a setmuting() function is shown. this function takes as input an rtcpeerconnection, pc, and a boolean, muting. the function gets the list of the peer connection's senders and iterates over every sender, setting the corresponding media
track's enabled to the inverse of the specified muting. function setmuting(pc, muting) { let senderlist = pc.getsenders(); senderlist.foreach(sender) { sender.
track.enabled = !muting; } } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnection.getsenders()' in that specification. c...
RTCRtpSender - Web APIs
the rtcrtpsender interface provides the ability to control and obtain details about how a particular mediastream
track is encoded and sent to a remote peer. with it, you can configure the encoding used for the corresponding
track, get information about the device's media capabilities, and so forth. you can also obtain access to an rtcdtmfsender which can be used to send dtmf codes (to simulate the user pressing buttons on a telephone's dial pad) to the remote peer. properties rtcrtpsender.dtmf read only an rtcdtmfsender which can be used to send dtmf tones using telephone-event payloads on the rtp session represented by the rtcrtpsender object. ...
...apabilities, and so forth. you can also obtain access to an rtcdtmfsender which can be used to send dtmf codes (to simulate the user pressing buttons on a telephone's dial pad) to the remote peer. properties rtcrtpsender.dtmf read only an rtcdtmfsender which can be used to send dtmf tones using telephone-event payloads on the rtp session represented by the rtcrtpsender object. if null, the
track and/or the connection doesn't support dtmf. only audio
tracks can support dtmf. rtcrtpsender.
track read only the mediastream
track which is being handled by the rtcrtpsender. if
track is null, the rtcrtpsender doesn't transmit anything. rtcrtpsender.transport read only the rtcdtlstransport over which the sender is exchanging the rtp and rtcp packets used to manage transmission of media and c...
...ansceiver may be sharing the same transport object. obsolete properties rtcptransport this property has been removed; the rtp and rtcp transports have been combined into a single transport. use the transport property instead. methods rtcrtpsender.getparameters() returns a rtcrtpparameters object describing the current configuration for the encoding and transmission of media on the
track. ...
...meters() returns a rtcrtpparameters object describing the current configuration for the encoding and transmission of media on the
track. rtcrtpsender.getstats() returns a promise which is fulfilled with a rtcstatsreport which provides statistics data for all outbound streams being sent using this rtcrtpsender. rtcrtpsender.setparameters() applies changes to parameters which configure how the
track is encoded and transmitted to the remote peer. rtcrtpsender.setstreams() sets the mediastream(s) associated with the
track being transmitted by this sender. rtcrtpsender.replace
track() attempts to replace the
track currently being sent by the rtcrtpsender with another
track, without performing renegotiation. this method can be used, for example, to toggle between the front- and rear-facing ca...
SourceBuffer - Web APIs
end controls the timestamp for the end of the append window. sourcebuffer.appendwindowstart controls the timestamp for the start of the append window. this is a timestamp range that can be used to filter what media data is appended to the sourcebuffer. coded media frames with timestamps within this range will be appended, whereas those outside the range will be filtered out. sourcebuffer.audio
tracks read only a list of the audio
tracks currently contained inside the sourcebuffer. sourcebuffer.buffered read only returns the time ranges that are currently buffered in the sourcebuffer. sourcebuffer.mode controls how the order of media segments in the sourcebuffer is handled, in terms of whether they can be appended in any order, or they have to be kept in a strict sequence. sourcebuffe...
... only a list of the audio
tracks currently contained inside the sourcebuffer. sourcebuffer.buffered read only returns the time ranges that are currently buffered in the sourcebuffer. sourcebuffer.mode controls how the order of media segments in the sourcebuffer is handled, in terms of whether they can be appended in any order, or they have to be kept in a strict sequence. sourcebuffer.text
tracks read only a list of the text
tracks currently contained inside the sourcebuffer. sourcebuffer.timestampoffset controls the offset applied to timestamps inside media segments that are subsequently appended to the sourcebuffer. ...
... the sourcebuffer is handled, in terms of whether they can be appended in any order, or they have to be kept in a strict sequence. sourcebuffer.text
tracks read only a list of the text
tracks currently contained inside the sourcebuffer. sourcebuffer.timestampoffset controls the offset applied to timestamps inside media segments that are subsequently appended to the sourcebuffer. sourcebuffer.
trackdefaults specifies the default values to use if kind, label, and/or language information is not available in the initialization segment of the media to be appended to the sourcebuffer. sourcebuffer.updating read only a boolean indicating whether the sourcebuffer is currently being updated — i.e. whether an sourcebuffer.appendbuffer(), sourcebuffer.appendstream(), or sourcebuffer.remove() ope...
...d, label, and/or language information is not available in the initialization segment of the media to be appended to the sourcebuffer. sourcebuffer.updating read only a boolean indicating whether the sourcebuffer is currently being updated — i.e. whether an sourcebuffer.appendbuffer(), sourcebuffer.appendstream(), or sourcebuffer.remove() operation is currently in progress. sourcebuffer.video
tracks read only a list of the video
tracks currently contained inside the sourcebuffer. event handlers sourcebuffer.onabort fired whenever sourcebuffer.appendbuffer() or sourcebuffer.appendstream() is ended by a call to sourcebuffer.abort(). sourcebuffer.updating changes from true to false. sourcebuffer.onerror fired whenever an error occurs during sourcebuffer.appendbuffer() or sourcebuffer...
XRInputSource.targetRaySpace - Web APIs
these values, interpreted in the context of the input source's targetraymode, can be used both to fully interpret the device as an input source. ...
...e: every gaze input (targetraymode value of gaze), shares the same xrspace object as their target ray space, since the gaze input comes from the viewer's head. this shared space represents the same location as the space returned by the xrsession method requestreferencespace(), but is maintained as a different object to allow for future enhancements to the api. the target ray space reported by
tracked pointer inputs (targetraymode of
tracked-pointer) is actually based upon the true spatial position and orientation of the input device. to determine the position and orientation of the target ray while rendering a frame, pass it into the xrframe method getpose() method, then use the returned xrpose object's transform to gather the spatial information you need. example this fragment of code ...
...rpose object's transform to gather the spatial information you need. example this fragment of code shows part of a function to be called once every frame. it looks for inputs which have a non-null targetrayspace. inputs which have a value for this property represent inputs that project a target ray outward from the user. for each such input, this example looks for inputs whose targetraymode is
tracked-pointer, indicating that the input is in fact intended to represent a targeting device rather than a gazing device, screen tap, or mouse click. for
tracked pointers, a function myrendertargetrayasbeam() is called to render a beam from the input controller's virtual position outward in the direction it's pointing. the code should continue to perform tasks such as drawing controllers or any obje...
...s such as drawing controllers or any objects representative of the user's hands' positions in the virtual space, as well as any other input-related tasks. function updateinputsources(session, frame, refspace) { for (let source of session.getinputsources()) { let targetraypose = frame.getpose(inputsource.targetrayspace, refspace); if (targetraypose) { if (source.targetraymode == "
tracked-pointer") { myrendertargetrayasbeam(targetraypose); } } /* ... */ } } see the article inputs and input sources for more details and a more complete example. specifications specification status comment webxr device apithe definition of 'xrinputsource.targetrayspace' in that specification. working draft initial definition. ...
XRPermissionDescriptor.optionalFeatures - Web APIs
table below, with brief information about their use cases and which interface is used to implement them. xrreferencespacetype description interface bounded-floor similar to the local type, except the user is not expected to move outside a predetermined boundary, given by the boundsgeometry in the returned object. ...
...de a predetermined boundary, given by the boundsgeometry in the returned object. xrboundedreferencespace local a
tracking space whose native origin is located near the viewer's position at the time the session was created. the exact position depends on the underlying platform and implementation. the user isn't expected to move much if at all beyond their starting position, and
tracking is optimized for this use case. for devices with six degrees of freedom (6dof)
tracking, the local reference space tries to keep the origin stable relative to the environment. xrreferencespace local-floor similar to the local type, except the starting position is placed in a safe location for the viewer to stand, where the value of the y axis is 0 at floor level. if tha...
...e starting position is placed in a safe location for the viewer to stand, where the value of the y axis is 0 at floor level. if that floor level isn't known, the user agent will estimate the floor level. if the estimated floor level is non-zero, the browser is expected to round it such a way as to avoid fingerprinting (likely to the nearest centimeter). ...
...isn't known, the user agent will estimate the floor level. if the estimated floor level is non-zero, the browser is expected to round it such a way as to avoid fingerprinting (likely to the nearest centimeter). xrreferencespace unbounded a
tracking space which allows the user total freedom of movement, possibly over extremely long distances from their origin point. the viewer isn't
tracked at all;
tracking is optimized for stability around the user's current position, so the native origin may drift as needed to accommodate that need. xrreferencespace viewer a
tracking space whose native origin
tracks the viewer's position and orientation. this is used for environments in which the user can physically move around, and is supported by all instances of xrsession, both...
XRPermissionDescriptor.requiredFeatures - Web APIs
table below, with brief information about their use cases and which interface is used to implement them. xrreferencespacetype description interface bounded-floor similar to the local type, except the user is not expected to move outside a predetermined boundary, given by the boundsgeometry in the returned object. ...
...de a predetermined boundary, given by the boundsgeometry in the returned object. xrboundedreferencespace local a
tracking space whose native origin is located near the viewer's position at the time the session was created. the exact position depends on the underlying platform and implementation. the user isn't expected to move much if at all beyond their starting position, and
tracking is optimized for this use case. for devices with six degrees of freedom (6dof)
tracking, the local reference space tries to keep the origin stable relative to the environment. xrreferencespace local-floor similar to the local type, except the starting position is placed in a safe location for the viewer to stand, where the value of the y axis is 0 at floor level. if tha...
...e starting position is placed in a safe location for the viewer to stand, where the value of the y axis is 0 at floor level. if that floor level isn't known, the user agent will estimate the floor level. if the estimated floor level is non-zero, the browser is expected to round it such a way as to avoid fingerprinting (likely to the nearest centimeter). ...
...isn't known, the user agent will estimate the floor level. if the estimated floor level is non-zero, the browser is expected to round it such a way as to avoid fingerprinting (likely to the nearest centimeter). xrreferencespace unbounded a
tracking space which allows the user total freedom of movement, possibly over extremely long distances from their origin point. the viewer isn't
tracked at all;
tracking is optimized for stability around the user's current position, so the native origin may drift as needed to accommodate that need. xrreferencespace viewer a
tracking space whose native origin
tracks the viewer's position and orientation. this is used for environments in which the user can physically move around, and is supported by all instances of xrsession, both...
XRPermissionStatus.granted - Web APIs
table below, with brief information about their use cases and which interface is used to implement them. xrreferencespacetype description interface bounded-floor similar to the local type, except the user is not expected to move outside a predetermined boundary, given by the boundsgeometry in the returned object. ...
...de a predetermined boundary, given by the boundsgeometry in the returned object. xrboundedreferencespace local a
tracking space whose native origin is located near the viewer's position at the time the session was created. the exact position depends on the underlying platform and implementation. the user isn't expected to move much if at all beyond their starting position, and
tracking is optimized for this use case. for devices with six degrees of freedom (6dof)
tracking, the local reference space tries to keep the origin stable relative to the environment. xrreferencespace local-floor similar to the local type, except the starting position is placed in a safe location for the viewer to stand, where the value of the y axis is 0 at floor level. if tha...
...e starting position is placed in a safe location for the viewer to stand, where the value of the y axis is 0 at floor level. if that floor level isn't known, the user agent will estimate the floor level. if the estimated floor level is non-zero, the browser is expected to round it such a way as to avoid fingerprinting (likely to the nearest centimeter). ...
...isn't known, the user agent will estimate the floor level. if the estimated floor level is non-zero, the browser is expected to round it such a way as to avoid fingerprinting (likely to the nearest centimeter). xrreferencespace unbounded a
tracking space which allows the user total freedom of movement, possibly over extremely long distances from their origin point. the viewer isn't
tracked at all;
tracking is optimized for stability around the user's current position, so the native origin may drift as needed to accommodate that need. xrreferencespace viewer a
tracking space whose native origin
tracks the viewer's position and orientation. this is used for environments in which the user can physically move around, and is supported by all instances of xrsession, both...
XRReferenceSpaceType - Web APIs
table below, with brief information about their use cases and which interface is used to implement them. xrreferencespacetype description interface bounded-floor similar to the local type, except the user is not expected to move outside a predetermined boundary, given by the boundsgeometry in the returned object. ...
...de a predetermined boundary, given by the boundsgeometry in the returned object. xrboundedreferencespace local a
tracking space whose native origin is located near the viewer's position at the time the session was created. the exact position depends on the underlying platform and implementation. the user isn't expected to move much if at all beyond their starting position, and
tracking is optimized for this use case. for devices with six degrees of freedom (6dof)
tracking, the local reference space tries to keep the origin stable relative to the environment. xrreferencespace local-floor similar to the local type, except the starting position is placed in a safe location for the viewer to stand, where the value of the y axis is 0 at floor level. if tha...
...e starting position is placed in a safe location for the viewer to stand, where the value of the y axis is 0 at floor level. if that floor level isn't known, the user agent will estimate the floor level. if the estimated floor level is non-zero, the browser is expected to round it such a way as to avoid fingerprinting (likely to the nearest centimeter). ...
...isn't known, the user agent will estimate the floor level. if the estimated floor level is non-zero, the browser is expected to round it such a way as to avoid fingerprinting (likely to the nearest centimeter). xrreferencespace unbounded a
tracking space which allows the user total freedom of movement, possibly over extremely long distances from their origin point. the viewer isn't
tracked at all;
tracking is optimized for stability around the user's current position, so the native origin may drift as needed to accommodate that need. xrreferencespace viewer a
tracking space whose native origin
tracks the viewer's position and orientation. this is used for environments in which the user can physically move around, and is supported by all instances of xrsession, both...
XRSession.requestReferenceSpace() - Web APIs
table below, with brief information about their use cases and which interface is used to implement them. xrreferencespacetype description interface bounded-floor similar to the local type, except the user is not expected to move outside a predetermined boundary, given by the boundsgeometry in the returned object. ...
...de a predetermined boundary, given by the boundsgeometry in the returned object. xrboundedreferencespace local a
tracking space whose native origin is located near the viewer's position at the time the session was created. the exact position depends on the underlying platform and implementation. the user isn't expected to move much if at all beyond their starting position, and
tracking is optimized for this use case. for devices with six degrees of freedom (6dof)
tracking, the local reference space tries to keep the origin stable relative to the environment. xrreferencespace local-floor similar to the local type, except the starting position is placed in a safe location for the viewer to stand, where the value of the y axis is 0 at floor level. if tha...
...e starting position is placed in a safe location for the viewer to stand, where the value of the y axis is 0 at floor level. if that floor level isn't known, the user agent will estimate the floor level. if the estimated floor level is non-zero, the browser is expected to round it such a way as to avoid fingerprinting (likely to the nearest centimeter). ...
...isn't known, the user agent will estimate the floor level. if the estimated floor level is non-zero, the browser is expected to round it such a way as to avoid fingerprinting (likely to the nearest centimeter). xrreferencespace unbounded a
tracking space which allows the user total freedom of movement, possibly over extremely long distances from their origin point. the viewer isn't
tracked at all;
tracking is optimized for stability around the user's current position, so the native origin may drift as needed to accommodate that need. xrreferencespace viewer a
tracking space whose native origin
tracks the viewer's position and orientation. this is used for environments in which the user can physically move around, and is supported by all instances of xrsession, both...
XRSession: select event - Web APIs
the webxr event select is sent to an xrsession when one of the session's input sources has completed a primary action. examples of comon kinds of primary action are users pressing triggers or buttons, tapping a touchpad, speaking a command, or performing a recognizable gesture when using a video
tracking system or handheld controller with an accelerometer. bubbles yes cancelable no interface xrinputsourceevent event handler property onselect for details on how the selectstart, select, and selectend events work, and how you should react to them, see primary actions in inputs and input sources. examples the following example uses addeventlistener() to set up a handler for the select event. the handler fetches the pose representing the t...
... interface xrinputsourceevent event handler property onselect for details on how the selectstart, select, and selectend events work, and how you should react to them, see primary actions in inputs and input sources. examples the following example uses addeventlistener() to set up a handler for the select event. ...
...see primary actions in inputs and input sources. examples the following example uses addeventlistener() to set up a handler for the select event. the handler fetches the pose representing the target ray for
tracked-pointer inputs and sends the pose's transform to a function called myhandleselectwithray(). ...
... working draft initia...
XRSession: squeeze event - Web APIs
the webxr event squeeze is sent to an xrsession when one of the session's input sources has completed a primary squeeze action. examples of comon kinds of primary action are users pressing triggers or buttons, tapping a touchpad, speaking a command, or performing a recognizable gesture when using a video
tracking system or handheld controller with an accelerometer. bubbles yes cancelable no interface xrinputsourceevent event handler property onsqueeze for details on how the squeezestart, squeeze, and squeezeend events work, and how you should react to them, see primary squeeze actions in inputs and input sources. examples the following example uses addeventlistener() to set up a handler for the squeeze event. the handler fetches the p...
... xrinputsourceevent event handler property onsqueeze for details on how the squeezestart, squeeze, and squeezeend events work, and how you should react to them, see primary squeeze actions in inputs and input sources. examples the following example uses addeventlistener() to set up a handler for the squeeze event. the handler fetches the pose representing the target ray for
tracked-pointer inputs and sends the pose's transform to a function called myhandlesqueezewithray(). this code treats the squeeze as an instantaneous action that doesn't involve
tracking an ongoing activity. if you need to
track a squeeze action that isn't instantaneous, listen for the squeezestart and squeezeend events to sense when the squeeze action begins and ends. xrsession.addeventlistener("squ...
...on called myhandlesqueezewithray(). this code treats the squeeze as an instantaneous action that doesn't involve
tracking an ongoing activity. if you need to
track a squeeze action that isn't instantaneous, listen for the squeezestart and squeezeend events to sense when the squeeze action begins and ends. ...
... working draft init...
XRSessionInit - Web APIs
ired to obtain explicit or implicit user consent. inline sessions all inline webxr sessions support the viewer reference space. security requirements each reference space or feature type has minimum safety requirements. ...
...e webxr sessions support the viewer reference space. security requirements each reference space or feature type has minimum safety requirements. ...
...requirements each reference space or feature type has minimum safety requirements. ...
...m safety requirements. ...
ARIA Test Cases - Accessibility
- zoom (leopard) pass n/a pass pass zoomtext - - - - orca - - - - menu button dojo nightly build expected at behavior: screen readers should indicate that this button has an associated menu. screen magnifiers should give indication (if this is not done visually anyway). when the button is pressed, the menu should be
tracked like any other menu. when closing the menu, this should be indicated, and focus should be repeated for the menu button the menu was opened from, or the new focus location if the activated menu item results in that. markup used: notes: results: at firefox ie opera safari jaws 9 - - n/a n/a jaws 10 pass in non-v-pc-mode. buttons are indi...
...sing the menu, this should be indicated, and focus should be repeated for the menu button the menu was opened from, or the new focus location if the activated menu item results in that. markup used: notes: results: at firefox ie opera safari jaws 9 - - n/a n/a jaws 10 pass in non-v-pc-mode. buttons are indicated as menu buttons. menus are
tracked, closing menus also results in correct focus
tracking. partial fail in v-pc-mode. the fact that a button is a menu button is not indicated with the virtual cursor. menus and focus are properly
tracked upon activation. - - - voiceover (leopard) n/a n/a - fail window-eyes - - - - nvda - n/a - - zoom (leopard) pass...
...w when something has been marked for drag & drop. target nodes where the item can be dropped should be indicated from now on when they receive focus or arrowing onto them with the virtual cursor. after drag and drop operation has completed, the new location of the item should be indicated in the virtual buffer representation. if the drag and drop operation caused a menu to open, focus should be
tracked in that menu, and the user should be able to complete further interaction via the keyboard as usual. optional but desired: at should provide simple method to navigate only among the current drop targets. markup used: aria-grab aria-dropeffect notes: (mz) there is no equivalent place in any of the known operating systems where draggable items are denoted and targets being indicated a...
...he screen reader should read the current menuitem. (al) to read a menu item, the screen reader should announce the name. if it is a radio or checkbox menu item, the screen reader should indicate that it's checkable. if it has a submenu (aria-haspopup), the screen reader should indicate that as well. (mz) if a menu is dropped down, the activation of the new menu should be indicated and the focus
tracked as it moves through the items. (mz) when the menu is closed, screen reader should indicate this along with the newly focused item. (mz) this may be the menu bar or higher level menu item, or a control that gains focus after the menu was closed after executing a command. (mz) if the menu caused a dialog to open, the dialog context should be given, just as with regular desktop applications. ...
Mouse gesture events - Developer guides
note: these gesture events are available to add-ons and other browser chrome code, but are never sent to regular web page content. ...
... note: these gesture events are available to add-ons and other browser chrome code, but are never sent to regular web page content. note: some operating systems, including mac os x and windows 7, provide default actions when gesture events occur. ...
...ge content. note: some operating systems, including mac os x and windows 7, provide default actions when gesture events occur. if you handle a gesture event and wish to prevent the default action from taking place as well, be sure to call the event's preventdefault() method. types of gesture events mozswipegesture the mozswipegesture event is sent when the user uses three fingers to "swipe" the
trackpad. mozmagnifygesturestart the mozmagnifygesturestart event is sent when the user begins performing a "pinch" gesture, by using two fingers as the corners of a rectangle and moving them either closer together or farther apart. this is typically used to zoom in and out on content (this is the default behavior in firefox, for example). mozmagnifygestureupdate the mozmagnifygestureupdate event is se...
... to provide feedback during the handling of the gesture, you should also watch the mozmagnifygesturestart and mozmagnifygestureupdate events. the delta value is the cumulative change over the course of handling the entire sequence of magnify gesture events. mozrotategesturestart the mozrotategesturestart event is sent when the user begins performing a rotate gesture, by placing two fingers on the
trackpad and rotating them around the center of the
trackpad. firefox uses this gesture to move backward and forward through the tabs in the current window. mozrotategestureupdate the mozrotategestureupdate event is sent periodically while processing a rotate gesture, to provide updated status information. the event's delta value represents the amount by which the gesture has moved since the mozrotateg...
Web audio codec guide - Web media technologies
factors affecting the encoded audio there are two general categories of factors that affect the encoded audio which is output by an audio codec's encoder: details about the source audio's format and contents, and the codec and its configuration during the encoding process. for each factor...
...f any special features you may need the codec to support. usually the latency is not particularly important when streaming music. possible exceptions include looped music, where you need music to be able to play back uninterrupted over and over, or when you need to be able to play songs back to back with no gap between them. this can be particularly important for classical music, theatrical sound
tracks, and for background music during gameplay. for general music playback, the three most likely candidates are mp3, aac, and vorbis. aac in an mp4 container is supported by all major browsers, which makes this a great choice. vorbis is almost always used in ogg files, but ogg containers are not universally supported. even microsoft edge, which supports both vorbis, does not yet support ogg con...
... in an mp4 container is supported by all major browsers, which makes this a great choice. vorbis is almost always used in ogg files, but ogg containers are not universally supported. even microsoft edge, which supports both vorbis, does not yet support ogg containers. mp3 (mpeg-1 audio layer iii) is supported by all major browsers. these files are mpeg-1 files that contain an audio layer iii
track. if you need to minimize latency during music playback, you should strongly consider opus, which has the lowest range of latencies of the general-purpose codecs (5 ms to 66.5 ms, compared to at least 100 ms for the others). note: compatibility information described here is generally correct as of the time this article was written; however, there may be caveats and exceptions. be sure to ref...
...n in the frequency bands outside the vocal range captured will be entirely lost. this makes these codecs completely unsuitable for anything but spoken words. even audio that contains only voices, but singing rather than simply speaking, will likely not be of acceptable quality in one of these formats. voice recording and playback usually needs to be low-latency in order to synchronize with video
tracks, or in order to avoid cross-talk or other problems. fortunately, the characteristics that lead to speech codecs being so efficient storage space-wise also make them tend to be very low latency. if you're working with webrtc, g.722, for example, has 4 ms latency (compared with over 100 ms for mp3), and amr's latency is around 25 ms. note: for more about webrtc and the codecs it can use, see cod...
JavaScript Debugger Service - Archive of obsolete content
ince gecko 33 (firefox 33 / thunderbird 33 / seamonkey 2.30) this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. in firefox versions prior to gecko 33 (firefox 33 / thunderbird 33 / seamonkey 2.30), the javascript debugger service (or simply jsd) used to be an xpcom component that allows the
tracking of javascript while it was being executed in the browser. however, jsd has been removed in favor of the debugger api. see the
tracking bug bug 800200 for more details. snippets acquiring the service we acquire the service by calling the xpcom object. var jsd = components.classes["@mozilla.org/js/jsd/debugger-service;1"] .getservice(components.interfaces.jsdidebuggerservice); js...
...note that the jsdifilter only applies to jsdiexecutionhooks, which are breakpointhook, debughook, debuggerhook, interrupthook and throwhook. note that filters are matched in a first in, first compared fashion. the first filter to match determines whether or not the hook is called. we create a generic createfilter function that acts as a jsdifilter factory...
...lter = components.interfaces.jsdifilter; var filter = { globalobject: null, flags: pass ? (jsdifilter.flag_enabled | jsdifilter.flag_pass) : jsdifilter.flag_enabled, urlpattern: pattern, startline: 0, endline: 0 }; return filter; }, we then add the filters we want. ...
Intercepting Page Loads - Archive of obsolete content
bout these notifications and links to other useful documentation. webprogresslisteners when used in the chrome, this is a more sophisticated way of intercepting and modifying the various stages in page loads. but of course, there's always a price to pay: web progress listeners in the chrome are attached to specific instances of the browser element. ...
... this is a more sophisticated way of intercepting and modifying the various stages in page loads. but of course, there's always a price to pay: web progress listeners in the chrome are attached to specific instances of the browser element. what does this mean? it means you have to keep
track of tabs being opened and closed, in order to add and remove your listener. ...
...ype)); }, _toggleprogresslistener : function(awebprogress, aisadd) { if (aisadd) { awebprogress.addprogresslistener(this, awebprogress.notify_all); } else { awebprogress.removeprogresslistener(this); } } this shouldn't be too hard to follow. we register and unregister the progress listeners for the first tab manually, and then add tab open and close event listeners so we can keep
track of the rest of the listeners for all the tabs. we're being careful about removing all listeners, as not doing it has the potential of causing memory leaks. there are a couple of things left to do: implementing the progress listener methods, and figuring out what notify_all is about. for that, we recommend that you first read the documentation on nsiwebprogresslistener and the nsiwebprogress.cons...
Search Extension Tutorial (Draft) - Archive of obsolete content
preference values will not persist across sessions, restartless extensions must nevertheless restore them for the balance of the session after they have been disabled. the following example bootstrap.js file illustrates the method: const { classes: cc, interfaces: ci, utils: cu, results: cr } = components; // import the services module. cu.import("resource://gre/modules/services.jsm"); // keep
track of whether this is the first run. var firstrun = false; // get the root user preference branch. var userprefs = services.prefs.getbranch(""); // get the root default preference branch. var defaultprefs = services.prefs.getdefaultbranch(""); // save the original values. var savedprefs = {} // change the default value of the preference *name* to *value*. // a default for this preference must exi...
...; // import the services module. cu.import("resource://gre/modules/services.jsm"); // the details of the engine to add const engine_details = { name: "example engine", iconurl: "data:image/png;base64,...", alias: "example-engine", description: "an example search engine", method: "get", // the http request method url: "https://www.example.com/?q=_searchterms_" }; // keep
track of whether this is the first run. var firstrun = false; // decide whether to select the search engine. var selectsearch = false; function startup(data, reason) { firstrun = reason == addon_install; // re-select the search engine if this is the first run // or we're being re-enabled. selectsearch = firstrun || reason == addon_enable; // only add the engine if it doesn't alrea...
...onents; // import the services module. cu.import("resource://gre/modules/services.jsm"); // these must be the same details as in your search.xml file. const engine_details = { name: "example engine", url: "https://www.example.com/search?q=_searchterms_&source=search-box" }; // get the engine url based on our url. const engine_url = "chrome://example-engine/content/search.xml"; // keep
track of whether this is the first run. var firstrun = false; // decide whether to select the search engine. var selectsearch = false; function removeobserver() { try { services.obs.removeobserver(searchobserver, engine_added); } // if we've already removed this observer, ignore the error. catch (e) {} } // observer called after our engine has been successfully added function ...
In-Depth - Archive of obsolete content
the ui of mozilla. all of the properties follow the w3c's standards for vendor extensions, which is why they all begin with -moz. this is only a list of properties which may be useful to you; it is in no way all of the mozilla specific properties available. other sites which list mozilla specific css properties xulplanet.com [dead link, 26.03.13] mozilla-prefixed properties on the standard
track 26.03.13 -moz-appearance makes a widget look like it's from your operating system. possible are (this is probably an incomplete list): none - (!important may be needed) will override the operating system default. use this when you want one or two controls to look different from the operating systems defaults. button, checkbox-container, checkbox, dialog, dualbutton, dualbutton-dropdown, listbox,...
...each colour is one pixel in the border. if you want the border to be 3 pixels wide you define each colour separat...
...each colour is one pixel in the border. if you want the border to be 3 pixels wide you define each colour separated by a space. example: -mo...
Tree View Details - Archive of obsolete content
ill describe some more features of tree views. creating a hierarchical custom view in the last section, we created a simple tree view that implemented only a minimum amount of functionality. next, let's look at some additional functions that views may implement. here, we will examine how to create a hierarchical set of items using the view. this is a fairly tricky process as it involves keeping
track of which items have children and also which rows are open and closed. nesting level every row in the tree has a nesting level. the topmost rows are at level 0, the children of those rows are at level 1, their children at level 2 and so on. the tree will query the view for each row by calling its getlevel method to find out the level of that row. the view will need to return 0 for the outermost ...
...ntaineropen that are used to handle a parent item in the tree. the iscontainer method should return true if a row is a container and might contain children. the iscontainerempty method should return true if a row is an empty container, for instance, a directory with no files in it. the iscontaineropen method is used to determine which items are opened and closed. the view is required to keep
track of this. the tree will call this method to determine which containers are open and which are closed. note that the tree will call neither iscontainerempty nor iscontaineropen for rows that are not containers as indicated by the return value of the iscontainer method. a container may be rendered differently than a non-container. for instance, a container may have a folder icon beside it. a styl...
...entbyid("elementlist").view = treeview; } the custom tree view will need to implement a number of methods, of which the important ones will be examined individually. first we'll define two structures to hold the data for the tree, the first will hold a map between parents and the children they contain, and the second will hold an array of the visible items. remember that a custom view must keep
track of which items are visible itself. var treeview = { childdata : { solids: ["silver", "gold", "lead"], liquids: ["mercury"], gases: ["helium", "nitrogen"] }, visibledata : [ ["solids", true, false], ["liquids", true, false], ["gases", true, false] ], }; the childdata structure holds an array of the children for each of the three parent nodes. the visibledata arra...
Gutters - MDN Web Docs Glossary: Definitions of Web-related terms
gutters or alleys are spacing between content
tracks. these can be created in css grid layout using the grid-column-gap, grid-row-gap, or grid-gap properties. in the example below we have a three-column and two-row
track grid, with 20-pixel gaps between column
tracks and 20px-gaps between row
tracks. * {box-sizing: border-box;} .wrapper { border: 2px solid #f76707; border-radius: 5px; background-color: #fff4e6; } .wrapper > div { border: 2px solid #ffa94d; border-radius: 5px; background-color: #fff8f8; padding: 1em; color: #d9480f; } .wrapper { display: grid; grid-template-columns: repeat(3,1.2fr); grid-auto-rows: 45%; grid-column-gap: 20px; grid-row-gap: 20px; } <div class="wrapper"> <div>one</div> <div>two</div> <div>three<...
...margins, padding or the use of the space distribution properties in box alignment can all contribute to the visible gap – ther...
...wo</div> <div>three</div> <div>four</div> <div>five</div> </div> in terms of grid sizing, gaps act as if they were a regular grid
track however nothing can be placed into the gap. the gap acts as if the grid line at that location has gained extra size, so any grid item placed after that line begins at the end of the gap. the grid-gap properties are not the only thing that can cause
tracks to space out. margins, padding or the use of the space distribution properties in box alignment can all contribute to the visible gap – therefore the grid-gap properties should not be seen as equal to “the gutter size” unless you know that your design has not introduced any additional space with one of these methods. learn more property reference grid-column-gap grid-row-gap grid-ga...
Graceful asynchronous programming with Promises - Learn web development
getusermedia() returns a promise which is resolved with the mediastream once it's available. the code that the video chat application would use might look something like this: function handlecallbutton(evt) { setstatusmessage("calling..."); navigator.mediadevices.getusermedia({video: true, audio: true}) .then(chatstream => { selfviewelem.srcobject = chatstream; chatstream.get
tracks().foreach(
track => mypeerconnection.add
track(
track, chatstream)); setstatusmessage("connected"); }).catch(err => { setstatusmessage("failed to connect"); }); } this function starts by using a function called setstatusmessage() to update a status display with the message "calling...", indicating that a call is being attempted. it then calls getusermedia(), asking for a strea...
...after that, the status display is updated to say "connected". if getusermedia() fails, the catch block runs. ...
...after that, the status display is updated to say "connected". ...
Framework main features - Learn web development
apter — a robust state-handling mechanism is key to an effective framework, and each component may have data to control the state of. this stage will persist in some way as long as the component is in use. like props, state can be used to affect how a component is rendered. as an example, consider a button that counts how many times it has been clicked. this component should be responsible for
tracking its own count state, and could be written like this: function counterbutton() { const [count] = usestate(0); return ( <button>clicked {count} times</button> ); } usestate() is a react hook which, given an initial data value, will keep
track of that value as it is updated. the code will be initially rendered like so in the browser: <button>clicked 0 times</button> the usestate() c...
...n count state, and could be written like this: function counterbutton() { const [count] = usestate(0); return ( <button>clicked {count} times</button> ); } usestate() is a react hook which, given an initial data value, will keep
track of that value as it is updated. the code will be initially rendered like so in the browser: <button>clicked 0 times</button> the usestate() call keeps
track of the count value in a robust way across the app, without you needing to write code to do that yourself. events in order to be interactive, components need ways to respond to browser events, so our applications can respond to our users. frameworks each provide their own syntax for listening to browser events, which reference the names of the equivalent native browser events. in react, listeni...
...every time the browser needs to render something new, whether that new information is an addition to what's in the browser, a deletion, or an edit of what’s there. this diagram of a react component's lifecycle offers a general overview of the concept. rendering elements just as with lifecycles, frameworks take different-but-similar approaches to how they render your applications. all of them
track the current rendered version of your browser's dom, and each makes slightly different decisions about how the dom should change as components in your application re-render. because frameworks make these decisions for you, you typically don't interact with the dom yourself. this abstraction away from the dom is more complex and more memory-intensive than updating the dom yourself, but without it, ...
Componentizing our Svelte app - Learn web development
ng the todo via the prop, but it's not sending any information back to its parent. we'll fix this later on. sharing data between components: props-down, events-up pattern the bind directive is pretty straightforward and allows you to share data between a parent and child component with minimal fuss. however, when your application grows larger and more complex it can easily get difficult to keep
track of all your bound values. a different approach is the "props-down, events-up" communication pattern. basically, this pattern relies on child components receiving data from their parents via props and parent components updating their state by handling events emitted from child components. so props flow down from parent to child and events bubble up from child to parent. this pattern establishes a...
...nt can get notified of any modified todo. updating todos we still have to implement functionality to allow us to edit existing todos. we'll have to include an editing mode in the todo component. when entering editing mode we'll show an <input> field to allow us to edit the current todo name, with two buttons to confirm or cancel our changes. ...
...nput> field to allow us to edit the current todo name, with two buttons to confirm or cancel our changes. handling the events we'll need one variable to
track whether we are in editing mode and another to store the name of the task being updated. add the following variable definitions at the bottom of the <script> section of the todo component: let editing = false //
track editing mode let name = todo.name // hold the name of the todo being edited we have to decide what events our todo component will emit: we could emit different events for the status toggle and editing of the name. (e.g. updatetodostatus and updatetodoname). or we could take a more generic approach and emit a single update event for both operations. we will...
Experimental features in Firefox
device on an htmlmediaelement, thereby changing where the audio is being output. see bug 934425 for more details. release channel version added enabled by default? nightly 64 no developer edition 64 no beta 64 no release 64 no preference name media.setsinkid.enabled htmlmediaelement properties: audio
tracks and video
tracks enabling this feature adds the htmlmediaelement.audio
tracks and htmlmediaelement.video
tracks properties to all html media elements. however, because firefox doesn't currently suport multiple audio and video
tracks, the most common use cases for these properties don't work, so they're both disabled by default. see bug 1057233 for more details. release channel version...
...the spec for this api is still being written. ...
...om.payments.request.supportedregions visual viewport api the visual viewport api provides access to information describing the position of the visual viewport relative to the document as well as to the window's content area. it also supports events to monitor changes to this information. see bug 1550390 for more details. there currently is no real plan to ship this on desktop, but you can
track the state of that just in case it changes in bug 1551302. release channel version added enabled by default? nightly 63 no developer edition 63 no beta 63 no release 63 starting in firefox 68, on android only preference name dom.visualviewport.enabled constructable stylesheets the addition of a cons...
Index
as performant as possible—not just on its own, but in terms of its impact on other parts of firefox. always keep in mind the side effects your changes may have, from blocking other tasks to interfering with other user interface elements. 169 privacy privacy, security this document lists privacy-related documentation. ...
...own, but in terms of its impact on other parts of firefox. always keep in mind the side effects your changes may have, from blocking other tasks to interfering with other user interface elements. 169 privacy privacy, security this document lists privacy-related documentation. 170 storage access policy: block cookies from
trackers privacy, storage access policy,
tracking protection firefox includes a new storage access policy that blocks cookies and other site data from third-party
tracking resources. this new policy is designed as an alternative to the current policies, which have been available in firefox for many years. the new policy protects against cross-site
tracking while minimizing the site breakage associated with traditional cookie blocking. t...
...and other site data from third-party
tracking resources. this new policy is designed as an alternative to the current policies, which have been available in firefox for many years. the new policy protects against cross-site
tracking while minimizing the site breakage associated with traditional cookie blocking. this article explains how the new policy works and how you can test it. 171
tracking protection privacy, private browsing, blocking,
tracking starting in version 42, firefox desktop and firefox for android include built-in
tracking protection. in private browsing windows (tabs, in firefox for android), firefox will block content loaded from domains that
track users across sites. 172 security best practices for firefox front-end engineers best practices...
mozbrowsersecuritychange
do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. the mozbrowsersecuritychange event is fired when the browser <iframe> has connected to the server, and when the mixed content state changes. ...
...ible values are: broken: indicates an unknown security state. this may mean that the request is being loaded as part of a page in which some content was received over an insecure channel. secure: indicates that the data corresponding to the request was received over a secure channel. insecure: indicates that the data corresponding to the request was received over an insecure channel.
trackingstate a domstring representing the current loading state of
tracking content. possible values are: loaded_
tracking_content: indicates that the
tracking content has been loaded. blocked_
tracking_content: indicates that the
tracking content has been blocked from loading. mixedstate a domstring representing the current loading state of mixed active content. possible values are: lo...
...current loading state of mixed active content. possible values are: loaded_mixed_active_content: indicates that the mixed active content has been loaded. blocked_mixed_active_content: indicates that the mixed active content has been blocked from loading. extendedvalidation a boolean indicating if the current ssl certificate is an extended validation certificate (true) or not (false).
trackingcontent a boolean indicating if
tracking content is present on the current page (true) or not (false). mixedcontent a boolean indicating if mixed content is present on the current page (true) or not (false). example var browser = document.queryselector("iframe"); browser.addeventlistener("mozbrowsersecuritychange", function( event ) { console.log("the ssl state is:" + event.details.sta...
Application Translation with Mercurial
and text editor for editing individual files a text editor can be a better choice than a file comparion program, e.g. because the file is new and everything has to be translated, the file is too customized to compare it to the english one, or special functionality is required (e.g. bookmarking untranslated lines). use a text editor you are comfortable with. this example uses notepad++. progress
tracking tool to
track which strings and files already have been translated and later also to see which new strings have already been tested in the product as being a good translation for the functionality behind the translated strings and that the translated texts fit into the available, the translation progress should be
tracked. this can be done in a text editor or word processor or any other tool ...
... file aboutprivatebrowsing.dtd. tips for finding files with usually easily translateable texts: look for files in browser/chrome/browser/ look for a file with only a few changes suggestions files starting with about... files in the preferences directory (browser/chrome/browser/preferences/) the browser.dtd and browser.properties files if there aren't too many new strings.
tracking the translation progress if you translate more than a few strings, you usually want to keep
track of what has already been translated (and later if the text has been tested in the product as fitting into the available area and suiting the functionality it describes). this guide achieves this with the firefox extension scrapbook. you installed scrapbook earlier, now open it in firefox eithe...
... browser folder. in this example, the absolute file path is c:\mozilla\de-mozilla-aurora\browser. save this comparison as project so you can easily relaunch this comparision without selecting the directories again. a good name is e.g. translation-mozilla-aurora-browser.winmerge open the comparison you just saved. the translation bring the console with mercurial to the front. start
tracking changes you make against the localization repository by telling it that with the qnew subcommand to save these changes as patch in a mercurial queue. this patch needs a name, choose something meaning full like "firefox-<version number>-more-details". in this example, firefox-29-aboutprivatebrowsing will be used. hg qnew firefox-29-aboutprivatebrowsing switch back to winmerge and navigate...
What every Mozilla translator should know
discussion about localization take part here just as well as l10n-focused announcements. planning list also available as mozilla.dev.planning, .planning in short. the mozilla project discusses general planning and schedule questions here. ...
...lanning in short. the mozilla project discusses general planning and schedule questions here. discussions of interest to the general mozilla developer community are at least notified here. translate the mozilla web or mozilla.dev.l10n.web, we moved announcements and discussions about the translation of the mozilla web pages to this group. all these groups are pretty low traffic. ...
...-mozilla-1.9.1 firefox 3.5 and, on the former revision control system, cvs: cvs trunk (the default branch) -> firefox/thunderbird 3.0.x branch mozilla_1_8_branch -> firefox/thunderbird 2.0 branch mozilla cross-reference mozilla cross-reference is a web site mirroring the content of the hg server. here we can easily have a look into other languages translations. bugzilla, the bug-
tracking system you do need an account in bugzilla you should configure the account to watch the following addresses: firefoxl10n@hotmail.com calendar-l10n@mozilla.bugs (specific for calendar related bugs) this way you will receive mail for bugs affecting many or even all locales. when you create a bug, if you want the person in charge of the l10n to follow up your bug you should cc: l10n@mozi...
Investigating leaks using DMD heap scan mode
when combined with cycle collector logging, this can be used to investigate leaks of refcounted cycle collected objects, by figuring out what holds a strong reference to a leaked object. when should you use this? dmd heap scan mode is intended to be used to investigate leaks of cycle collected (cced) objects. dmd heap scan mode is a "tool of last resort" that should only be used when all other avenues have been tried and failed, except possibly ref count logging. it is particularly useful if you have no idea what is causing the leak. ...
...from this chart, you can see how many objects of a particular type were leaked through shutdown. this can come in handy during the manual analysis phase later, to get evidence to support your hunches. for instance, if you think that an nsfoo object might be holding your leaking object alive, you can use this to easily see if we leaked an nsfoo object. moz_cc_...
...ing like this: xpcom_mem_bloat_log=1 moz_cc_log_shutdown=1 moz_disable_content_sandbox=t moz_cc_log_directory=$logdir moz_cc_log_process=content moz_cc_log_thread=main moz_dmd_shutdown_log=$logdir moz_dmd_log_process=tab ./mach run --dmd --mode=scan breaking this down: xpcom_mem_bloat_log=1: this reports a list of the counts of every object created and destroyed and
tracked by the xpcom leak
tracking system. from this chart, you can see how many objects of a particular type were leaked through shutdown. this can come in handy during the manual analysis phase later, to get evidence to support your hunches. for instance, if you think that an nsfoo object might be holding your leaking object alive, you can use this to easily see if we leaked an nsfoo object. moz_cc_log_shutdown=1: this gener...
Shell global objects
he return value is an array of strings, with one element for each javascript invocation that occurred as a result of the given operation. each element is the name of the function invoked, or the string 'eval:filename' if the code was invoked by eval or something similar. drainjobqueue() take jobs from the shell's job queue in fifo order and run them until the queue is empty. setpromiserejection
trackercallback() sets the callback to be invoked whenever a promise rejection is unhandled or a previously-unhandled rejection becomes handled. functions available only in debug build disassemble([fun/code]) return the disassembly for the given function or code. all disassembly functions take these options as leading string arguments: -r disassemble recursively -l show line numbers ...
...nal hook, that we reinstate after the call to fun completes, might be asked for the source code of compilations that fun performed, and which, presumably, only hook knows how to find. wrapwithproto(obj) wrap an object into a noop wrapper with prototype semantics. note: this is not fuzzing safe because it can be used to construct deeply nested wrapper chains that cannot exist in the wild.
trackedopts(fun) returns an object describing the
tracked optimizations of fun, if any. if fun is not a scripted function or has not been compiled by ion, null is returned. dumpscopechain(obj) prints the scope chain of an interpreted function or a module. crash([message]) crashes the process with a moz_crash. setarmhwcapflags("flag1,flag2 flag3") on non-arm, no-op. on arm, set the hardware capab...
... for testing that savestack properly handles native frames. callfunctionwithasyncstack(function, stack, asynccause) call function, using the provided stack as the async stack responsible for the call, and propagate its return value or the exception it throws. the function is called with no arguments, and this is undefined. the specified asynccause is attached to the provided stack frame. enable
trackallocations() start capturing the js stack at every allocation. note that this sets an object metadata callback that will override any other object metadata callback that may be set. disable
trackallocations() stop capturing the js stack at every allocation. makefinalizeobserver() get a special object whose finalization increases the counter returned by the finalizecount function. finalizecou...
Web Replay
ese affect the process' behavior. to make it easier to ensure that the non-deterministic components do not have an effect on recorded behavior, certain code regions can be marked as disallowing events — while executing them no thread, lock, or atomic events should be recorded. this is done in code associated with the non-deterministic components, such as during gc or ion compilation, to help
track down behaviors that should go unrecorded. replaying a replaying content process behaves in the same way as a recording process, except for the following: the calls and mach messages which were intercepted during recording are also intercepted here. when a call/message is intercepted, the wrapped call/message is not performed, but rather the results of the call/message are read from the data...
...cutions which throw overrecursion js exceptions can't be reliably replayed; overrecursion happens at different times depending on how scripts are compiled, which can vary between recording and replaying. similarly, executions which run out of memory at some point can't be reliably replayed. executions which are stopped at some point by the slow script dialog can't be reliably replayed. keeping
track of the exact point where an interrupt occurred would require quite a bit of recording overhead, and it doesn't seem worth it to try to do this. the following executions are unlikely to be supported by the initial release, but should be able to be handled at some point in the future: on x64, asm.js code relies on mprotect to handle out of bounds heap accesses; mprotect works differently while...
...web content to introduce data races to the browser on the contents of those buffers, going against a fundamental assumption of the record/replay infrastructure. recording and replaying executions using these buffers will require new techniques like treating all accesses on the buffers as atomic (probably unacceptable overhead) or performing all accesses on the buffer on a single core and keeping
track of context switches. dom workers are not supported yet. for simplicity, debugger integration is currently only able to handle js code that runs on the main thread. webgl is not supported yet, as it uses a pretty different rendering path from normal web content. media elements are not supported yet, as many of these run third party multithreaded code which hasn't been tested with the infrastru...
nsIDocShell
ent has fired, but before the new document has been set up) read only. isoffscreenbrowser boolean if true, this docshell is not visible in the traditional sense, but is being actively rendered to the screen (such as by being painted to a canvas), and should be treated accordingly. layouthistorystate nsilayouthistorystate loadedtransindex long keeps
track of the previous shtransaction index and the current shtransaction index at the time that the doc shell begins to load. used for contentviewer eviction. read only. loadtype unsigned long load type for the document. valid states are defined in constants. note that nsidocshell may use other states internally so you should check for the specific state bit. marginheight lon...
...t by the parent when the parent is going away. obsolete since gecko 1.8 prescontext nsprescontext presentation context for the currently loaded document. this may be null. read only. native code only! presshell nsipresshell presentation shell for the currently loaded document. this may be null. read only. native code only! previoustransindex long keeps
track of the previous shtransaction index and the current shtransaction index at the time that the doc shell begins to load. used for contentviewer eviction. read only. printpreview nsiwebbrowserprint if the current content viewer is not initialized for print preview, it is replaced with one which is and to which an about:blank document is loaded. read only. restoringdocument ...
...us shtransaction index and the current shtransaction index at the time that the doc shell begins to load. used for contentviewer eviction. read only. printpreview nsiwebbrowserprint if the current content viewer is not initialized for print preview, it is replaced with one which is and to which an about:blank document is loaded. read only. restoringdocument boolean
track whether we're currently restoring a document presentation. read only. securityui nsisecurebrowserui the securebrowserui object for this docshell. this is set by browser or nswebbrowser for their root docshell. shouldsavelayoutstate boolean indicates whether the current page can be cached. read only. useerrorpages boolean attribute to access whether e...
Migrating from Firebug - Firefox Developer Tools
ine break when it recognizes an unfinished command like document. and you hit enter. you can also manually enter a line break by pressing shift + enter. response preview there is a preview tab when a network request logged to the console is expanded in firebug. the web console displays a preview within the response tab. it is currently missing the preview for html, xml and svg, though, which is
tracked in bug 1247392 and bug 1262796, but when you click on the url of the request you switch to the network monitor, which has a preview tab. inspector firebug has an html panel, which allows to edit html/xml/svg and the css related to it. within the devtools this functionality is served by the page inspector. edit html within the page inspector the tag attributes and the contents can be edited ...
...an be edited inline just like in firebug. beyond that it allows to edit the tag names inline. you can also edit the html directly. in firebug you do this by right-clicking a node and clicking edit html... in the context menu. in the devtools this option is also available via the context menu. there the option is called edit as html. only the live preview of changes is currently missing, which is
tracked in bug 1067318 and bug 815464. copy html and related information firebug's html panel allows to copy the inner and outer html of an element as well as the css and xpath to it via the context menu of an element. the page inspector provides the same functionality except copying xpaths. this is covered by bug 987877. edit css both tools allow to view and edit the css rules related to the eleme...
...k into the style side panel and choose edit element style... from the context menu. the devtools display an element {} rule for this purpose, which requires a single click into it to start editing the properties. auto-completion of css as in firebug, the rules view provides an auto-completion for the css property names and their values. a few property values are not auto-completed yet, which is
tracked in bug 1337918. copy & paste css firebug's style side panel as well as the devtools' rules side panel provide options within their context menus to copy the css rule or the style declarations. the devtools additionally provide an option to copy the selector of a rule and copy disabled property declarations as commented out. they are missing the option to copy the whole style declaration, thou...
Examine and edit CSS - Firefox Developer Tools
le: if you hover over a declaration, a checkbox appears next to it: you can use this to toggle the declaration on or off. filename and line number: on the right-hand side is a link to the rule. see link to css file. if the element has a display: grid declaration, then it gets a grid icon next to it, like this: . click that icon to display the grid overlaid on the page, including grid lines and
tracks. see examine grid layouts for more on this. to view user-agent styles (i.e., browser-default css rules), enable "inspector > show browser styles" under the developer tool settings panel. (note that this setting is independent of the "browser styles" checkbox in the computed view.) user-agent styles are displayed against a different background, and the link to the filename and line number conta...
...ts the rule view displays the following pseudo-elements, if they are applied to the selected element: ::after ::backdrop ::before ::first-letter ::first-line ::selection :-moz-color-swatch :-moz-number-spin-box :-moz-number-spin-down :-moz-number-spin-up :-moz-number-text :-moz-number-wrapper :-moz-placeholder :-moz-progress-bar :-moz-range-progress :-moz-range-thumb :-moz-range-
track :-moz-selection if the selected element has pseudo-elements applied to it, they are displayed before the selected element but hidden by a disclosure triangle: clicking the triangle displays them: viewing common pseudo-classes there's a button to the right of the filter box: click the button to see checkboxes that you can use to enable the :hover, :active and :focus, :focus-within and ...
...d page up/down keys (along with others) to increase/decrease numeric rules while editing: the up arrow increments values by 1 — for example, "1px" changes to "2px". shift + up/down increments or decrements values by 10. ctrl + up/down (on linux and windows) or alt + up/down (on mac) increments or decrements values by 0.1. shift + page up/page down increments or decrements values by 100.
track changes when you are editing the rules in the rules view, you can see the changes you have made in the changes pane. note: you can view changes made to the rules view only. if you edit the css using the style editor, the changes will not be shown in the changes pane. also remember, as noted above, that changes you make to the css rules are temporary and will be reset if you reload the page.
CSS Grid Inspector: Examine grid layouts - Firefox Developer Tools
the html pane in the html pane, elements laid out using a grid have a "grid" marker beside them. in the css pane in the css pane's rules view, any instance of a display: grid declaration gets a grid icon included within it: . clicking the icon toggles the display of a grid overlay on the page, which appears over the element, laid out like a grid to show the position of its grid lines and
tracks: the overlay is still shown when you select other elements, so you can edit related css properties and see how the grid is affected. the layout view grid section when grids are included on a page, the css pane's layout view includes a "grid" section containing a number of options for viewing those grids. you can find out more about those in the section below. note: the layout view can be ...
...ent on the page, along with various options. allows overlay views to be toggled on and off. grid display settings: display line numbers: turn the line numbers shown for each grid overlay on and off (on by default). display area names: turn area names on and off, in the case of grids with named grid areas (on by default, where relevant). extend lines infinitely: by default, grid lines/
tracks are only shown inside the element with display: grid set on it; when toggling this option on, the grid lines extend to the edge of the viewport along each axis. mini grid view: a smaller view of the currently overlaid grid. note: your grid preferences such as overlay color and display settings choices are persisted across page loads for each separate page. let's examine these features...
... its lines are translucent. display line numbers by default, the line numbers are displayed on the grid overlay. unchecking the "display line numbers" box turns them off. display area names in a grid with named areas, the area names are shown on the grid overlay by default. unchecking the "display area names" box turns them off. extend lines infinitely by default, the grid lines/
tracks are only shown inside the element with display: grid set on it. when you check the "extend lines infinitely" option, the grid lines extend to the edge of the viewport along each axis. mini grid view shows a small version of the currently overlaid grid, which is in proportion to the real thing. hovering over the different areas of the mini grid causes the equivalent area on the grid ove...
Background Tasks API - Web APIs
be performed, as well as status information about the task queue and its execution: tasklist is an array of objects, each representing one task waiting to be run. totaltaskcount is a counter of the number of tasks that have been added to the queue; it will only go up, never down. we use this to do the math to present progress as a precentage of total work to do. currenttasknumber is used to
track how many tasks have been processed so far. taskhandle is a reference to the task currently being processed. let totaltaskcountelem = document.getelementbyid("totaltaskcount"); let currenttasknumberelem = document.getelementbyid("currenttasknumber"); let progressbarelem = document.getelementbyid("progress"); let startbuttonelem = document.getelementbyid("startbutton"); let logelem = document.ge...
... logelem is the <div> we'll insert logged text messages into. let logfragment = null; let statusrefreshscheduled = false; finally, we set up a couple of variables for other items: logfragment will be used to store a documentfragment that's generated by our logging functions to create content to append to the log when the next animation frame is rendered. statusrefreshscheduled is used to
track whether or not we've already scheduled an update of the status display box for the upcoming frame, so that we only do it once per frame the shim to function even if idle callbacks aren't supported. already discussed above, so it's hidden here to save space in the article. window.requestidlecallback = window.requestidlecallback || function(handler) { let starttime = date.now(); return set...
... which continues as long as there's time left (as determined by checking deadline.timeremaining) to be sure it's more than 0 or if the timeout limit was reached (deadline.didtimeout is true), and as long as there are tasks in the task list. for each task in the queue that we have time to execute, we do the following: we remove the task object from the queue. we increment currenttasknumber to
track how many tasks we've executed. we call the task's handler, task.handler, passing into it the task's data object (task.data). we call a function, schedulestatusrefresh(), to handle scheduling a screen update to reflect changes to our progress. when time runs out, if there are still tasks left in the list, we call requestidlecallback() again so that we can continue to process the tasks the next...
CacheStorage - Web APIs
chrome and safari only expose `cachestorage` to the windowed context over https. window.caches will be undefined unless an ssl certificate is configured. maintains a mapping of string names to corresponding cache objects. use cachestorage.open() to obtain a cache instance. use cachestorage.match() to check if a given request is a key in any of the cache objects that the cachestorage object
tracks. you can access cachestorage through the global caches property. note: cachestorage always rejects with a securityerror on untrusted origins (i.e. those that aren't using https, although this definition will likely become more complex in the future.) when testing, you can get around this by checking the "enable service workers over http (when toolbox is open)" option in the firefox devtools op...
...e: cachestorage.match() is a convenience method. equivalent functionality to match a cache entry can be implemented by returning an array of cache names from cachestorage.keys(), opening each cache with cachestorage.open(), and matching the one you want with cache.match(). methods cachestorage.match() checks if a given request is a key in any of the cache objects that the cachestorage object
tracks, and returns a promise that resolves to that match. cachestorage.has() returns a promise that resolves to true if a cache object matching the cachename exists. cachestorage.open() returns a promise that resolves to the cache object matching the cachename (a new cache is created if it doesn't already exist.) cachestorage.delete() finds the cache object matching the cachename, and if found, ...
... (a new cache is created if it doesn't already exist.) cachestorage.delete() finds the cache object matching the cachename, and if found, deletes the cache object and returns a promise that resolves to true. if no cache object is found, it resolves to false. cachestorage.keys() returns a promise that will resolve with an array containing strings corresponding to all of the named cache objects
tracked by the cachestorage. use this method to iterate over a list of all the cache objects. examples this code snippet is from the mdn sw-test example (see sw-test running live.) this service worker script waits for an installevent to fire, then runs waituntil to handle the install process for the app. this consists of calling cachestorage.open to create a new cache, then using cache.addall to add...
DisplayMediaStreamConstraints - Web APIs
the displaymediastreamconstraints dictionary is used to specify whether or not to include video and/or audio
tracks in the mediastream to be returned by getdisplaymedia(), as well as what type of processing must be applied to the
tracks. processing information is specified using media
trackconstraints objects providing options which are applied to the
track after the media data is received but before it is made available on the mediastream. properties audio a boolean or media
trackconstraints value; if a boolean, this value simply indicates whether or not to include an audio
track in the mediastream returned by getdisplaymedia(). ...
...formation is specified using media
trackconstraints objects providing options which are applied to the
track after the media data is received but before it is made available on the mediastream. properties audio a boolean or media
trackconstraints value; if a boolean, this value simply indicates whether or not to include an audio
track in the mediastream returned by getdisplaymedia(). if a media
trackconstraints object is provided here, an audio
track is included in the stream, but the audio is processed to match the specified constraints after being retrieved from the hardware but before being added to the mediastream. the default value is false. video if true (the default), the display contents are included in a mediastream
track within the stream provided by getdisplaymedia(). optionally, ...
...a value of false is not permitted, and results in a typeerror being thrown. ...
Force Touch events - Web APIs
events webkitmouseforcewillbegin this event is fired before the mousedown event. its main use is that it can be event.preventdefault()ed. ...
...it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. force touch events are a proprietary, apple-specific feature which makes possible (where supported by the input hardware) new interactions based on how hard the user clicks or presses down on the touchscreen or
trackpad. events webkitmouseforcewillbegin this event is fired before the mousedown event. its main use is that it can be event.preventdefault()ed. webkitmouseforcedown this event is fired after the mousedown event as soon as sufficient pressure has been applied for it to qualify as a "force click". webkitmouseforceup this event is fired after the webkitmouseforcedown event as soon as th...
... event first fires after the mousedown event and stops firing before the mouseup event. event properties the following property is known to be available on the webkitmouseforcewillbegin, mousedown, webkitmouseforcechanged, webkitmouseforcedown, webkitmouseforceup, mousemove, and mouseup event objects: mouseevent.webkitforce read only the amount of pressure currently being applied to the
trackpad/touchscreen constants these constants are useful for determining the relative intensity of the pressure indicated by mouseevent.webkitforce: mouseevent.webkit_force_at_mouse_down read only minimum force necessary for a normal click mouseevent.webkit_force_at_force_mouse_down read only minimum force necessary for a force click specifications not part of any specification. apple ...
HTMLMediaElement - Web APIs
/><text x="411" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlmediaelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface also inherits properties from its ancestors htmlelement, element, node, and eventtarget. htmlmediaelement.audio
tracks a audio
tracklist that lists the audio
track objects contained in the element. htmlmediaelement.autoplay a boolean that reflects the autoplay html attribute, indicating whether playback should automatically begin as soon as enough media is available to do so without interruption. note: automatically playing audio when the user doesn't expect or desire it is a poor user experience and should...
...iceid values returned from mediadevices.enumeratedevices(), id-multimedia, or id-communications. htmlmediaelement.src is a domstring that reflects the src html attribute, which contains the url of a media resource to use. htmlmediaelement.srcobject is a mediastream representing the media to play or that has played in the current htmlmediaelement, or null if not assigned. htmlmediaelement.text
tracks read only returns the list of text
track objects contained in the element. htmlmediaelement.video
tracks read only returns the list of video
track objects contained in the element. htmlmediaelement.volume is a double indicating the audio volume, from 0.0 (silent) to 1.0 (loudest). event handlers htmlmediaelement.onencrypted sets the eventhandler called when the media is encrypted. htm...
...plemented for firefox os, and was removed in firefox 55. htmlmediaelement.onmozinterruptend sets the eventhandler called when the interruption is concluded. this was firefox-specific, having been implemented for firefox os, and was removed in firefox 55. methods this interface also inherits methods from its ancestors htmlelement, element, node, and eventtarget. htmlmediaelement.addtext
track() adds a text
track (such as a
track for subtitles) to a media element. htmlmediaelement.capturestream() returns mediastream, captures a stream of the media content. htmlmediaelement.canplaytype() given a string specifying a mime media type (potentially with the codecs parameter included), canplaytype() returns the string probably if the media should be playable, maybe if there's not enoug...
Using IndexedDB - Web APIs
an always add a catchall error handler to the database if fine-grained error handling is too cumbersome. if you don't handle an error event or if you call abort() on the transaction, then the transaction is rolled back and an abort event is fired on the transaction. otherwise, after all pending requests have completed, you'll get a complete event. if you're doing lots of database operations, then
tracking the transaction rather than individual requests can certainly aid your sanity. now that you have a transaction, you'll need to get the object store from it. transactions only let you have an object store that you specified when creating the transaction. then you can add all the data you need. // do something when all the data is added to the database. transaction.oncomplete = function(event)...
...ser (or page) closes. however, this will not work. the database transactions will be created in the unload event handler, but because they are asynchronous they will be aborted before they can execute. in fact, there is no way to guarantee that indexeddb transactions will complete, even with normal browser shutdown. see bug 870645. as a workaround for this normal shutdown notification, you might
track your transactions and add a beforeunload event to warn the user if any transactions have not yet completed at the time of unloading. at least with the addition of the abort notifications and idbdatabase.onclose, you can know when this has happened. locale-aware sorting mozilla has implemented the ability to perform locale-aware sorting of indexeddb data in firefox 43+. by default, indexeddb di...
...); compat.empty(); compat.append('<ul id="compat-list"></ul>'); compat_envs.foreach(function(val, idx, array) { $('#compat-list').append('<li>' + val[0] + ': ' + val[1] + '</li>'); }); const db_name = 'mdn-demo-indexeddb-epublications'; const db_version = 1; // use a long long for this value (don't use a float) const db_store_name = 'publications'; var db; // used to keep
track of which view is displayed to avoid uselessly reloading it var current_view_pub_key; function opendb() { console.log("opendb ..."); var req = indexeddb.open(db_name, db_version); req.onsuccess = function (evt) { // equal to: db = req.result; db = this.result; console.log("opendb done"); }; req.onerror = function (evt) { console.error("opendb:", evt...
KeyboardEvent: code values - Web APIs
"" 0x007d "intlyen" "intlyen" 0x007e "numpadcomma" "" 0x007f "unidentified" "" 0xe000 ~ 0xe007 "unidentified" "" 0xe008 "unidentified" "undo" 0xe009 "unidentified" "" 0xe00a "" "paste" 0xe00b ~ 0xe00f "" "" 0xe010 "media
trackprevious" "media
trackprevious" 0xe011 ~ 0xe016 "" "" 0xe017 "unidentified" "cut" 0xe018 "unidentified" "copy" 0xe019 "media
tracknext" "media
tracknext" 0xe01a, 0xe01b "unidentified" "" 0xe01c "numpadenter" "numpadenter" 0xe01d "controlright" "controlright" ...
......
... 0x008f "wakeup" 0x0090 "launchapp1" 0x0091 ~ 0x009b "unidentified" 0x009c "browserfavorites" 0x009d "unidentified" 0x009e "browserback" 0x009f "browserforward" 0x00a0 "unidentified" 0x00a1 "eject" 0x00a2 "unidentified" 0x00a3 "media
tracknext" 0x00a4 "mediaplaypause" 0x00a5 "media
trackprevious" 0x00a6 "mediastop" 0x00a7 ~ 0x00ac "unidentified" 0x00ad "browserrefresh" 0x00ae ~ 0x00b6 "unidentified" 0x00b7 "f13" 0x00b8 "f14" 0x00b9 "f15" 0x00ba "f16" 0x00bb "f17" 0x00bc "f18" ...
LocalMediaStream - Web APIs
by getusermedia(). however, getusermedia() now returns a mediastream instead, and this interface has been removed from the specification. warning: this interface is no longer available in any mainstream browser. do not use localmediastream; you need to update any code that does use it as soon as possible or your content or application will stop working. ...
...code that does use it as soon as possible or your content or application will stop working. see stopping a video stream in mediastream
track to learn how. all other functionality is found in mediastream. the primary reason for this interface to exist was to add a stop() method to its mediastream parent interface. however, control over playback of media has been moved to the individual mediastream
track objects, so this is no longer necessary. instead, media is stopped by calling mediastream
track.stop() on each
track that needs to be stopped. the example for mediastream
track.stop() demonstrates how to stop a multi-
track stream, which is what localmediastream.stop() used to be used for. methods localmediastream.stop() stops the stream. when the source of the stream is a connected device (suc...
... specifications not part of any specification. ...
MediaRecorder.start() - Web APIs
lob and trigger the creation of a new blob into which the media continues to be recorded. return value undefined. exceptions errors that can be detected immediately are thrown as dom exceptions. all other errors are reported through error events sent to the mediarecorder object. you can implement the onerror event handler to respond to these errors. ...
... to be recorded. return value undefined. exceptions errors that can be detected immediately are thrown as dom exceptions. all other errors are reported through error events sent to the mediarecorder object. you can implement the onerror event handler to respond to these errors. invalidmodificationerror the number of
tracks on the stream being recorded has changed. you can't add or remove
tracks while recording media. invalidstateerror the mediarecorder is not in the inactive state; you can't start recording media if it's already being recorded. see the state property. notsupportederror the media stream you're attempting to record is inactive, or one or more of the stream's
tracks is in a format that can't be recorded using the current configuration. securityerror the mediastream ...
...this exception may also be delivered as an error event if the security options for the source media change after recording begins. unknownerror something else went wrong during the recording process. example ... ...
Media Session action types - Web APIs
to support an action on a media session, such as seeking, pausing, or changing
tracks, you need to call the mediasession interface's setactionhandler() method to establish a handler for that action. the specific type of media session action to be handled on a mediasession is identified using a string from the mediasessionaction enumerated type. syntax a media session action's type is specified using a string from the mediasessionaction enumerated type. values each of the actions is a common media session control request. implement support for each of these in order to allow that type of action to be performed. the following strings identify the currently available types of media session action: next
track advances playback to the next
track. pause pauses playback of the media.
... seekbackward seeks backward through the media from the current position. ...
... seekbackward seeks backward through the media from the current position. the mediasessionactiondetails property seekoffset specifies the amount of time to seek backward. ...
active - Web APIs
syntax var isactive = mediastream.active; value a boolean value which is true if the stream is currently active; otherwise, the value is false. ...
... syntax var isactive = mediastream.active; value a boolean value which is true if the stream is currently active; otherwise, the value is false. ...
... syntax var isactive = mediastream.active; value a boolean value which is true if the stream is currently active; otherwise, the value is false. ...
MediaStream Image Capture API - Web APIs
ever video device is available, though the getusermedia() method allows more specific capabilities to be requested. this method returns a promise that resolves with a mediastream object. navigator.mediadevices.getusermedia({ video: true }) .then(mediastream => { // do something with the stream. }) next, isolate the visual part of the media stream. do this by calling mediastream.getvideo
tracks(). this returns an array of mediastream
track objects. the code below assumes that the first item in the mediastream
track array is the one to use. you can use the properties of the mediastream
track objects to select the one you need. const
track = mediastream.getvideo
tracks()[0]; at this point, you might want to configure the device capabilities before capturing an image. you can do this by cal...
...ediastream
track objects. the code below assumes that the first item in the mediastream
track array is the one to use. you can use the properties of the mediastream
track objects to select the one you need. const
track = mediastream.getvideo
tracks()[0]; at this point, you might want to configure the device capabilities before capturing an image. you can do this by calling applyconstraints() on the
track object before doing anything else. let zoom = document.queryselector('#zoom'); const capabilities =
track.getcapabilities(); // check whether zoom is supported or not. if(!capabilities.zoom) { return; }
track.applyconstraints({ advanced : [{ zoom: zoom.value }] }); finally, pass the mediastream
track object to the imagecapture() constructor. ...
...e
track object before doing anything else. let zoom = document.queryselector('#zoom'); const capabilities =
track.getcapabilities(); // check whether zoom is supported or not. if(!capabilities.zoom) { return; }
track.applyconstraints({ advanced : [{ zoom: zoom.value }] }); finally, pass the mediastream
track object to the imagecapture() constructor. though a mediastream holds several types of
tracks and provides multiple methods for retrieving them, the imagecapture constructor will throw a domexception of type notsupportederror if mediastream
track.kind is not "video". let imagecapture = new imagecapture(
track); interfaces imagecapture an interface for capturing images from a photographic device referenced through a valid mediastream
track. photocapabilities provides available confi...
Using Pointer Events - Web APIs
ostic, the application accepts coordinate-based inputs from a mouse, a pen, or a fingertip using the same code. this application will only work on a browser that supports pointer events. a live version of this application is available on github. the source code is available on github and pull requests and bug reports are welcome. definitions surface a touch-sensitive surface. this may be a
trackpad, a touch screen, or even a virtual mapping of a user's desk surface (or mousepad) with the physical screen. touch point a point of contact with the surface. this may be a finger (or elbow, ear, nose, whatever, but typically a finger), stylus, mouse, or any other method for specifying a single point on the surface. example the text below uses the term "finger" when describing the contac...
...bytagname("canvas")[0]; el.addeventlistener("pointerdown", handlestart, false); el.addeventlistener("pointerup", handleend, false); el.addeventlistener("pointercancel", handlecancel, false); el.addeventlistener("pointermove", handlemove, false); log("initialized."); } this simply sets up all the event listeners for our <canvas> element so we can handle the touch events as they occur.
tracking new touches we'll keep
track of the touches in-progress. var ongoingtouches = new array(); when a pointerdown event occurs, indicating that a new touch on the surface has occurred, the handlestart() function below is called. function handlestart(evt) { log("pointerdown."); var el = document.getelementsbytagname("canvas")[0]; var ctx = el.getcontext("2d"); log("pointerdown: id = "...
...s.splice(idx, 1); // remove it; we're done } else { log("can't figure out which touch to end"); } } this is very similar to the previous function; the only real differences are that we draw a small square to mark the end and that when we call array.splice(), we simply remove the old entry from the ongoing touch list, without adding in the updated information. the result is that we stop
tracking that touch point. handling canceled touches if the user's finger wanders into browser ui, or the touch otherwise needs to be canceled, the pointercancel event is sent, and we call the handlecancel() function below. function handlecancel(evt) { log("pointercancel: id = " + evt.pointerid); var idx = ongoingtouchindexbyid(evt.pointerid); ongoingtouches.splice(idx, 1); // remove it; we'r...
RTCPeerConnection.getStats() - Web APIs
if this is null (the default value), statistics will be gathered for the entire rtcpeerconnection. return value a promise which resolves with an rtcstatsreport object providing connection statistics. the contents of the report depend on the selector as well as other details of the connection. ...
... return value a promise which resolves with an rtcstatsreport object providing connection statistics. the contents of the report depend on the selector as well as other details of the connection. exceptions this method does not throw exceptions; instead, it rejects the returned promise with one of the following errors: invalidaccesserror there is no rtcrtpsender or rtcrtpreceiver whose
track matches the specified selector, or selector matches more than one sender or receiver. obsolete syntax previously, getstats() used success and failure callbacks to report the results to you, instead of using a promise. this version of getstats() is obsolete; in addition, the data it returns is entirely different from the current specification, and the form of that data was never documented. t...
...ta was never documented. this form of getstats() has been or will soon be removed from most browsers; you should not use it, and should update existing code to use the new promise-based version. check the browser compatibility table to verify the state of this method. promise = rtcpeerconnection.getstats(selector, successcallback, failurecallback) parameters selector optional a mediastream
track for which to gather statistics. if this is null (the default value), statistics will be gathered for the entire rtcpeerconnection. successcallback a callback function to call when the stats have been retrieved. the function receives as input a single parameter: an rtcstatsreport with the collected statistics. no output is expected from the function. failurecallback a function to call when an ...
RTCPeerConnection.onremovestream - Web APIs
the rtcpeerconnection.onremovestream event handler is a property containing the code to execute when the removestream event, of type mediastreamevent, is received by this rtcpeerconnection. such an event is sent when a mediastream is removed from this connection. ...
... the rtcpeerconnection.onremovestream event handler is a property containing the code to execute when the removestream event, of type mediastreamevent, is received by this rtcpeerconnection. such an event is sent when a mediastream is removed from this connection. ...
... the rtcpeerconnection.onremovestream event handler is a property containing the code to execute when the removestream event, of type mediastreamevent, is received by this rtcpeerconnection. such an event is sent when a mediastream is removed from this connection. ...
RTCRtpReceiver - Web APIs
obsolete properties rtcptransport this property has been removed; the rtp and rtcp transports have been combined into a single transport. use the transport property instead. ...
... obsolete properties rtcptransport this property has been removed; the rtp and rtcp transports have been combined into a single transport. use the transport property instead. ...
... obsolete properties rtcptransport this property has been removed; the rtp and rtcp transports have been combined into a single transport. use the transport property instead. ...
RTCRtpSender.setParameters() - Web APIs
the setparameters() method of the rtcrtpsender interface applies changes the configuration of sender's
track, which is the mediastream
track for which the rtcrtpsender is responsible. in other words, setparameters() updates the configuration of the rtp transmission as well as the encoding configuration for a specific media
track on the webrtc connection. syntax var promise = rtcrtpsender.setparameters(parameters) parameters parameters an object conforming with the rtcrtpsendparameters dictionary, specifying options for the rtcrtpsender; these include potential codecs that could be use for encoding the sender's
track. the available options are: degradationpreference specifies the preferred way the webrtc layer should handle optimizing bandwidth against quality in constrained-ban...
...degradationpreference specifies the preferred way the webrtc layer should handle optimizing bandwidth against quality in constrained-bandwidth situations; the value comes from the rtcdegradationpreference enumerated string type, and the default is balanced. encodings an array of rtcrtpencodingparameters objects, each specifying the parameters for a single codec that could be used to encode the
track's media. priority a string from the rtcprioritytype enumerated type which indicates the encoding's priority. the default value is low. transactionid a string containing a unique id for the last set of parameters applied; this value is used to ensure that setparameters() can only be called to alter changes made by a specific previous call to getparameters(). return value a promise that r...
...from the rtcprioritytype enumerated type which indicates the encoding's priority. the default value is low. transactionid a string containing a unique id for the last set of parameters applied; this value is used to ensure that setparameters() can only be called to alter changes made by a specific previous call to getparameters(). return value a promise that resolves when the rtcrtpsender.
track property is updated with the given parameters. exceptions if an error occurs, the returned promise is rejected with the appropriate exception from the list below. invalidmodificationerror one of the following problems was detected: the number of encodings specified in the parameters object's encodings property does not match the number of encodings currently listed for the rtcrtpsender.
Streams API concepts - Web APIs
ion via a fetch or xhr call. the data is read sequentially in small pieces called chunks. a chunk can be a single byte, or it can be something larger such as a typed array of a certain size. a single stream can contain chunks of different sizes and types. the chunks placed in a stream are said to be enqueued — this means they are waiting in a queue ready to be read. an internal queue keeps
track of the chunks that have not yet been read (see the internal queues and queuing strategies section below). the chunks inside the stream are read by a reader — this processes the data one chunk at a time, allowing you to do whatever kind of operation you want to do on it. the reader plus the other processing code that goes along with it is called a consumer. there is also a construct you’ll u...
...for writing; the writer plus the associated code is called a producer. when a writer is created and starts writing to a stream (an active writer), it is said to be locked to it. only one writer can write to a writable stream at one time. if you want another writer to start writing to your stream, you typically need to abort it before you then attach another writer to it. an internal queue keeps
track of the chunks that have been written to the stream but not yet been processed by the underlying sink. there is also a construct you’ll use called a controller — each writer has an associated controller that allows you to control the stream (for example, to abort it if wished). you can make use of writable streams using the writablestream() constructor. these currently have very limited av...
... its underlying source to stop sending data, and we backpressure along the stream chain. if later on the consumer again wants to receive data, we can use the pull method in the stream creation to tell our underlying source to feed our stream with data. internal queues and queuing strategies as mentioned earlier, the chunks in a stream that have not yet been processed and finished with are kept
track of by an internal queue. in the case of readable streams, these are the chunks that have been enqueued but not yet read in the case of writable streams, these are chunks that have been written but not yet processed by the underlying sink. internal queues employ a queuing strategy, which dictates how to signal backpressure based on the internal queue state. in general, the strategy compares...
VTTCue - Web APIs
the vttcue interface—part of the api for handling webvtt (text
tracks on media presentations)—describes and controls the text
track associated with a particular <
track> element. constructor vttcue(starttime, endtime, text) returns a newly created vttcue object that covers the given time range and has the given text. param starttime the time, in seconds and fractions of a second, that describes the beginning of the range of the media data to which the cue applies. endtime the time, in seconds and fractions of a second, that describes the end of the range of the media data to which the cue applies. text the raw text of the cue, and rules for its interpretation. properties this interface also inherits properties from text
trackcue. vttcue.region a vttregion o...
...e.text returns a domstring with the contents of the cue. methods getcueashtml() returns the cue text as a documentfragment. example html <video controls src="https://udn.realityripple.com/samples/c6/f8a3489533.webm"></video> css video { width: 320px; height: 180px; } javascript let video = document.queryselector('video'); video.addeventlistener('loadedmetadata', () => { const
track = video.addtext
track("captions", "简体中文subtitles", "zh_cn");
track.mode = "showing"; const cuecn = new vttcue(0, 2.500, '字幕会在0至2.5秒间显示');
track.addcue(cuecn); const cueen = new vttcue(2.6, 4, 'subtitles will display between 2.6 and 4 seconds');
track.addcue(cueen); }); result chrome: please open in jsfiddle to view the live sample. embed live sample can ...
...500, '字幕会在0至2.5秒间显示');
track.addcue(cuecn); const cueen = new vttcue(2.6, 4, 'subtitles will display between 2.6 and 4 seconds');
track.addcue(cueen); }); result chrome: please open in jsfiddle to view the live sample. embed live sample can not show subtitles in chrome. ...
WebRTC Statistics API - Web APIs
rtcrtpstreamstats rtcstats local-candidate statistics about a local ice candidate associated with the connection's rtcicetransports. rtcicecandidatestats rtcstats media-source statistics about the media produced by the mediastream
track attached to an rtp sender. the dictionary this key maps to depends on the
track's kind. rtcaudiosourcestats or rtcvideosourcestats rtcmediasourcestats rtcstats rtcaudiosourcestats or rtcvideosourcestats outbound-rtp statistics describing the state of one of the outbound data streams on this connectio...
...he kind of the media. rtcaudiosenderstats or rtcvideosenderstats rtcaudiohandlerstats or rtcvideohandlerstats rtcmediahandlerstats rtcstats stream statistics about a particular media mediastream. this has been obsoleted since the transition to webrtc being
track-based rather than stream-based. rtcmediastreamstats rtcstats
track statistics related to a specific mediastream
track's attachment to one of the connection's senders or receivers. the referenced object's type depends on the
track type. these statistics have all been moved to media-source, sender, receiver, outbound-rtp...
... statistics related to a specific mediastream
track's attachment to one of the connection's senders or receivers. the referenced object's type depends on the
track type. these statistics have all been moved to media-source, sender, receiver, outbound-rtp, and inbound-rtp, and this statistic category type is thus obsolete and shouldn't be used anymore. rtcsendervideo
trackattachmentstats or rtcsenderaudio
trackattachmentstats or rtcreceivervideo
trackattachmentstats or rtcreceiveraudio
trackattachmentstats rtcmediahandlerstats rtcstats transceiver statistics related to a specific rtcrtptransceiver. rtcrtptransceiverstats rtcstats ...
Rendering and the WebXR frame animation callback - Web APIs
buffers once you have an xrframe representing the state of the scene at a moment in time, you need to determine the positions of objects within the scene relative to the viewer so that you can render them. the viewer's position and orientation relative to a reference space is represented by an xrviewerpose obtained by calling the xrframe method getviewerpose(). the xrframe doesn't directly keep
track of the positions or orientations of the objects in your world. instead, it offers a way to convert positions and orientations into the scene's coordinate system, and it collects the viwer's position and orientation data from the xr hardware, converts it into the reference space you've configured, and delivers it to your frame rendering code with a timestamp. you use that timestamp and your own da...
...h as those user control states or known animation paths of the objects in the scene. handling user control inputs there are three methods by which users might provide input while using a webxr application. first, webxr supports directly handling inputs from the controllers which are integrated with the xr hardware itself. ...
... orientation and position information that can be collected from the xr hardware directly is applied automatically. ...
Web Audio API - Web APIs
rcenode the mediaelementaudiosourcenode interface represents an audio source consisting of an html5 <audio> or <video> element. it is an audionode that acts as an audio source. mediastreamaudiosourcenode the mediastreamaudiosourcenode interface represents an audio source consisting of a mediastream (such as a webcam, microphone, or a stream being sent from a remote computer). ...
...de interface represents an audio source consisting of an html5 <audio> or <video> element. it is an audionode that acts as an audio source. mediastreamaudiosourcenode the mediastreamaudiosourcenode interface represents an audio source consisting of a mediastream (such as a webcam, microphone, or a stream being sent from a remote computer). if multiple audio
tracks are present on the stream, the
track whose id comes first lexicographically (alphabetically) is used. it is an audionode that acts as an audio source. mediastream
trackaudiosourcenode a node of type mediastream
trackaudiosourcenode represents an audio source whose data comes from a mediastream
track. when creating the node using the createmediastream
tracksource() method to create the node, you specify which
track to use. this provide...
...r audio, these interfaces define where to output it. audiodestinationnode the audiodestinationnode interface represents the end destination of an audio source in a given context — usually the speakers of your device. mediastreamaudiodestinationnode the mediastreamaudiodestinationnode interface represents an audio destination consisting of a webrtc mediastream with a single audiomediastream
track, which can be used in a similar way to a mediastream obtained from getusermedia(). it is an audionode that acts as an audio destination. data analysis and visualization if you want to extract time, frequency, and other data from your audio, the analysernode is what you need. analysernode the analysernode interface represents a node able to provide real-time frequency and time-domain analys...
Keyboard-navigable JavaScript widgets - Accessibility
sed element to "-1". here's an example of a wai-aria tree view using this technique. tips use element.focus() to set focus do not use createevent(), initevent() and dispatchevent() to send focus to an element. dom focus events are considered informational only: generated by the system after something is focused, but not actually used to set focus. use element.focus() instead. ...
...o send focus to an element. dom focus events are considered informational only: generated by the system after something is focused, but not actually used to set focus. use element.focus() instead. use onfocus to
track the current focus don't assume that all focus changes will come via key and mouse events: assistive technologies such as screen readers can set the focus to any focusable element.
track focus using onfocus and onblur instead. onfocus and onblur can now be used with every element. there is no standard dom interface to get the current document focus. if you want to
track the focus status, you can use the document.activeelement to get the active element. you can also use document.hasfocus to make sure if the current document focus. technique 2: aria-activedescendant this techni...
...(for more information about aria, see this overview of accessible web applications and widgets.) the aria-activedescendant property identifies the id of the descendent element that currently has the virtual focus. ...
Perceivable - Accessibility
work, or an accessible data table (see html table advanced features and accessibility). see other text alternative mechanisms for the argument against longdesc. multimedia content (i.e., audio or video) should at least have a descriptive identification available, such as a caption or similar. see text alternatives for static caption options, and audio transcripts, video text
tracks, and other multimedia content for other alternatives. ui controls such as form elements and buttons should have text labels that describe their purpose. buttons are simple—you should make sure the button text describes the function of the button (e.g., <button>upload image</button>). for more information on other ui controls, see ui controls. implement decorative (non-...
...provided for prerecorded video-only media (i.e., silent video). see audio transcripts for transcript information. no audio description tutorial is available yet. 1.2.2 provide captions for web-based video (a) you should provide captions for video presented on the web (e.g., html5 video). this is for the benefit of people who can't hear the audio part of the video. see video text
tracks for html5 video captions, and other multimedia content for other technologies. see also add your own subtitles & closed captions (youtube). 1.2.3 provide text transcript or audio description for web-based video (a) you should provide text transcripts or audio descriptions for video presented on the web (e.g., html5 video. this is for the benefit of people who can't see the visual par...
...io of 3:1 for user interface components and graphical objects. ...
Border-radius generator - CSS: Cascading Style Sheets
= 0; i < size; i++) new checkbox(elem[i]); } return { init : init, setvalue : setvalue, subscribe : subscribe, unsubscribe : unsubscribe } })(); window.addeventlistener("load", function() { borderradius.init(); }); var borderradius = (function borderradius() { function getelembyid(id) { return document.getelementbyid(id); } /** * shadow dragging */ var previewmouse
tracking = (function drag() { var active = false; var lastx = 0; var lasty = 0; var subscribers = []; var init = function init(id) { var elem = getelembyid(id); elem.addeventlistener('mousedown', dragstart, false); document.addeventlistener('mouseup', dragend, false); } var dragstart = function dragstart(e) { if (e.button !== 0) return; active = true; lastx = e.cl...
...e handle-top-left' if (x === 'right' && y == 'top') handle.classname = 'handle handle-top-right'; if (x === 'right' && y == 'bottom') handle.classname = 'handle handle-bottom-right'; if (x === 'left' && y == 'bottom') handle.classname = 'handle handle-bottom-left'; handle.addeventlistener("mousedown", function(e) { active = true; this.radius.style.display = 'block'; previewmouse
tracking.subscribe(this.updatecontainer.bind(this)); }.bind(this)); document.addeventlistener("mouseup", function(e) { this.radius.style.display = 'none'; if (active === true) previewmouse
tracking.unsubscribe(this.updatecontainer.bind(this)); }.bind(this)); inputslidermanager.subscribe(this.topic + '-w', this.setwidth.bind(this)); inputslidermanager.subscribe(this.topic + '-h', th...
... updateuiwidth); inputslidermanager.subscribe("height", updateuiheight); inputslidermanager.setvalue("width", subject.clientwidth); inputslidermanager.setvalue("height", subject.clientheight); } return { init : init, updateoutput : updateoutput } })(); /** * init tool */ var init = function init() { buttonmanager.init(); inputslidermanager.init(); previewmouse
tracking.init("preview"); tool.init(); } return { init : init } })(); ...
Color picker tool - CSS: Cascading Style Sheets
= 'hsl' + a + hsl + v + ')'; return value; }; color.prototype.getcolor = function getcolor() { if (this.a | 0 === 1) return this.gethexa(); return this.getrgba(); }; /*=======================================================================*/ /*=======================================================================*/ /*========== capture mouse movement ==========*/ var setmouse
tracking = function setmouse
tracking(elem, callback) { elem.addeventlistener('mousedown', function(e) { callback(e); document.addeventlistener('mousemove', callback); }); document.addeventlistener('mouseup', function(e) { document.removeeventlistener('mousemove', callback); }); }; /*====================*/ // color picker class /*====================*/ function colorpicker(node)...
...ting the color-picker /*************************************************************************/ colorpicker.prototype.createpickingarea = function createpickingarea() { var area = document.createelement('div'); var picker = document.createelement('div'); area.classname = 'picking-area'; picker.classname = 'picker'; this.picking_area = area; this.color_picker = picker; setmouse
tracking(area, this.updatecolor.bind(this)); area.appendchild(picker); this.node.appendchild(area); }; colorpicker.prototype.createhuearea = function createhuearea() { var area = document.createelement('div'); var picker = document.createelement('div'); area.classname = 'hue'; picker.classname ='slider-picker'; this.hue_area = area; this.hue_picker = picker; setmouse
tracking(are...
...; colorpicker.prototype.createalphaarea = function createalphaarea() { var area = document.createelement('div'); var mask = document.createelement('div'); var picker = document.createelement('div'); area.classname = 'alpha'; mask.classname = 'alpha-mask'; picker.classname = 'slider-picker'; this.alpha_area = area; this.alpha_mask = mask; this.alpha_picker = picker; setmouse
tracking(area, this.updatealphaslider.bind(this)); area.appendchild(mask); mask.appendchild(picker); this.node.appendchild(area); }; colorpicker.prototype.createpreviewbox = function createpreviewbox(e) { var preview_box = document.createelement('div'); var preview_color = document.createelement('div'); preview_box.classname = 'preview'; preview_color.classname = 'preview-color'; ...
Card - CSS: Cascading Style Sheets
heading, image, content and a footer. each card should be the same height, and footers should stick to the bottom of the card. when added to a collection of cards, the cards should line up in two dimensions. recipe download this example choices made the card is laid out using css grid layout despite being a single dimensional layout, as it enables the use of content sizing for the grid
tracks. when setting up the single column grid i use the following: .card { display: grid; grid-template-rows: max-content 200px 1fr; } the heading
track is set to max-content, which prevents it from stretching. i have decided that i want my image to live within a
track that is 200 pixels tall. i then set the next
track — which is where the content lives — to 1fr. this means it will take up a...
...therefore this will fit the content added to it. note: the various elements in separate cards do not align with each other, as each card is an independent grid. ...
... each card is an independent grid. the proposed subgrid feature of grid level 2 would give a solution to this issue. useful fallbacks or alternative methods flexbox could be used to lay out the card, in which case you should make the content area grow, and other items not grow. this would be a reasonable way to lay out the card, although i have a slight preference for being able to control the
tracks from the container rather than needing to add rules to the items. for the overall layout you could use flexbox, however this will result in cards stretching over the final flex row where there are fewer than can fit in the rows above. alternatively you could use css multi-col — this would cause the cards to lay out down the columns, which may or may not be a problem. see the columns recipe f...
Recipe: Media objects - CSS: Cascading Style Sheets
est. the recipe download this example choices made i have chosen to use grid layout for the media object as it allows me to control the layout in two dimensions when i need to. this means that when we have a footer, with short content above, the footer can be pushed down to the bottom of the media object. another reason to use grid layout is in order that i can use fit-content() for the
track sizing of the image. by using fit-content with a maximum size of 200 pixels, when we have a small image such as the icon, the
track only gets as large as the size of that image — the max-content size. if the image is larger, the
track stops growing at 200 pixels and as the image has a max-width of 100% applied, it scales down so that it continues to fit inside the column. by using grid-templa...
... in the css. i define my grid once we have a max-width of 500 pixels, so on smaller devices the media object stacks. an option for the pattern is to flip it to switch the image to the other side — this is done by adding the media-flip class, which defines a flipped grid template causing the layout to be mirrored. when we nest one media object inside another we need to place it into the second
track in the regular layout, and the first
track when flipped. fallbacks there are a number of possible fallbacks for this pattern, depending on the browsers you wish to support. a good catch-all would be to float the image left, and to add a clearfix to the box to ensure that it contained the floats. download this example once floated elements become grid items the float no longer applies so y...
...learfix to the box to ensure that it contained the floats. download this example once floated elements become grid items the float no longer applies so you don’t need to do anything special to clear the float. what you will need to do is remove any margins applied to the item, and any widths which we don’t need in a grid context (we have the gap property to control it in grids, and the
track takes control of the sizing). relevant resources on mdn css grid layout progressive enhancement and grid layout using grid template areas fit-content grid-template-areas ...
Microsoft CSS extensions - CSS: Cascading Style Sheets
microsoft applications such as edge and internet explorer support a number of special microsoft extensions to css. these extensions are prefixed with -ms-. microsoft-only properties (avoid using on websites) note: these properties will only work in microsoft applications, and are not on a standards
track. -ms-accelerator -ms-block-progression -ms-content-zoom-chaining -ms-content-zooming -ms-content-zoom-limit -ms-content-zoom-limit-max -ms-content-zoom-limit-min -ms-content-zoom-snap -ms-content-zoom-snap-points -ms-content-zoom-snap-type -ms-filter -ms-flow-from -ms-flow-into -ms-high-contrast-adjust -ms-hyphenate-limit-chars -ms-hyphenate-limit-lines -ms-hyphenate-limit-zone -ms-ime-align -ms-overflow-style -ms-scrollbar-3dlight-color -ms-scrollbar-arrow-colo...
... -ms-flow-from -ms-flow-into -ms-high-contrast-adjust -ms-hyphenate-limit-chars -ms-hyphenate-limit-lines -ms-hyphenate-limit-zone -ms-ime-align -ms-overflow-style -ms-scrollbar-3dlight-color -ms-scrollbar-arrow-color -ms-scrollbar-base-color -ms-scrollbar-darkshadow-color -ms-scrollbar-face-color -ms-scrollbar-highlight-color -ms-scrollbar-shadow-color -ms-scrollbar-
track-color -ms-scroll-chaining -ms-scroll-limit -ms-scroll-limit-x-max -ms-scroll-limit-x-min -ms-scroll-limit-y-max -ms-scroll-limit-y-min -ms-scroll-rails -ms-scroll-snap-points-x -ms-scroll-snap-points-y -ms-scroll-snap-x -ms-scroll-snap-y -ms-scroll-translation -ms-text-autospace -ms-touch-select -ms-wrap-flow -ms-wrap-margin -ms-wrap-through zoom pseudo-elements ::-ms-b...
...nts-x -ms-scroll-snap-points-y -ms-scroll-snap-x -ms-scroll-snap-y -ms-scroll-translation -ms-text-autospace -ms-touch-select -ms-wrap-flow -ms-wrap-margin -ms-wrap-through zoom pseudo-elements ::-ms-browse ::-ms-check ::-ms-clear ::-ms-expand ::-ms-fill ::-ms-fill-lower ::-ms-fill-upper ::-ms-reveal ::-ms-thumb ::-ms-ticks-after ::-ms-ticks-before ::-ms-tooltip ::-ms-
track ::-ms-value media features -ms-high-contrast css-related dom apis mscontentzoomfactor msgetpropertyenabled msgetregioncontent msrangecollection msregionoverflow ...
Mozilla CSS extensions - CSS: Cascading Style Sheets
as firefox support a number of special mozilla extensions to css, including properties, values, pseudo-elements and pseudo-classes, at-rules, and media queries. these extensions are prefixed with -moz-. mozilla-only properties and pseudo-classes (avoid using on websites) note: these properties and pseudo-classes will only work in mozilla applications such as firefox, and are not on a standards
track. some of them apply only to xul elements. b -moz-binding -moz-border-bottom-colors -moz-border-left-colors -moz-border-right-colors -moz-border-top-colors -moz-box-align -moz-box-direction -moz-box-flex -moz-box-ordinal-group -moz-box-orient -moz-box-pack c–i -moz-context-properties -moz-float-edge -moz-force-broken-image-icon -moz-image-region o -moz-orie...
...-moz-window-titlebar -moz-window-titlebar-maximized progressbar progresschunk radio radio-container radio-label radiomenuitem resizer resizerpanel scale-horizontal scalethumb-horizontal scalethumb-vertical scale-vertical scrollbarbutton-down scrollbarbutton-left scrollbarbutton-right scrollbarbutton-up scrollbar-small scrollbarthumb-horizontal scrollbarthumb-vertical scrollbar
track-horizontal scrollbar
track-vertical separator spinner spinner-downbutton spinner-textfield spinner-upbutton statusbar statusbarpanel tab tabpanels tab-scroll-arrow-back tab-scroll-arrow-forward textfield textfield-multiline toolbar toolbarbutton-dropdown toolbox tooltip treeheadercell treeheadersortarrow treeitem treetwisty treetwistyopen treeview window background-imag...
...ale-dir(ltr) :-moz-locale-dir(rtl) :-moz-lwtheme :-moz-lwtheme-brighttext :-moz-lwtheme-darktext n – r :-moz-native-anonymous :-moz-only-whitespace ::-moz-page ::-moz-page-sequence ::-moz-pagebreak ::-moz-pagecontent :-moz-placeholderobsolete since gecko 51 ::-moz-placeholderdeprecated since gecko 51 ::-moz-progress-bar ::-moz-range-progress ::-moz-range-thumb ::-moz-range-
track :-moz-read-only :-moz-read-write s ::-moz-scrolled-canvas ::-moz-scrolled-content ::-moz-scrolled-page-sequence ::-moz-selectiondeprecated since gecko 62 :-moz-submit-invalid :-moz-suppressed ::-moz-svg-foreign-content t ::-moz-table ::-moz-table-cell ::-moz-table-column ::-moz-table-column-group ::-moz-table-outer ::-moz-table-row ::-moz-table-row-group :-moz-tree-ce...
fit-content() - CSS: Cascading Style Sheets
fit-content() css function clamps a given size to an available size according to the formula min(maximum size, max(minimum size, argument)). the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the function can be used as a
track size in css grid properties, where the maximum size is defined by max-content and the minimum size by auto, which is calculated similar to auto (i.e., minmax(auto, max-content)), except that the
track size is clamped at argument if it is greater than the auto minimum. the function can also be used as laid out box size for width, height, min-width, min-height, max-width and max-height, where the ...
... accepts a <length> or a <percentage> as an argument. /* <length> values */ fit-content(200px) fit-content(5cm) fit-content(30vw) fit-content(100ch) /* <percentage> value */ fit-content(40%) values <length> an absolute length. <percentage> a percentage relative to the available space in the given axis. in grid properties it is relative to the inline size of the grid container in column
tracks and to the block size of the grid container for row
tracks. otherwise it is relative to the available inline size or block size of the laid out box depending on the writing mode. examples sizing grid columns with fit-content html <div id="container"> <div>item as wide as the content.</div> <div> item with more text in it. because the contents of it are wider than the maximum wid...
... ...
grid - CSS: Cascading Style Sheets
ne1 line2 line3] 200px); grid: auto-flow dense 40% / [line1] minmax(20em, max-content); /* global values */ grid: inherit; grid: initial; grid: unset; values <'grid-template'> defines the grid-template including grid-template-columns, grid-template-rows and grid-template-areas. <'grid-template-rows'> / [ auto-flow && dense? ] <'grid-auto-columns'>? sets up an auto-flow by setting the row
tracks explicitly via the grid-template-rows property (and the grid-template-columns property to none) and specifying how to auto-repeat the column
tracks via grid-auto-columns (and setting grid-auto-rows to auto). grid-auto-flow is also set to column accordingly, with dense if it’s specified. all other grid sub-properties are reset to their initial values. [ auto-flow && dense? ] <'grid-auto-row...
...grid-auto-flow is also set to row accordingly, with dense if it’s specified. ...
...grid-auto-flow is also set to row accordingly, with dense if it’s specified. ...
scrollbar-color - CSS: Cascading Style Sheets
the scrollbar-color css property sets the color of the scrollbar
track and thumb. the
track refers to the background of the scrollbar, which is generally fixed regardless of the scrolling position. the thumb refers to the moving part of the scrollbar, which usually floats on top of the
track. syntax /* keyword values */ scrollbar-color: auto; scrollbar-color: dark; scrollbar-color: light; /* <color> values */ scrollbar-color: rebeccapurple green; /* two valid colors. the first applies to the thumb of the scrollbar, the second to the
track. */ /* global values */ scrollbar-color: inherit; scrollbar-color: initial; scrollbar-color: unset; values <scrollbar-color> defines the color of the scrollbar. ...
...lbar-color: light; /* <color> values */ scrollbar-color: rebeccapurple green; /* two valid colors. the first applies to the thumb of the scrollbar, the second to the
track. */ /* global values */ scrollbar-color: inherit; scrollbar-color: initial; scrollbar-color: unset; values <scrollbar-color> defines the color of the scrollbar. auto default platform rendering for the
track portion of the scrollbar, in the absence of any other related scrollbar color properties. dark show a dark scrollbar, which can be either a dark variant of scrollbar provided by the platform, or a custom scrollbar with dark colors. light show a light scrollbar, which can be either a light variant of scrollbar provided by the platform, or a custom scrollbar with lig...
...dark scrollbar, which can be either a dark variant of scrollbar provided by the platform, or a custom scrollbar with dark colors. light show a light scrollbar, which can be either a light variant of scrollbar provided by the platform, or a custom scrollbar with light colors. <color> <color> applies the first color to the scrollbar thumb, the second to the scrollbar
track. note: user agents must apply any scrollbar-color value set on the root element to the viewport. accessibility concerns when using scrollbar-color property with specific color values, authors should ensure the specified colors have enough contrast between them. for keyword values, uas should ensure the colors they use have enough contrast. see techniques for wcag 2.0: g183: us...
Audio and Video Delivery - Developer guides
ignored by some mobile browsers. for further info see cross browser audio basics (html5 audio in detail) html video <video controls width="640" height="480" poster="initialimage.png" autoplay muted> <source src="videofile.mp4" type="video/mp4"> <!-- fallback for browsers that don't support mp4 --> <source src="videofile.webm" type="video/webm"> <!-- specifying subtitle files --> <
track src="subtitles_en.vtt" kind="subtitles" srclang="en" label="english"> <
track src="subtitles_no.vtt" kind="subtitles" srclang="no" label="norwegian"> <!-- fallback for browsers that don't support video tag --> <a href="videofile.mp4">download video</a> </video> the code above creates a video player of dimensions 640x480 pixels, displaying a poster image until the video is played. we instru...
...ntnode.replacechild(d, v); }, false); audio/video javascript libraries a number of audio and video javascript libaries exist. the most popular libraries allow you to choose a consistent player design over all browsers and provide a fallback for browsers that don't support audio and video natively. fallbacks often use adobe flash or microsoft silverlight plugins. other functionality such as the
track element for subtitles can also be provided through media libraries. audio only soundmanager amplitudejs howlerjs video only flowplayer: gratis with a flowplayer logo watermark. open source (gpl licensed.) jwplayer: requires registration to download. open source edition (creative commons license.) sublimevideo: requires registration. form based set up with domain specific link to cdn ...
...would you do that? this article explains how, looking at two of the most common formats: mpeg-dash and hls (http live streaming.) dash adaptive streaming for html 5 video details how to set up adaptive streaming using dash and webm. advanced tutorials adding captions and subtitles to html5 video this article explains how to add captions and subtitles to html5 <video>, using web_video_text_
tracks_format and the <
track> element. writing web audio api code that works in every browser a guide to writing cross browser web audio api code. h.264 support in firefox this article explains the state of support for the h.264 video format in firefox/firefox os, including code examples, tips and tricks. easy audio capture with the mediarecorder api explains the basics of using the mediarecorder...
HTML attribute reference - HTML: Hypertext Markup Language
nt must agree to enforce upon itself. data <object> specifies the url of the resource. data-* global attribute lets you attach custom attributes to an html element. datetime <del>, <ins>, <time> indicates the date and time associated with the element. decoding <img> indicates the preferred method to decode the image. default <
track> indicates that the
track should be enabled unless the user's preferences indicate something different. defer <script> indicates that the script should be executed after the page has been parsed. dir global attribute defines the text direction. allowed values are ltr (left-to-right) or rtl (right-to-left) dirname <input>, <textarea> disabl...
...ent or its contents. the attribute can be used with form controls (such as the value of textarea elements), or in elements in an editing host (e.g., using contenteditable attribute). ismap <img> indicates that the image is part of a server-side image map. itemprop global attribute keytype <keygen> specifies the type of key generated. kind <
track> specifies the kind of text
track. label <optgroup>, <option>, <
track> specifies a user-readable title of the element. lang global attribute defines the language used in the element. language <script> defines the script language used in the element. loading <img>, <iframe> indicates if the element should be loaded lazily (loading="l...
...hen it's the number of characters. sizes <link>, <img>, <source> slot global attribute assigns a slot in a shadow dom shadow tree to an element. span <col>, <colgroup> spellcheck global attribute indicates whether spell checking is allowed for the element. src <audio>, <embed>, <iframe>, <img>, <input>, <script>, <source>, <
track>, <video> the url of the embeddable content. srcdoc <iframe> srclang <
track> srcset <img>, <source> one or more responsive image candidates. start <ol> defines the first number if other than 1. step <input> style global attribute defines css styles which will override styles previously set. su...
itemprop - HTML: Hypertext Markup Language
erties to an item. every html element can have an itemprop attribute specified, and an itemprop consists of a name-value pair. each name-value pair is called a property, and a group of one or more properties forms an item. property values are either a string or a url and can be associated with a very wide range of elements including <audio>, <embed>, <iframe>, <img>, <link>, <object>, <source> , <
track>, and <video>. examples the example below shows the source for a set of elements marked up with itemprop attributes, followed by a table showing the resulting structured data. html <div itemscope itemtype="http://schema.org/movie"> <h1 itemprop="name">avatar</h1> <span>director: <span itemprop="director">james cameron</span> (born august 16, 1954)</span> <span itemprop="genre">s...
...rsed as multiple tokens. values the property value of a name-value pair is as given for the first matching case in the following list: if the element has an itemscope attribute the value is the item created by the element. ...
...ent the value is the value of the element's value attribute if the element is a time element the value is the element's datetime value otherwise the value is the element's textcontent. if a property's value is a url, the property must be specified using a url property element. the url property elements are the a, area, audio, embed, iframe, img, link, object, source,
track, and video elements. name order names are unordered relative to each other, but if a particular name has multiple values, they do have a relative order. in the following example, the "a" property has the values "1" and "2", in that order, but whether the "a" property comes before the "b" property or not is not important <div itemscope> <p itemprop="a">1</p> <p itemprop="a">2</p> <p itempro...
Index - HTTP
reviously sent by the server with the set-cookie header. 55 cookie2 http, obsolete, reference, header, request the obsolete cookie2 http request header used to advise the server that the user agent understands "new-style" cookies, but nowadays user agents will use the cookie header instead, not this one. 56 dnt dnt, http, reference, header the dnt (do not
track) request header indicates the user's
tracking preference. it lets users indicate whether they would prefer privacy rather than personalized content. 57 date general header, http, reference, header the date general http header contains the date and time at which the message was originated. 58 etag http, reference, response, header the etag http response he...
...intuitive). 105 timing-allow-origin cors, http, reference, timing-allow-origin, header the timing-allow-origin response header specifies origins that are allowed to see values of attributes retrieved via features of the resource timing api, which would otherwise be reported as zero due to cross-origin restrictions. 106 tk dnt, http, reference, response, header,
tracking the tk response header indicates the
tracking status that applied to the corresponding request. 107 trailer http, reference, header the trailer response header allows the sender to include additional fields at the end of chunked messages in order to supply metadata that might be dynamically generated while the message body is sent, such as a message integrity check, ...
...n requesting a fresh one from the origin server. it is used by the server to indicate which headers it used when selecting a representation of a resource in a content negotiation algorithm. 113 via http, reference, header the via general header is added by proxies, both forward and reverse proxies, and can appear in the request headers and the response headers. it is used for
tracking message forwards, avoiding request loops, and identifying the protocol capabilities of senders along the request/response chain. 114 www-authenticate http, http header, reference, response header, header the http www-authenticate response header defines the authentication method that should be used to gain access to a resource. 115 warning general header, ht...
HTTP resources and specifications - HTTP
cookies from non-secure origins ietf draft rfc 2145 use and interpretation of http version numbers informational rfc 6585 additional http status codes proposed standard rfc 7538 the hypertext transfer protocol status code 308 (permanent redirect) proposed standard rfc 7725 an http status code to report legal obstacles on the standard
track rfc 2397 the "data" url scheme proposed standard rfc 3986 uniform resource identifier (uri): generic syntax internet standard rfc 5988 web linking defines the link header proposed standard experimental spec hypertext transfer protocol (http) keep-alive header informational (expired) draft spec http client hints ietf dr...
... http protocol. proposed standard rfc 8446 the transport layer security (tls) protocol version 1.3 supersedes tls 1.2. proposed standard rfc 2817 upgrading to tls within http/1.1 proposed standard rfc 7540 hypertext transfer protocol version 2 (http/2) proposed standard rfc 7541 hpack: header compression for http/2 on the standard
track rfc 7838 http alternative services on the standard
track rfc 7301 transport layer security (tls) application-layer protocol negotiation extension used to negotiate http/2 at the transport to save an extra request/response round trip. proposed standard rfc 6454 the web origin concept proposed standard fetchthe definition of 'cors' in that s...
... using the restful pattern nowadays. ...
Keyed collections - JavaScript
een used to map strings to values. objects allow you to set keys to values, retrieve those values, delete keys, and detect whether something is stored at a key. map objects, however, have a few more advantages that make them better maps. the keys of an object are strings or symbols, where they can be of any value for a map. you can get the size of a map easily, while you have to manually keep
track of size for an object. the iteration of maps is in insertion order of the elements. an object has a prototype, so there are default keys in the map. (this can be bypassed using map = object.create(null).) these three tips can help you to decide whether to use a map or an object: use maps over objects when keys are unknown until run time, and when all keys are the same type and all values a...
...a lot of situations. the new set object, however, has some advantages: deleting array elements by value (arr.splice(arr.indexof(val), 1)) is very slow. set objects let you delete elements by their value. with an array, you would have to splice based on an element's index. the value nan cannot be found with indexof in an array. set objects store unique values. you don't have to manually keep
track of duplicates. weakset object weakset objects are collections of objects. an object in the weakset may only occur once. it is unique in the weakset's collection, and objects are not enumerable. the main differences to the set object are: in contrast to sets, weaksets are collections of objects only, and not of arbitrary values of any type. the weakset is weak: references to objects in the...
...ces to objects in the collection are held weakly. if there is no other reference to an object stored in the weakset, they can be garbage collected. that also means that there is no list of current objects stored in the collection. weaksets are not enumerable. the use cases of weakset objects are limited. they will not leak memory, so it can be safe to use dom elements as a key and mark them for
tracking purposes, for example. key and value equality of map and set both the key equality of map objects and the value equality of set objects, are based on the "same-value-zero algorithm": equality works like the identity comparison operator ===. -0 and +0 are considered equal. nan is considered equal to itself (contrary to ===). « previousnext » ...
The "codecs" parameter in common media types - Web media technologies
at a fundamental level, you can specify the type of a media file using a simple mime type, such as video/mp4 or audio/mpeg. however, many media types—especially those that support video
tracks—can benefit from the ability to more precisely describe the format of the data within them. for instance, just describing a video in an mpeg-4 file with the mime type video/mp4 doesn't say anything about what format the actual media within takes. for that reason, the codecs parameter can be added to the mime type describing media content. with it, container-specific information can be provided. this information may include things like the profile of the video codec, the type used for the audio
tracks, and so forth. this guide briefly examines the syntax of the media type codecs parameter and how it...
...o so, append a semicolon (;) followed by codecs= and then the string describing the format of the contents of the file. some media types only let you specify the names of the codecs to use, while others allow you to specify various constraints on those codecs as well. you can specify multiple codecs by separating them with commas. audio/ogg; codecs=vorbis an ogg file containing a vorbis audio
track. video/webm; codecs="vp8, vorbis" a webm file containing vp8 video and/or vorbis audio. video/mp4; codecs="avc1.4d002a" an mpeg-4 file containing avc (h.264) video, main profile, level 4.2. as is the case with any mime type parameter, codecs must be changed to codecs* (note the asterisk character, *) if any of the properties of the codec use special characters which must be percent-encoded ...
...imaries, transfer characteristics, and matrix coefficients. studio swing representation. iso base media file format: mp4, quicktime, and 3gp all media types based upon the iso base media file format (iso bmff) share the same syntax for the codecs parameter. these media types include mpeg-4 (and, in fact, the quicktime file format upon which mpeg-4 is based) as well as 3gp. ...
tabs - Archive of obsolete content
tabs.on('open', function onopen(tab) { myopentabs.push(tab); }); // listen for tab content loads. ...
... console.log(tab.title); you can also access individual tabs by index: var tabs = require('sdk/tabs'); tabs.on('ready', function () { console.log('first: ' + tabs[0].title); console.log('last: ' + tabs[tabs.length-1].title); }); you can access the currently active tab: var tabs = require('sdk/tabs'); tabs.on('activate', function () { console.log('active: ' + tabs.activetab.url); });
track a single tab given a tab, you can register event listeners to be notified when the tab is closed, activated or deactivated, or when the page hosted by the tab is loaded or retrieved from the "back-forward cache": var tabs = require("sdk/tabs"); function onopen(tab) { console.log(tab.url + " is open"); tab.on("pageshow", logshow); tab.on("activate", logactivate); tab.on("deactivate", lo...
widget - Archive of obsolete content
appearance immediately. however, if the widget was created using content, then this property is meaningless, and setting it has no effect. setting the contenturl property will break the channel of communication between this widget and any content scripts it contains. messages sent from the content script will no longer be received by the main add-on code, and vice versa. this issue is currently
tracked as bug 825434. panel a panel to open when the user clicks on the widget. width the widget's width in pixels. setting it updates the widget's appearance immediately. tooltip the text of the tooltip that appears when the user hovers over the widget. allow a object describing permissions for the content. it contains a single key named script whose value is a boolean that indicates whether ...
... appearance immediately. however, if the widget was created using content, then this property is meaningless, and setting it has no effect. setting the contenturl property will break the channel of communication between this widget and any content scripts it contains. messages sent from the content script will no longer be received by the main add-on code, and vice versa. this issue is currently
tracked as bug 825434. panel a panel to open when the user clicks on the widget view. width the widget view's width in pixels. setting it updates the widget view's appearance immediately. tooltip the text of the tooltip that appears when the user hovers over the widget view. allow a object describing permissions for the content. it contains a single key named script whose value is a boolean tha...
ui/frame - Archive of obsolete content
hem directly from the frame's html content, as with a normal web page: <script type="text/javascript" src="frame.js"></script> as usual, the path to the script is relative to the html file's location. messages logged from a frame script using the console will not appear in the terminal when you run the add-on using jpm run. however, they will appear in the browser console. this issue is being
tracked as bug 982385. communicating with frames you can exchange messages between the main add-on code and scripts loaded into the frame using an api modeled on window.postmessage(). a frame creates a separate iframe instance for each browser window. so there are three cases to consider: sending messages from a frame script to the main add-on code sending messages from the main add-on code to a...
...me } = require("sdk/ui/frame"); var self = require("sdk/self"); var frame1 = new frame({ url: require("sdk/self").data.url("content1.html") }); var frame2 = new frame({ url: "./content2.html" }); optional options: name type name string the frame's name. this must be unique within your add-on. this is used to generate an id to to keep
track of the frame. if you don't supply a name, the id is derived from the frame's url, meaning that if you don't supply a name, you may not create two frames with the same url. onattach function assign a listener to the frame's attach event. ondetach function assign a listener to the frame's detach event. onload function assign a ...
Creating annotations - Archive of obsolete content
addons/2011/02/04/ overview-amo-review-process/. you should see the highlight appearing when you move the mouse over certain elements: click on the highlight and you should see something like this in the console output: info: show info: http://blog.mozilla.com/addons/2011/02/04/overview-amo-review-process/, post-2249,when you submit a new add-on, you will have to choose between 2 review
tracks: full review and preliminary review. annotation editor panel so far we have a page-mod that can highlight elements and send information about them to the main add-on code. next we will create the editor panel, which enables the user to enter an annotation associated with the selected element. we will supply the panel's content as an html file, and will also supply a content script to execute...
...ivate the annotator, move your mouse over an element and click the element when it is highlighted. you should see a panel with a text area for a note: enter the note and press the return key: you should see console output like this: info: http://blog.mozilla.com/addons/2011/02/04/overview-amo-review-process/, post-2249,when you submit a new add-on, you will have to choose between 2 review
tracks: full review and preliminary review. info: we should ask for full review if possible. that's a complete annotation, and in the next section we'll deal with storing it. ...
Troubleshooting - Archive of obsolete content
check your firefox jpm searches well known locations on your system for firefox. jpm may not have found an installation, or if you have multiple installations, jpm may have found the wrong one. in those cases you need to use jpm's --binary option. see the jpm guide for more information. when you run jpm to test your add-on or run unit tests, it prints out the location of the firefox or xulrunner binary that it found, so you can check its output to be sure. ...
... ...
Examples and demos from articles - Archive of obsolete content
o standardize the creation of complete rich-text editors in web pages. [article] typewriter effect [html] the following example will delete and re-type simulating a typewriter all the text content of the nodelist which match a specified group of selectors. [article] fade in/out [html] sometimes a page uses dozens and dozens of animations. in such a condition is difficult and unnatural to keep
track of all events started and then to stop them when appropriate through the cleartimeout() function. a possible approach to solve this problem is to nest all the informations needed by each animation to start, stop, etc. etc. in different objects and then to create a constructor for such class of objects in order to standardize and simplify the instantiation of them. here is a possible and minimali...
...ar on the web. autogrowing <textarea> this example shows how to make a textarea really autogrowing during a typing. insert some custom text in a <textarea> this example shows how to insert some html tags or smiles or any custom text in a textarea. using setinterval within animations sometimes a page uses dozens and dozens of animations. in such a condition is difficult and unnatural to keep
track of all events started and then to stop them when appropriate through the cleartimeout() function. a possible approach to solve this problem is to nest all the informations needed by each animation to start, stop, etc. etc. in different objects and then to create a constructor for such class of objects in order to standardize and simplify the instantiation of them. convert relative paths to absol...
MMgc - Archive of obsolete content
would be needed for a generational collector. deferred reference counting (drc) mmgc uses deferred reference counting (drc). drc is a scheme for getting more immediate reclamation of objects, while still achieving high performance and getting the other benefits of garbage collection. ...
...problem: circular references reference counting falls down when circular references occur in objects. ...
Bookmark Keywords - Archive of obsolete content
the key to this ability, if you'll pardon the pun, is the ability to add a keyword to any mozilla bookmark. ...
...le bookmark..." option in the contextual menu that pops up. once that's been done, making the keymark work is a simple matter of going into the bookmark manager and adding a keyword! bookmark suggested keywords find bugzilla entry bug, bugzilla, bz search devmo devmo, de google search google, gg dictionary search dictionary, dict, define, word thesaurus search thesaurus, like fedex
tracking fedex ups
tracking ups of course, these are just a beginning. any web site that you commonly search is a candidate for its own keymark. acknowledgements thanks to asa dotzler and his article how cool are custom keywords?, which provided the inspiration to write this article. original document information author(s): eric a. meyer, netscape communications last updated date: publishe...
Repackaging Firefox - Archive of obsolete content
. the distro extension all the changes you will want to make (for example, changing the default homepage or adding default bookmarks) can be encapsulated into a firefox extension. we call this extension a "distro extension" (sometimes abbreviated as "dex"), because it is used to create a new "distribution" of firefox, with different branding, etc. using an extension makes it far easier to keep
track of your changes easily when the time comes to upgrade to new versions of firefox, and also ensures, when set-up correctly, that users are able to safely receive firefox updates from mozilla. more about this below. while the aim of this article is not to fully document how to make an extension (for that, try this section of the mozilla developer center), here is a basic tutorial to get you starte...
...t preference. therefore, if *all* of your preferences can use the same values, you do not need to include any properties files at all. note that you must know which preferences are localizable and which ones aren't. see the mdc documentation for more information on them. important extension preferences there is a small set of preferences which will be given to you by mozilla. they help mozilla
track your distribution, and plan upgrades accordingly. they allow for upgrades to be delivered by mozilla specifically for your distribution, if need be, and because of that they are the most important preferences you need to set. mozilla will provide you with the values you will need here. note that the app.partner.'name' setting uses the same value for both the name and the value of the preference.
Tamarin build documentation - Archive of obsolete content
as some tamarin source files have more than the eclipse standard threshold of 5000, they do not appear as indexed. the threshold can be adjusted in eclipse preferences >> c/c++ >> editor >> scalability. *important* project-specific settings for the cdt indexer do not appear to work (it looks like a bug in eclipse), so you have to set these manually/globally. what we want is to have the indexer
track the currently selected build config (so the correct conditional compiles are highlighted in the editor). to enable this go to eclipse preferences >> c/c++ >> indexer, then select 'use active build configuration' in the 'build configuration for the indexer' section. importing the project into eclipse file >> import >> general >> existing projects into workspace click next the root directory...
...all are available from the run menu. note: if you receive an error when trying to run/debug a newly imported project, try opening a file in the project first ...
Building Trees - Archive of obsolete content
than generate content for every row in the tree, the results are stored in a list inside the builder. this means that dom nodes are not constructed for any of the items. this is much more efficient; creating large numbers of dom nodes adds a lot of overhead. the performance advantage is possible since trees only display text. as a result, the builder only has a few pieces of information to keep
track of. to use the tree builder, you need to add a flags attribute to the root node: <tree datasources="template-guide-streets.rdf" ref="http://www.xulplanet.com/rdf/myneighbourhood" flags="dont-build-content"> the dont-build-content flag causes no content to be built for the template. but moreover, it uses a subtype of the main builder called the tree builder. without this flag, the tem...
...nce. in the example above, it changes the height of a row to 150 pixels. you may want to change the syntax to refer to a specific treechildren element rather than all of them. once the row height is changed, we can see the full photos. note: if you want to have the state of the disclosure triangles ("twisties") be persistent, be sure to give each node a unique "id" attribute. these are used to
track the current state of the disclosure triangles. support for this was introduced in gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4). using tree properties since we need to use special css for trees, the properties attribute on a cell becomes extremely useful. it can be used to define extra properties for reference later in a stylesheet. for example, if the properties attribute was set to...
XUL accessibility guidelines - Archive of obsolete content
he user should be alerted to the problem and allowed to fix the error. response time when appropriate, alert the user to time limits and allow the user to adjust a time limit or request more time. one of the miracles of modern technology is that it allows people with even the most severe physical limitations to use computers. some users use mouth sticks or movement detection devices such as eye
tracking to type. this process can be slow. other users need time to cognitively process what is happening in the application. testing human computer interaction ensure that help documentation is up to date. verify that alerts are displayed through appropriate xul elements. ensure the user is informed of any user based errors and that instruction and opportunity for reperforming error causing actions...
...uction to fix the error. no error alerts exist, or inadequate instruction is provided. response time user is informed of time limits and has control of response time when appropriate. user is not notified of time limits and/or has no control over response time when appropriate. media checkpoint pass fail audio transcripts are provided for audio
tracks. no transcript provided. video video is captioned and a transcript is provided. no captions and/or transcripts provided. animation user has control over animation and is warned about flashing content. no control over animation or warnings about flashing exist. other checkpoint pass fail custom widgets custom widgets provide acce...
prefpane - Archive of obsolete content
methods domelement getpreferenceelement(in domelement startelement) preferenceforelement( uielement ) return type: preference element returns the preference element to which a user interface element is attached. void userchangedvalue(in domelement element); the user changed the value in a widget that the preferences system does not automatically
track state changes for (1) and the preference element associated with the widget should be updated based on the state held by the widget. for example, if you are using a listbox and the user changes the contents of the listbox (such as adding or removing an item) and you want to sync the changes back to a preference, you must write an onsynctopreference handler for your listbox that returns the value ...
...adding or removing an item) and you want to sync the changes back to a preference, you must write an onsynctopreference handler for your listbox that returns the value to be written to the preference element, and then call the userchangedvalue function every time you edit the list in a way that should cause the preference's value to change. (1) an example of a widget that has state changes
tracked for it includes the checkbox element, whose state is
tracked automatically when the "command" event fires. void writepreferences(in boolean flushtodisk); writes all changes in this pane to preferences, optionally flushes to disk. inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getatt...
NPP_Write - Archive of obsolete content
ite either: if the plug-in requested a normal-mode stream, the data in the stream is delivered to the plug-in instance in a series of calls to npp_writeready and npp_write. if the plug-in requested a seekable stream, the npn_requestread function requests reads of a specified byte range that results in a series of calls to npp_writeready and npp_write. ...
...eter to
track the bytes that are written. this gives you different information depending in the type of stream. in a normal-mode stream., the parameter value increases as the each buffer is written. the buf parameter is not persistent, so the plug-in must process data immediately or allocate memory and save a copy of it. ...
Introduction to Public-Key Cryptography - Archive of obsolete content
server looks up the name and password in its local password database and, if they match, accepts them as evidence authenticating the user's identity. the server determines whether the identified user is permitted to access the requested resource, and if so allows the client to access it. with this arrangement, the user must supply a new password for each server, and the administrator must keep
track of the name and password for each user, typically on separate servers. proper implementation does not store passwords in plaintext. instead it concatenates the password with a random per-user value (so called "salt") and stores the hash value of the result along with the salt. this makes certain kinds of brute-force atacks more difficult. as shown in the next section, one of the advantages of c...
... users are frequently required to remember multiple passwords for the various services they use. for example, a user might have to type a different password to log into the network, collect email, use directory services, use the corporate calendar program, and access various servers. multiple passwords are an ongoing headache for both users and system administrators. users have difficulty keeping
track of different passwords, tend to choose poor ones, and tend to write them down in obvious places. administrators must keep
track of a separate password database on each server and deal with potential security problems related to the fact that passwords are sent over the network routinely and frequently. solving this problem requires some way for a user to log in once, using a single password, and...
Using workers in extensions - Archive of obsolete content
en the worker thread is started, the main body of this code (in lines 26-35) is executed. it starts by setting up an interval handler (in lines 26-28) that calls refreshinformation() every 10 minutes. then it sets the worker's onmessage event handler to a function which looks at the event passed into it, and does one of two things: if there is a data field on the event, the stock symbol being
tracked is set to the upper case version of that value. this is used to initialize the worker, and to change which stock is being monitored. if there is no data field, the refreshinformation() method is called to fetch the latest information about the stock and pass it back to the main thread. this provides a way for the main thread to specifically request that the worker update the stock information ...
...in thread, the main thread's value of this is correctly the main thread's object instead of the worker's. line 22 sends a message to the ticker thread to tell it what symbol to monitor. the observe() method this method's job is to update which stock is being monitored when the user changes the preferences. it needs to be updated to post a message to the worker to tell it which stock symbol to
track. observe: function(subject, topic, data) { if (topic != "nspref:changed") { return; } switch(data) { case "symbol": this.tickersymbol = this.prefs.getcharpref("symbol").touppercase(); this.worker.postmessage(this.tickersymbol); break; } }, the key here is line 10, which sends the new ticker symbol to monitor to the ticker thread by cal...
::-ms-fill-upper - Archive of obsolete content
a slider control is one possible representation of <input type="range">. allowable properties only the following css properties can be used in a rule with ::-ms-fill-upper in its selector. other properties are ignored. ...
... -ms-high-contrast-adjust opacity outline-color outline-style outline-width padding-bottom padding-left padding-right padding-top transform transform-origin visibility width syntax ::-ms-fill-upper specifications not part of any specification. browser compatibility historically supported in internet explorer and edge before version 79. see also ::-ms-fill-lower ::-ms-
track ::-ms-thumb ::-moz-range-progress css-tricks: styling cross-browser compatible range inputs with css quirksmode: styling and scripting sliders ...
::-ms-thumb - Archive of obsolete content
a slider control is one possible representation of <input type="range">. allowable properties only the following css properties can be used in a rule with ::-ms-thumb in its selector. other properties are ignored. ...
...eight height margin-bottom margin-left margin-right margin-top -ms-background-position-x -ms-background-position-y -ms-high-contrast-adjust opacity outline-color outline-style outline-width padding-bottom padding-left padding-right padding-top transform transform-origin visibility width syntax ::-ms-thumb specifications not part of any specification. see also ::-ms-
track ::-ms-fill-upper ::-ms-fill-lower ::-webkit-slider-thumb ::-moz-range-thumb css-tricks: styling cross-browser compatible range inputs with css quirksmode: styling and scripting sliders ...
::-ms-ticks-after - Archive of obsolete content
to do so would create three sets of tick marks, but the best user experience is one set. to remove tick marks altogether, set the color property to transparent. ...
...to do so would create three sets of tick marks, but the best user experience is one set. to remove tick marks altogether, set the color property to transparent. ...
::-ms-ticks-before - Archive of obsolete content
to do so would create three sets of tick marks, but the best user experience is one set. to remove tick marks altogether, set the color property to transparent. ...
...to do so would create three sets of tick marks, but the best user experience is one set. to remove tick marks altogether, set the color property to transparent. ...
Anatomy of a video game - Game development
e semicolon is in case whatever line of code above this example * relied on automatic semicolon insertion (asi). the browser could accidentally * think this whole example continues from the previous line. the leading semicolon * marks the beginning of our new line if the previous one was not empty or terminated. * * let us also assume that mygame is previously defined. * * mygame.lastrender keeps
track of the last provided requestanimationframe timestamp. * mygame.lasttick keeps
track of the last update time. always increments by ticklength. * mygame.ticklength is how frequently the game state updates. it is 20 hz (50ms) here. * * timesincetick is the time between requestanimationframe callback and last update. * numticks is how many updates should have happened between these two rendered frame...
...unction () { function main( tframe ) { mygame.stopmain = window.requestanimationframe( main ); var nexttick = mygame.lasttick + mygame.ticklength; var numticks = 0; // if tframe < nexttick then 0 ticks need to be updated (0 is default for numticks). // if tframe = nexttick then 1 tick needs to be updated (and so forth). // note: as we mention in summary, you should keep
track of how large numticks is. // if it is large, then either your game was asleep, or the machine cannot keep up. if (tframe > nexttick) { var timesincetick = tframe - mygame.lasttick; numticks = math.floor( timesincetick / mygame.ticklength ); } queueupdates( numticks ); render( tframe ); mygame.lastrender = tframe; } function queueupdates( numticks ) { ...
Index - Game development
vascript engine to compile the asm.js off the main thread when the game is loading and cache the generated machine code so that the game doesn't need to be compiled on subsequent loads (starting in firefox 28). to see the difference, toggle javascript.options.parallel_parsing in about:config. 26 audio for web games audio, games, web audio api, audio sprites, spatialization, syncing
tracks audio is an important part of any game; it adds feedback and atmosphere. web-based audio is maturing fast, but there are still many browser differences to navigate. we often need to decide which audio parts are essential to our games' experience and which are nice to have but not essential, and devise a strategy accordingly. this article provides a detailed guide to implementing audio for ...
...ke how movement works with the movies. 68 paddle and keyboard controls beginner, canvas, controls, games, graphics, javascript, tutorial, keyboard the ball is bouncing off the walls freely and you can watch it indefinitely, but currently there's no interactivity. it's not a game if you cannot control it! so let's add some user interaction: a controllable paddle. 69
track the score and win beginner, canvas, games, javascript, tutorial, scoring, winning destroying the bricks is really cool, but to be even more awesome the game could award points for every brick a user hits, and keep count of the total score. 70 2d maze game with device orientation canvas, device orientation api, game development, html5, phaser, vibration api i hope th...
Efficient animation for web games - Game development
dow.settimeout. assuming you are running in an arbitrary browsing session, you can never really know how long the browser will take to draw a particular frame. requestanimationframe causes the browser to redraw and call your function before that frame gets to the screen. the downside of using this vs. settimeout is that your animations must be time-based instead of frame-based, i.e. you must keep
track of time and set your animation properties based on elapsed time. requestanimationframe includes a domhighrestimestamp in its callback function prototype, which you definitely should use (as opposed to using the date object), as this will be the time the frame began rendering, and ought to make your animations look more fluid. you may have a callback that ends up looking something like this: var ...
...e start before the frame is processed are synchronised. to save battery life, it is best to only draw when there are things going on, so that would mean calling requestanimationframe (or your refresh function, which in turn calls that) in response to events happening in your game. unfortunately, this makes it very easy to end up drawing things multiple times per frame. we would recommend keeping
track of when requestanimationframe has been called and only having a single handler for it. there aren’t solid guarantees of what order things will be called in with requestanimationframe (though, in our experience, it is in the order in which they were requested), so this also helps cut out any ambiguity. an easy way to do this is to declare your own refresh function that sets a flag when it calls ...
Gecko FAQ - Gecko Redirect 1
ll.) known bugs in the open-source gecko codebase are documented in bugzilla. here are some links to lists of reported bugs related to the standards mentioned above; be aware that these raw lists of open in-process bugs will inevitably include some duplicate, out of date, unreproducible, invalid, and incorrectly tagged reports: the links themselves are probably outdated too. ...
...gs will inevitably include some duplicate, out of date, unreproducible, invalid, and incorrectly tagged reports: the links themselves are probably outdated too. ...
Grid - MDN Web Docs Glossary: Definitions of Web-related terms
d using the grid value of the display property; you can define columns and rows on your grid using the grid-template-rows and grid-template-columns properties. the grid that you define using these properties is described as an explicit grid. ...
...property; you can define columns and rows on your grid using the grid-template-rows and grid-template-columns properties. the grid that you define using these properties is described as an explicit grid. if you place content outside of this explicit grid, or if you are relying on auto-placement and the grid algorithm needs to create additional row or column
tracks to hold grid items, then extra
tracks will be created in the implicit grid. the implicit grid is the grid created automatically due to content being added outside of the
tracks defined. in the example below i have created an explicit grid of three columns and two rows. the third row on the grid is an implicit grid row
track, formed due to their being more than the six items which fill the explicit
tracks. * {box-sizing: border-b...
Test your skills: Grid Layout - Learn web development
h as codepen, jsfiddle, or glitch to work on the tasks. if you get stuck, then ask us for help — see the assessment or further help section at the bottom of this page. grid layout one in this task you should create a grid into which the four child elements will auto-place. ...
...between the column and row
tracks. try updating the live code below to recreate the finished example: for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor. grid layout two in this example we already have a grid defined. by editing the css rules for the two child elements, cause them to span over several grid
tracks each; the second item should overlay the first as in the image below. try updating the live code below to recreate the finished example: additional questions: can you now cause the first item to display on top without changing the order of items in the source? for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online...
Introduction to CSS layout - Learn web development
x is designed for one-dimensional layout, grid layout is designed for two dimensions — lining things up in rows and columns. once again, you can switch on grid layout with a specific value of display — display: grid. the below example uses similar markup to the flex example, with a container and some child elements. in addition to using display: grid, we are also defining some row and column
tracks on the parent using the grid-template-rows and grid-template-columns properties respectively. we've defined three columns each of 1fr and two rows of 100px. i don’t need to put any rules on the child elements; they are automatically placed into the cells our grid has created. grid example 1 * {box-sizing: border-box;} .wrapper > div { border-radius: 5px; background...
... <div class="box6">six</div> </div> once you have a grid, you can explicitly place your items on it, rather than relying on the auto-placement behavior seen above. in the second example below we have defined the same grid, but this time with three child items. we've set the start and end line of each item using the grid-column and grid-row properties. this causes the items to span multiple
tracks. grid example 2 * {box-sizing: border-box;} .wrapper > div { border-radius: 5px; background-color: rgb(207,232,220); padding: 1em; } .wrapper { display: grid; grid-template-columns: 1fr 1fr 1fr; grid-template-rows: 100px 100px; grid-gap: 10px; } .box1 { grid-column: 2 / 4; grid-row: 1; } .box2 { grid-column: 1; gri...
Beginner's guide to media queries - Learn web development
rple; } } open this example in the browser, or view the source. if we know the user cannot hover, we could display some interactive features by default. for users who can hover, we might choose to make them available when a link is hovered over. also in level 4 is the pointer media feature. this takes three possible values, none, fine and coarse. a fine pointer is something like a mouse or
trackpad. it enables the user to precisely target a small area. a coarse pointer is your finger on a touchscreen. the value none means the user has no pointing device; perhaps they are navigating with the keyboard only or with voice commands. using pointer can help you to design better interfaces that respond to the type of interaction a user is having with a screen. for example, you could create larg...
...</ul> .grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); } .grid li { border: 1px solid #666; padding: 10px; } open the grid layout example in the browser, or view the source. with the example open in your browser, make the screen wider and narrower to see the number of column
tracks change. the nice thing about this method is that grid is not looking at the viewport width, but the width it has available for this component. it might seem strange to wrap up a section about media queries with a suggestion that you might not need one at all! however, in practice you will find that good use of modern layout methods, enhanced with media queries, will give the best results. test ...
Advanced form styling - Learn web development
ement values, so potentially suffers from the same problem. however, in the case of the number type the data being collected is simpler, and it is easy to just use a text input type instead if desired (or tel if you want mobile browsers to show the numeric keypad). range input types <input type="range"> is annoying to style. ...
...ver, in the case of the number type the data being collected is simpler, and it is easy to just use a text input type instead if desired (or tel if you want mobile browsers to show the numeric keypad). range input types <input type="range"> is annoying to style. ...
How to build custom form controls - Learn web development
run in the browser: the user has turned off javascript: this is unusual; very few people turn off javascript nowadays. the script did not load: this is one of the most common cases, especially in the mobile world where the network is not very reliable. the script is buggy: you should always consider this possibility. the script is in conflict with a third party script: this can happen with
tracking scripts or any bookmarklets the user uses. the script is in conflict with, or is affected by, a browser extension (such as firefox's noscript extension or chrome's notscripts extension). the user is using a legacy browser, and one of the features you require is not supported: this will happen frequently when you make use of cutting-edge apis. the user is interacting with the content before ...
...updated yet. we'll handle that next. live example check out the source code handling the control's value now that our control is working, we have to add code to update its value according to user input and make it possible to send the value along with form data. the easiest way to do this is to use a native control under the hood. such a control will keep
track of the value with all the built-in controls provided by the browser, and the value will be sent as usual when a form is submitted. there's no point in reinventing the wheel when we can have all this done for us. as seen previously, we already use a native select control as a fallback for accessibility reasons; we can simply synchronize its value with that of our custom control: // this function...
Cooperative asynchronous JavaScript: Timeouts and intervals - Learn web development
evious example and updating it, adding an event listener to start and stop the spinner when the mouse is clicked anywhere on the page. some hints: a click event handler can be added to most elements, including the document <body>. it makes more sense to put it on the <body> element if you want to maximize the clickable area — the event bubbles up to its child elements. you'll want to add a
tracking variable to check whether the spinner is spinning or not, clearing the animation frame if it is, and calling it again if it isn't. note: try this yourself first; if you get really stuck, check out of our live example and source code. throttling a requestanimationframe() animation one limitation of requestanimationframe() is that you can't choose your frame rate. this isn't a problem most...
... attach a keydown event listener to the document. when any button is pressed down, the keyhandler() function is run. inside keyhandler(), the code includes the event object as a parameter (represented by e) — its key property contains the key that was just pressed, and you can use this to respond to specific key presses with specific actions. set the variable isover to false, so we can
track whether the correct keys were pressed for player 1 or 2 to win. we don't want the game ending when a wrong key was pressed. log e.key to the console, which is a useful way of finding out the key value of different keys you are pressing. when e.key is "a", display a message to say that player 1 won, and when e.key is "l", display a message to say player 2 won. (note: this will only work with...
Drawing graphics - Learn web development
let sprite = 0; let posx = 0; let's explain the spritesheet image (which we have respectfully borrowed from mike thomas' create a sprite sheet walk cycle using css animation). the image looks like this: it contains six sprites that make up the whole walking sequence — each one is 102 ...
...pplication, to illustrate how the animation loop can be combined with user input (like mouse movement, in this case). we won't get you to walk through and build this one; we'll just explore the most interesting parts of the code. the example can be found on github as 8_canvas_drawing_app.html, and you can play with it live below: let's look at the most interesting parts. first of all, we keep
track of the mouse's x and y coordinates and whether it is being clicked or not with three variables: curx, cury, and pressed. when the mouse moves, we fire a function set as the onmousemove event handler, which captures the current x and y values. we also use onmousedown and onmouseup event handlers to change the value of pressed to true when the mouse button is pressed, and back to false again when i...
Adding features to our bouncing balls demo - Learn web development
nd yourself in trouble later on. project brief our bouncy ball demo is fun, but now we want to make it a little bit more interactive by adding a user-controlled evil circle, which will eat the balls if it catches them. we also want to test your object-building skills by creating a generic shape() object that our balls and evil circle can inherit from. finally, we want to add a score counter to
track the number of balls left to capture. the following screenshot gives you an idea of what the finished program should look like: to give you more of an idea, have a look at the finished example (no peeking at the source code!) steps to complete the following sections describe what you need to do. creating our new objects first of all, change your existing ball() constructor so that it be...
... creating our new objects first of all, change your existing ball() constructor so that it becomes a shape() constructor and add a new ball() constructor: the shape() constructor should define the x, y, velx, and vely properties in the same way as the ball() constructor did originally, but not the color and size properties. it should also define a new property called exists, which is used to
track whether the balls exist in the program (have not been eaten by the evil circle). this should be a boolean (true/false). the ball() constructor should inherit the x, y, velx, vely, and exists properties from the shape() constructor. it should also define a color and a size property, like the original ball() constructor did. remember to set the ball() constructor's prototype and constructor appr...
Inheritance in JavaScript - Learn web development
se features in more specialized object types can be convenient and useful. note: because of the way javascript works, with the prototype chain, etc., the sharing of functionality between objects is often called delegation. specialized objects delegate functionality to a generic object type. when using inheritance, you are advised to not have too many levels of inheritance, and to keep careful
track of where you define your methods and properties. it is possible to start writing code that temporarily modifies the prototypes of built-in browser objects, but you should not do this unless you have a really good reason. too much inheritance can lead to endless confusion, and endless pain when you try to debug such code. ultimately, objects are just another form of code reuse, like functions or ...
...n browser objects, but you should not do this unless you have a really good reason. too much inheritance can lead to endless confusion, and endless pain when you try to debug such code. ultimately, objects are just another form of code reuse, like functions or loops, with their own specific roles and advantages. if you find yourself creating a bunch of related variables and functions and want to
track them all together and package them neatly, an object is a good idea. objects are also very useful when you want to pass a collection of data from one place to another. both of these things can be achieved without use of constructors or inheritance. if you only need a single instance of an object, then you are probably better off just using an object literal, and you certainly don't need inheritan...
JavaScript performance - Learn web development
so consume the main thread, the cpu, and the battery. it can make the ui feel unresponsive or janky. we'll introduce concepts for handling that as well. download impact web applications include a lot of javascript. many applications are built with a javascrpit framework, or multiple, with several additional dependencies. often times third party scripts and apis are added, including a/b testing,
tracking pixels, and features like maps and support features. all of this javascript must be downloaded. eventually. performance optimizatins should include: reducing the amount of javascript that is needed. some features requiring complex javascript can be done with a few lines of javascript. requiring a library for other features may improve developer experience, but is all that javascript requi...
...g compresses the file further, and should be used even if you don't minify. brotli is similar to gzip, generally outperforming gzip's compression. render impact web applications include a lot of javascript. many applications are built with a javascrpit framework, or multiple, with several additional dependencies. often times third party scripts and apis are added, including a/b testing,
tracking pixels, and features like maps and support features. battery impact conclusion while optimizing your media files and scripts will get you very far along in terms of web performance optimization, everything that touches a web pages impacts performance. in the next article we take a look at some html features that can impact performance, including some attributes specifically created to impro...
Getting started with Ember - Learn web development
utions to any ember project with minimal fear of breaking code. designers and other non-developers can contribute to page templates without any knowledge of javascript, and interactivity can be added later. this language also enables lighter asset payloads due to compiling the templates into a "byte code" that can be parsed faster than javascript. the glimmer vm enables extremely fast dom change
tracking without the need to manage and diff a cached virtual representation (which is a common approach to mitigating the slow i/o of dom changes). for more information on the technical aspects of the glimmer vm, the github repository has some documentation — specifically, references and validators may be of interest. everything else in ember is just javascript. in particular, javascript classes. ...
...ct ember has on the javascript that is in typical projects: gavin demonstrates how < 20% of the js written is specific to ember. getting started the rest of the ember material you'll find here consists of a multi-part tutorial, in which we'll make a version of the classic todomvc sample app, teaching you how to use the essentials of the ember framework along the way. todomvc is a basic to-do
tracking app implemented in many different technologies. here is the completed ember version, for reference. a note on todomvc and accessibility the todomvc project has a few issues in terms of adhering to accessible/default web practices. there are a couple of github issues open about this on the todomvc family of projects: add keyboard access to demos re-enable outline on focusable elements ...
Ember resources and troubleshooting - Learn web development
w. it could be thought of as a build-time transform that wraps its argument with a setter function. ...
... as a build-time transform that wraps its argument with a setter function. more concretely, using mut allows for template-only settings functions to be declared: <checkbox @value={{this.somedata}} @ontoggle={{fn (mut this.somedata) (not this.somedata)}} /> whereas, without mut, a component class would be needed: import component from '@glimmer/component'; import {
tracked } from '@glimmer/
tracking'; import { action } from '@ember/object'; export default class example extends component { @
tracked somedata = false; @action setdata(newvalue) { this.somedata = newvalue; } } which would then be called in the template like so: <checkbox @data={{this.somedata}} @onchange={{this.setdata}} /> due to the conciseness of using mut, it may be desireable to reach for it. however, mut...
Accessibility in React - Learn web development
t’s previous state, and has provided an example custom hook we can use for the job. paste the following code near the top of todo.js, above your todo() function. function useprevious(value) { const ref = useref(); useeffect(() => { ref.current = value; }); return ref.current; } now we'll define a wasediting constant beneath the hooks at the top of todo(). ...
...ous() hook we already used earlier on. add it to the top of your app.js file, just below the imports: function useprevious(value) { const ref = useref(); useeffect(() => { ref.current = value; }); return ref.current; } now add the following, above the return statement inside the app() function: const prevtasklength = useprevious(tasks.length); here we are invoking useprevious() to
track the length of the tasks state, like so: note: since we're now utilizing useprevious() in two files, a good efficiency refactor would be to move the useprevious() function into its own file, export it from that file, and import it where you need it. try doing this as an exercise once you've got to the end. using useeffect() to control our heading focus now that we've stored how many tasks we ...
Componentizing our React app - Learn web development
at how we can make different component calls render unique content. make a unique <todo /> components are powerful because they let us re-use pieces of our ui, and refer to one place for the source of that ui. the problem is, we don't typically want to reuse all of each component; we want to reuse most parts, and change small pieces. this is where props come in. what's in a name? in order to
track the names of tasks we want to complete, we should ensure that each <todo /> component renders a unique name. in app.js, give each <todo /> a name prop. let’s use the names of our tasks that we had before: <todo name="eat" /> <todo name="sleep" /> <todo name="repeat" /> when your browser refreshes, you will see… the exact same thing as before. we gave our <todo /> some props, but we aren't ...
..., and checked properties we want to pass into our <todo /> component. if we put that knowledge together, we get code like this: const tasklist = props.tasks.map(task => ( <todo id={task.id} name={task.name} completed={task.completed} /> )); now the app looks like it did before, and our code is less repetitive. unique keys now that react is rendering our tasks out of an array, it has to keep
track of which one is which in order to render them properly. react tries to do its own guesswork to keep
track of things, but we can help it out by passing a key prop to our <todo /> components. key is a special prop that's managed by react – you cannot use the word key for any other purpose. because keys should be unique, we're going to re-use the id of each task object as its key. update your tas...
Advanced Svelte: Reactivity, lifecycle, accessibility - Learn web development
that to tell svelte that a variable has changed, you have to assign it a new value. a simple rule of thumb is that the name of the updated variable must appear on the left hand side of the assignment. for example, in the following piece of code: const foo = obj.foo foo.bar = 'baz' svelte won't update references to obj.foo.bar, unless you follow it up with obj = obj. that's because svelte can't
track object references, so we have to explicitly tell it that obj has changed by issuing an assignment. note: if foo is a top level variable, you can easily tell svelte to update obj whenever foo is changed with the following reactive statement: $: foo, obj = obj. with this we are defining foo as a dependency, and whenever it changes svelte will run obj = obj. in our checkalltodos() function, when...
...action is running when the component is created. that's not what we want — we want the edit button to receive focus only when the user has pressed save or cancel. so, go back to your todo.svelte file. first of all we'll create a flag named editbuttonpressed and initialize it to false. add this just below your other variable definitions: let editbuttonpressed = false //
track if edit button has been pressed, to give focus to it after cancel or save next, we'll modify the edit button's functionality to save this flag, and create the action for it. update the onedit() function like so: function onedit() { editbuttonpressed = true // user pressed the edit button, focus will come back to the edit button editing = true // en...
Dynamic behavior in Svelte: working with variables and props - Learn web development
development mode. repl to code along with us using the repl, start at https://svelte.dev/repl/c862d964d48d473ca63ab91709a0a5a0?version=3.23.2 working with todos our todos.svelte component is currently just displaying static markup; let's start making it a bit more dynamic. we'll take the tasks information from the markup and store it in a todos array. we'll also create two variables to keep
track of the total number of tasks and the completed tasks. the state of our component will be represented by these three top-level variables. create a <script> section at the top of src/components/todos.svelte and give it some content, as follows: <script> let todos = [ { id: 1, name: 'create a svelte starter app', completed: true }, { id: 2, name: 'create your first component', co...
...e that at the end of the function. instead, we'll take out the push() method and use spread syntax to achieve the same result — we'll assign a value to the todos array equal to the todos array plus the new object. note: array has several mutable operations — push(), pop(), splice(), shift(), unshift(), reverse(), and sort(). using them often causes side effects and bugs that are hard to
track. by using the spread syntax instead of push() we avoid mutating the array, which is considered a good practice. update your addtodo() function like so: function addtodo() { todos = [...todos, { id: 999, name: newtodoname, completed: false }] newtodoname = '' } giving each todo a unique id if you try to add new todos in your app now, you'll be able to add a new todo and have it a...
Introduction to automated testing - Learn web development
ng the mark as bug button you can push bugs to numerous third-party tools such as jira, asana, trello, and more. that way you can log a bug directly from your test session on lambdatest to your project management instance. check out all the third-party lambdatest integrations. note: all the videos and images captured inside a test session are captured inside the gallery, test logs, and issue
tracker at lambdatest. sauce labs getting started with sauce labs let's get started with a sauce labs trial. create a sauce labs trial account. sign in. this should happen automatically after you verify your e-mail address. the basics: manual tests the sauce labs dashboard has a lot of options available on it. for now, make sure you are on the manual tests tab. click start a new manual se...
...are as follows: switch — change to another platform/device/browser combination. orientation (looks like a reload icon) — switch orientation between portrait and landscape. fit to screen (looks like a full screen icon) — fill the testing areas as much as possible with the device. capture a bug (looks like a camera) — takes a screenshot, then allows you to annotate and save it. issue
tracker (looks like a deck of cards) — view previously captured bugs/screenshots. settings (cog icon) — allows you to alter general settings for the session. help (question mark) — accesses help/support functions. devtools — allows you to use your browser's devtools to directly debug or manipulate the page being shown in the test browser. this currently only works when testing the safari bro...
Handling common HTML and CSS problems - Learn web development
previous overview: cross browser testing next with the scene set, we'll now look specifically at the common cross-browser problems you will come across in html and css code, and what tools can be used to prevent problems from happening, or fix problems that occur. this includes linting code, handling css prefixes, using browser dev tools to
track down problems, using polyfills to add support into browsers, tackling responsive design problems, and more. prerequisites: familiarity with the core html, css, and javascript languages; an idea of the high level principles of cross browser testing. objective: to be able to diagnose common html and css cross browser problems, and use appropriate tools and techniques to fix them. the trouble with html and css so...
...e possible cross browser issues, especially for things like layout. however, it has more recently been seen as overkill. the best equivalent we have in modern times is normalize.css, a neat bit of css that builds slightly on the default browser styling to make things more consistent and fix some layout issues. you are advised to apply normalize.css to all your html pages. note: when trying to
track down a tricky layout issue, a good technique is to add a brightly colored outline to the offending element, or all the elements nearby. this makes it a lot easier to see where everything is placed. see debug your css with outline visualizations for more details. support for new layout features much of the layout work on the web today is done using floats — this is because floats are well-sup...
Handling common JavaScript problems - Learn web development
prerequisites: familiarity with the core html, css, and javascript languages; an idea of the high-level principles of cross browser testing. ...
...don't need to read it when it is finished! this is best done using a minification tool like uglify (there's also an online version — see jscompress.com) when using apis, make sure you turn off the api features when they are not being used; some api calls can be really expensive on processing power. for example, when showing a video stream, make sure it is turned off when you can't see it. when
tracking a device's location using repeated geolocation calls, make sure you turn it off when the user stops using it. animations can be really costly for performance. a lot of javascript libraries provide animation capabilities programmed by javascript, but it is much more cost effective to do the animations via native browser features like css animations (or the nascent web animations api) than java...
Cross browser testing - Learn web development
n, using dedicated testing apps), and testing with user groups. handling common html and css problems with the scene set, we'll now look specifically at the common cross-browser problems you will come across in html and css code, and what tools can be used to prevent problems from happening, or fix problems that occur. ...
...ening, or fix problems that occur. this includes linting code, handing css prefixes, using browser dev tools to
track down problems, using polyfills to add support into browsers, tackling responsive design problems, and more. handling common javascript problems now we'll look at common cross-browser javascript problems and how to fix them. this includes information on using browser dev tools to
track down and fix problems, using polyfills and libraries to work around problems, getting modern javascript features working in older browsers, and more. handling common accessibility problems next we turn our attention to accessibility, providing information on common problems, how to do simple testing, and how to make use of auditing/automation tools for finding accessibility issues. implementin...
Mozilla accessibility architecture
levels of the accessibility cache there are three levels in the accessibility cache: global cache of doc accessibles (gglobaldocaccessiblecache), used to get the accessible for any document. per-document cache of accessibles a cache in each nsdocaccessible (maccessnodecache), containing all of the accessible nodes created so far for each document. member variables in nsaccessible that keep
track of the number of children (maccchildcount), the parent (mparent), the first child (mfirstchild) and the next sibling (mnextsibling). if mnextsibling equals the magic value dead_end_accessible (void*)1, then there are known to be no more siblings. if mnextsiblings == nsnull, then there could still be more siblings. this architecture allows us to quickly wipe away an entire document's worth of cac...
...t get the document accessible from the global cache for the node's document, and then use that document accessible's specific cache to check for an entry for the dom node. this is not much of a problem because it is still much faster than creating a new accessible every time. this two step process is implemented in nsaccessibilityservice::getcachedaccessible(domnode). the member variables keeping
track of the number of children, parent, first child and next sibling allow us to have instant traversal around accessible nodes that have already been visited. role of nsaccessnode if you work mostly in the atk sections of our accessibility module, you may wonder what the purpose of nsaccessnode is -- there are no atk interfaces that use it. in fact, it exists because of our isimpledomnode extension ...
Testopia
testopia 3.0 (not yet released) if you upgraded to bugzilla 5.0, you probably noticed that testopia 2.5 is not compatible with this version. ...
... testopia 3.0 (not yet released) if you upgraded to bugzilla 5.0, you probably noticed that testopia 2.5 is not compatible with this version. ...
Debugging
understanding crash reports how to read crash reports, which are full of information yet often not easy to interpret and act on. debugging a minidump windows crash reports include a minidump, which contains a lot of information about the application when it crashed. debugging mozilla with valgrind valgrind is a memory debugger for mac and linux. ...
... debugging specific parts of the mozilla codebase debugging opengl if you're working on code that involves opengl calls, and need to debug it, you can turn on a special opengl debugging mode. debugging frame reflow and debugging table reflow notes on debugging issues in gecko's layout engine. ...
Developer guide
bs that run on a push to version control? how can you change that? obsolete build caveats and tips a place to put build tips which are no longer relevant to building the latest version of the code from main but are relevant when building old codebases. firefox source docs web-hosted documentation built from the mozilla-central source code. tools bugzilla the bugzilla database used to
track issues for mozilla projects. dxr next generation of searching mozilla's source code. in active development. searchfox another option for mozilla code searching. indexes js as well as c++, includes blame capabilities. in active development. mozilla build vm a virtualbox compatible virtual machine configured with all the software needed to build and work on firefox. taskcluster taskcluster ...
... task execution framework that supports mozilla's continuous integration and release processes. treeherder treeherder shows the status of the tree (whether or not it currently builds successfully). check this before checking in and out, to be sure you're working with a working tree. perfherder perfherder is used to aggregate the results of automated performance tests against the tree. crash
tracking information about the socorro crash reporting system. callgraph a tool to help perform static analysis of the mozilla code by generating callgraphs automatically. developer forums a topic-specific list of discussion forums and mailing lists where you can talk about mozilla development issues. mozilla platform development cheat sheet (archive.org) brian bondy's list of frequently referen...
Errors
this page lists the errors that can be raised due to firefox's anti-
tracking functionality, governed by the storage access policy. ...
... this page lists the errors that can be raised due to firefox's anti-
tracking functionality, governed by the storage access policy. ...
overflow-clip-box
do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. the overflow-clip-box css property specifies relative to which box the clipping happens when there is an overflow. it is short hand for the overflow-clip-box-inline and overflow-clip-box-block properties. ...
... ...
Getting from Content to Layout
sidocumentobserver and observes the document) about all nodes in the document. the frame constructor takes these notifications and does the following: dispatches "restyle events" which trigger the reprocessing of relevant css selectors and any restyling that needs to occur. adds and removes frames to make the frame tree a proper representation of the new content tree. ...
... frame construction regardless of whether content nodes are inserted/appended/deleted, frames can be created and destroyed, based on whatever is optimal for the changes in the content tree. "frame construction items" are queued for each change. ...
IPDL Tutorial
t, regardless of the messages' semantics. if an actor a sends messages m1 then m2 to actor b, b will be awoken to process m1 then m2. subprotocols and protocol management so far we've seen a single protocol, but no real-world situation would have a single protocol in isolation. instead, protocols are arranged in a managed hierarchy of subprotocols. a sub-protocol is bound to a "manager" which
tracks its lifetime and acts as a factory. a protocol hierarchy begins with a single top-level protocol from which all subprotocol actors are eventually created. in mozilla there are two main top-level protocols: ppluginmodule for remote plugins, and pcontent for remote tabs. the following example extends the toplevel plugin protocol to manage plugin instances. // ----- file pplugin.ipdl include pro...
...gin catastrophic error handling: the communication channels for the child process (tab or plugin) will be disconnected, and the process will be terminated. do not return false from message handlers for "normal" error conditions such as inability to load a network request! normal errors should be signaled with a message or return value. note: the following paragraphs are not yet implemented. ipdl
tracks all active protocols between two endpoints. if if the child side crashes or becomes hung: any synchronous or rpc messages currently active will return false no further messages will be accepted (c++ methods will return false) each ipdl actor will receive an onerror message deallocpsubprotocol will be called on each manager protocol to deallocate any active subprotocols. when a manager pr...
Localization technical reviews
s to the bug. once attached, open the attachment details. in the attachment details, select the ? from the dropdown menu next to the review flag. this will display a text box to assign the review to someone. enter :pike as the requestee. we will perform a technical review of your work and provide you with feedback. we're happy to work with you to make sure that your work is fully functional.
tracking your progress you can
track your reviews progress two ways: within the bug and through your team's dashboard. if your work is approved, you'll see a + review flag next to your attached revision in your request bug. if bugs are discovered, your technical review is rejected (- review flag) and the bugs are filed in bugzilla. once they are fixed, push your fix to your repo, attach it to the co...
... bugs are discovered, your technical review is rejected (- review flag) and the bugs are filed in bugzilla. once they are fixed, push your fix to your repo, attach it to the corresponding bug using the same mercurial revision number as before, and then request another review. the process is then repeated until the bug is fixed to satisfaction. these bugs are also pulled into the dashboards, which
track your revision's progress. in order to ultimately have your revision included as an official build, your dashboards must be at 100% green. to the right, you'll see the current dashboard page for a german localization. revisions are approved using the buttons in the furthest column to the right. as your work is approved, you'll see a green circle in the furthest column to the right as well as a m...
Automated performance testing and sheriffing
we have several test harnesses that test firefox for various performance characteristics (page load time, startup time, etc.). we also generate some metrics as part of the build process (like installer size) that are interesting to
track over time. currently we aggregate this information in the perfherder web application where performance sheriffs watch for significant regressions, filing bugs as appropriate. ...
...rious performance characteristics (page load time, startup time, etc.). we also generate some metrics as part of the build process (like installer size) that are interesting to
track over time. currently we aggregate this information in the perfherder web application where performance sheriffs watch for significant regressions, filing bugs as appropriate. ...
DMD
you can dump that information to file, giving a profile of the live heap blocks at that point in time. ...
...er" mode. in this mode, dmd
tracks the contents of the heap, including which heap blocks have been reported by memory reporters. it helps us reduce the "heap-unclassified" value in firefox's about:memory page, and also detects if any heap blocks are reported twice. originally, this was the only mode that dmd had, which explains dmd's name. this is the default mode. "live" mode. in this mode, dmd
tracks the current contents of the heap. you can dump that information to file, giving a profile of the live heap blocks at that point in time. this is good for understanding how memory is used at an interesting point in time, such as peak memory usage. "cumulative" mode. in this mode, dmd
tracks both the past and current contents of the heap. you can dump that information to file, giving a profile of...
Memory Profiler
recording. understanding the profiles traditional memory analysis tools look at the data. they build the referring-to, namely retaining graphs. this is helpful in exploring the relationships among objects and identifying memory leaks. however, the information exposed in this way is usually a snapshot and the history of how memory has been used goes missing. moreover, they usually don't keep
tracks of how objects are allocated. developers have to infer how an object might be allocated and freed by himself/herself. another common approach is to plot the allocations or the memory usages along the timeline. this gives some intuition of how and when a bulk of objects are allocated. however, it still relies on developers' wisdom, and sometimes chances, to dig out the problematical code snippet...
...s on developers' wisdom, and sometimes chances, to dig out the problematical code snippet. this memory profiler is designed to solve the inconveniences and limitations. the goal is to identify the memory eager codes directly. the profiler is designed at the very beginning to support not only javascript but also native codes. naturally, not only javascript objects but also native allocations are
tracked. the profile while recording is stored in memory in a very compact format. it's supposed to profile a very long time period without problem. timeline view this view shows the allocation event across the period of time. it shows the overall memory usage history. red is allocate and blue is deallocate. rank-list view and tree view the rank-list view shows top functions that are most memory ...
Refcount tracing and balancing
the first step is to run firefox with refcount tracing enabled, which produces one or more log files. refcount tracing logs calls to addref and release, preferably for a particular set of classes, including call-stacks in symbolic form (on platforms that support this). refcount balancing is a follow-up step that analyzes the resulting log to help a developer figure out where refcounting went wrong. how to build for refcount tracing build with --enable-debug or --enable-logrefcnt. how to run with refcount tracing on there are several environment variables that can be used. ...
...is allocated. you may use an object's serial number with the following variable to further restrict the reference count tracing: xpcom_mem_log_objects set this variable to a comma-separated list of object serial number or ranges of serial number, e.g., 1,37-42,73,165 (serial numbers start from 1, not 0). when this is set, along with xpcom_mem_log_classes and xpcom_mem_refcnt_log, a stack
track will be generated for only the specific objects that you list. for example, env xpcom_mem_log_classes=nsdocshell xpcom_mem_log_objects=2 xpcom_mem_refcnt_log=./refcounts.log ./mach run will log stack traces to refcounts.log for the 2nd nsdocshell object that gets allocated, and nothing else. post-processing step 1: finding the leakers first you have to figure out which objects leaked. the...
TimerFirings logging
m, and so is able to be used in any build. set the following environment variable to enable it. nspr_log_modules=timerfirings:4 output once enabled, timerfirings will print one line of logging output per timer fired. it's best to redirect this output to a file. the following sample shows the basics of this output. ...
...added into the pipeline. ...
Profile Manager
rbird or seamonkey. to use profile manager with an application other than firefox, you need to launch it using the application's name as an argument, for example: profilemanager-bin seamonkey profiles and application versions profile manager manages two different lists: one of user profiles, and the other of application versions that can be used with the profiles. by default, this means it
tracks a list of firefox applications that are installed on your system, and a list of profiles for use by firefox. an individual profile can be linked to a specific installation of firefox, so that version of firefox will be launched when that profile is selected. for example, profilea might be linked with a copy of firefox 3.6.10, while profileb might be linked with a copy of firefox 3.5.3. when...
...backup in the main display, open the context menu, and choose "restore". when you restore a profile, the backup is retained, so you can restore from the same backup at a later date. to delete a backup: select the backup in the main display, open the context menu, and choose "delete". profile archives profile manager can also backup to and restore from .zip archives. profile manager does not
track these backups in the ui, but using profile archives is an easy way to move profiles between machines. to backup a profile to an archive: select the profile you want to backup, and choose "backup to->archive" from the toolbar's backup menu. you'll be prompted for a name and location for the archive. to create a profile from a profile archive: select "restore from->archive" from the toolbar's ...
AsyncTestUtils extended framework
s a (display) name and second element is an email address. for example, {count: 4, from: ["john doe", "john_doe@example.com"]} would result in four messages from john doe to random recipients. synthetic message sets the code that creates synthetic message sets returns instances of the syntheticmessageset class. this class not only holds references to the syntheticmessage instances, but it also
tracks what folders they were injected into as well as what folders you move them to. this allows you to get at the nsimsgdbhdr instances directly. keep in mind that the class is not magic and will lose
track of the message headers if you manipulate them without referencing the message set. accessing synthetic messages and headers synmessages [attribute] the js list of syntheticmessages held in th...
...ss that can generate one or more syntheticmessages at a time. the messagescenariofactory produces specific pre-configured message threading configurations using fresh messages (important in avoiding duplicate messages for code that cares, like gloda). messagemodifier.js: slightly misnamed, this provides the syntheticmessageset abstraction that is a set abstraction for syntheticmessages that also
tracks what folders they got injected into and provides code to directly manipulate or aid other code that wants to directly manipulate them. messageinjection.js: all the logic for injecting messages into folders via local / imap and then doing further folder-level manipulations. ...
NSPR Contributor Guide
and clear of encumberment of anyone or anything else; pay close attention to the rights of your "day-job" employer. if you snatched it from somewhere else, tell us where; show us where the right to incorporate it into nspr exists. license under mpl or gpl when you contribute material to nspr, you agree to allow your contribution to be licensed under the mpl or gpl. bugfixes use bugzilla to
track bugs. document the bug or use an existing report. be verbose in describing what you are doing and why. include your changes as diffs in an attachment to the bugzilla report. use a coding style consistent with the source file you are changing. new features for purposes of this paper, a "new feature" is defined as some api addition that goes into the core nspr library, for example: libnspr4.dll ...
...n it is not a good candidate for inclusion in nspr. before you begin what may be a substantial effort in making a candidate feature for nspr, talk to us. we may tell you that you have a good idea; we may say that it really is not a good candidate for inclusion in nspr; we may give you suggestions on what would make it more generalized, hence a good candidate for inclusion in nspr. use bugzilla to
track your work. be verbose. nspr wants you to document your work. if we accept it, we are going to have to answer questions about it and/or maintain it. these are some guidelines for new apis that you may add to nspr. header file descriptions. provide header file descriptions that fully document your public typedefs, enums, macros and functions. see: prshm.h as an example of how your header file(s) sh...
NSS API Guidelines
many routines are defined to take an nssarena *arenaopt argument. this means if an arena is specified (non-null), it is used, otherwise (null) the routine uses the heap. you can think of the heap as a default arena you can't ...
...lowing work together: arenas, letting you allocate stuff and then removing them all at once lazy creation of pure-memory objects from asn.1 blobs, for example use of nsspkixcertificate doesn't drag all the code in for all constituent objects, unless they're actually being used our agressive pointer-
tracking facility all these are useful, but they don't combine well. now some of the pointer-
tracking pressure has eased off, we can drop its use when it becomes too difficult. many routines are defined to take an nssarena *arenaopt argument. this means if an arena is specified (non-null), it is used, otherwise (null) the routine uses the heap. you can think of the heap as a default arena you can't destroy. error handling nss 3.0 introduces the concept of an error stack. when something goes...
AT APIs Support
builds thunderbird recent builds seamonkey recent builds determining if accessibility is enabled in a firefox accessibility is enabled on windows and linux platforms by default. as well you might find helpful the about:accessibilityenabled firefox extension. supported at apis at apis terms microsoft active accessibility (msaa) an api devised by microsoft so that accessibility aids can
track what's going on inside the user interface of any software package that supports it. if you seriously need to understand msaa, you'll need to read the docs on msdn and play with the sample apps and code that come with msaa sdk 1.3. (i recommend sdk 1.3 because the msaa sdk 2.0 doesn't come with the source code to the testing tools. the other differences are not important). iaccessible2 (ia2) iac...
...'t come with the source code to the testing tools. the other differences are not important). iaccessible2 (ia2) iaccessible2 is a new accessibility api which complements microsoft's earlier work on msaa. this api fills critical accessibility api gaps in the msaa offering. assistive technology service provider interface (at-spi) an api devised by sun microsystems so that accessibility aids can
track what's going on inside the user interface of any software package that supports it. if you seriously need to understand at-spi, you'll need to read the docs on gnome.org and play with the available sample apps and code, such as at-poke. please note that the web docs are sometimes out of date, and the latest at-spi is available on cvs. universal access (ua) universal access (ua) is the apple's a...
Component Internals
w components, xpcom registers them: xpcom calls autoregistration start. xpcom registers new components. xpcom calls autoregistration end. complete xpcom startup: xpcom notifies that it's begun. component manifests and type library manifests are described in the following section, xpcom registry manifests. xpcom registry manifests xpcom uses special files called manifests to
track and persist information about the components to the local system. there are two types of manifests that xpcom uses to
track components: component manifests when xpcom first starts up, it looks for the component manifest, which is a file that lists all registered components, and stores details on exactly what each component can do. xpcom uses the component manifest to determine which components ...
...any interfaces, symbols in xpcom, or other part of gecko libraries that aren't frozen. however, there are some unfrozen tools in xpcom that are used so often they are practically required parts of component programming. the smart pointer class, nscomptr, for example, which makes reference counting less tedious and error-prone, is not actually frozen, and neither is nsdebug, a class for aiding in
tracking down bugs, nor is nsmemory, a class to ensure that everyone uses the same heap, generic factory, and module. instead of asking every developer to find and copy these various files into their own application, xpcom provides a single library of "not-ready-to-freeze-but-really-helpful" classes that you can link into your application, as the following figure demonstrates. xpcom glue and tools ...
Introduction to XPCOM for the DOM
warning: this document has not yet been reviewed by the dom gurus, it might contain some errors. this document is an introduction to the use of xpcom in the context of the dom code. the use of xpcom and nscomptr's described in this document covers about 80% of what you need to know to read the dom code, and even write some. for more advanced topics, please see the xpcom page. the
tracking bug for this document is bug 99592. target audience: people who would like a quick introduction to the use of c++ and xpcom in the dom code. the understanding of the content of this document is a requirement to read the rest of the dom hacking guide. important note: this document assumes some knowledge of c++, specially the object-oriented part of it. i learned c++ by reading "c++ primer" from sta...
...this is called "addref" and is defined in the nsisupports interface. when the pointer no longers holds the address of that object, it has to decrease the reference count of that object by one. this is done using the "release" function, also defined in the nsisupports interface. when the reference count of an object hits 0 (zero), the object deletes itself. this is why it is very important to keep
track of the reference count of each object. in the first case, if we forget to addref the object, the object may delete itself before we are done using the pointer, which would cause a crash when dereferencing it. in the second case, if we forget to release the object, it will never delete itself, which will cause "memory leaks", i.e. the memory is never returned because we keep the object around even...
nsIDOMHTMLAudioElement
firefox 4 / thunderbird 3.3 / seamonkey 2.1) inherits from: nsidomhtmlmediaelement method overview unsigned long long mozcurrentsampleoffset(); void mozsetup(in pruint32 channels, in pruint32 rate); [implicit_jscontext] unsigned long mozwriteaudio(in jsval data); methods mozcurrentsampleoffset() non-standard this feature is non-standard and is not on a standards
track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. returns the current offset of the audio stream, specified as the number of samples that have played since the beginning of the stream. unsigned long long mozcurrentsampleoffset(); parameters none. r...
...urrent offset of the audio stream, specified as the number of samples that have played since the beginning of the stream. unsigned long long mozcurrentsampleoffset(); parameters none. return value an unsigned 64-bit value indicating how many audio samples have been played since the stream began playing. mozsetup() non-standard this feature is non-standard and is not on a standards
track. do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. sets up the audio stream for writing. void mozsetup( in pruint32 channels, in pruint32 rate ); parameters channels the number of audio channels the audio stream should use. specify 1 for mono ...
nsIDOMMozTouchEvent
this lets you process multi-finger touch gestures and actions. dom/interfaces/events/nsidommoztouchevent.idlscriptable please add a summary to this article. ...
...this is a random number that is guaranteed to remain the same for each finger during all moztouchmove events between the corresponding moztouchdown and moztouchup events. methods initmoztouchevent() initializes the touch event. void initsimplegestureevent( in domstring typearg, in boolean canbubblearg, in boolean cancelablearg, in nsidomabstractview viewarg, in long det...
nsIJumpListBuilder
st is ten. users can change the number through system preferences. user may also pin items to jump lists, which take up additional slots. applications do not have control over the number of items allowed in jump lists; excess items added are dropped by the system. item insertion priority is defined as first to last added. users may remove items from jump lists after they are committed. the system
tracks removed items between commits. a list of these items is returned by a call to initlistbuild(). nsijumplistbuilder does not filter entries added that have been removed since the last commit. to prevent repeatedly adding entires users have removed, applications are encouraged to
track removed items internally. each list is made up of an array of nsiwinjumplistitems representing items such as short...
...ri. task lists should generally be static lists that do not change often, if at all - similar to an application menu. tasks are given the highest priority of all lists when space is limited. jumplist_category_recent 1 recent lists are based on window's recent document lists. the lists are generated automatically by windows. applications that use recent or frequent lists should keep document use
tracking up to date by calling the shaddtorecentdocs shell api. jumplist_category_frequent 2 frequent lists are based on window's recent document lists. the lists are generated automatically by windows. applications that use recent or frequent lists should keep document use
tracking up to date by calling the shaddtorecentdocs shell api. jumplist_category_customlist 3 custom lists can be made up of ...
nsIMsgWindow
de to send commands to the ui, such as clearmsgpane. statusfeedback nsimsgstatusfeedback this allows the backend code to send status feedback to the ui. msgheadersink nsimsgheadersink this allows the backend code to send message header information to the ui. transactionmanager nsitransactionmanager this is used to
track undo/redo transactions. openfolder nsimsgfolder this is used to
track the folder currently open in the ui. rootdocshell nsidocshell this is used to
track the chrome window's nsidocshell object. you don't normally need to set this, instead set the domwindow property instead. messagewindowdocshell nsidocshell readon...
...e. notificationcallbacks nsiinterfacerequestor these are currently used to set notification callbacks on protocol channels to handle things like bad cert exceptions. promptdialog nsiprompt readonly: this is the equivalent of calling getinterface on the rootdocshell object. mailcharacterset acstring this is used to
track the character set of the currently displayed message. if set to an alias, the actual character set is returned. charsetoverride boolean remember the message's charset was overridden, so it can be inherited (e.g for quoting). stopped boolean check if a running url been stopped. if you are checking this flag, you need to clear it before you st...
nsIXULWindow
independent window opened with the "alwayslowered" chrome flag. normalz 5 the default z level of an independent window. raisedz 6 the z level of an independent window opened with the "alwaysraised" chrome flag. highestz 9 methods addchildwindow() tell this window that it has picked up a child xul window.note that xul windows do not currently
track child xul windows. void addchildwindow( in nsixulwindow achild ); parameters achild the child window being added. native code only!applychromeflags back-door method to force application of chrome flags at a particular time. do not call this unless you know what you are doing! in particular, calling this when this xul window does not yet have a document in its docshell could cause pr...
...to determine the capabilities. nsidocshelltreeitem getcontentshellbyid( in wstring id ); parameters id the id of the content shell, which is the same as the "type" attribute on the containing frame element. return value the tree item corresponding to the given id, if any. removechildwindow() tell this window that it has lost a child xul window. note that xul windows do not currently
track child xul windows. void removechildwindow( in nsixulwindow achild ); parameters achild the child window being removed. showmodal() shows the window as a modal window. that is, ensures that it is visible and runs a local event loop, exiting only once the window has been closed. void showmodal(); parameters none. ...
Mozilla
eveloping code for any browser, including firefox, as well as any web-oriented project, is its security. these articles provide important guides and references to ensuring the code you write is secure, including both design recommendations and testing guidelines. bugzilla bugzilla.mozilla.org (often abbreviated b.m.o) is mozilla.org's bug-
tracking system, a database for recording bugs and enhancement requests for firefox, thunderbird, seamonkey, camino, and other mozilla.org projects. building mozilla in this article, we list documents that will guide you in building firefox or other projects based upon mozilla code. building spidermonkey with ubsan 1. compile a recent ...
...uted. we have various automation tools that help make this possible. the first link, though, is the "check" target in a makefile. if a test is added, that test or its directory needs to be mentioned in a makefile.in file somewhere so that the build system knows about it. how to get a process dump with windows task manager when
tracking down the causes of process hangs, it is often helpful to obtain a process dump while the process is experiencing a hang. this article describes how to get a process dump with task manager on windows. (to get a process dump for thunderbird or some other product, substitute the product name where ever you see firefox in these instructions.) how to get a stacktr...
URLs - Plugins
pn_geturl. the npn_geturlnotify method acts like npn_geturl. both request the creation of a new stream with the contents of the specified url, and, in addition, npn_geturlnotify notifies the plug-in of the successful or unsuccessful completion of the request. the browser notifies the plug-in by calling the plug-in's npp_urlnotify function and passing it the notifydata value, which may be used to
track multiple requests. npn_geturlnotify handles the url request asynchronously. it returns immediately and only later handles the request and calls npp_urlnotify. without this notification, the plug-in cannot tell whether a request with a null target failed or a request with a non-null target was completed. nperror npn_geturlnotify(npp instance, const char* url, const char*...
...ately and only later handles the request and calls npp_urlnotify. nperror npn_posturlnotify( npp instance, const char *url, const char *target, uint32 len, const char *buf, npbool file, void* notifydata ); the parameters of this function have the same definitions as those of npn_posturl. the notifydata parameter contains plug-in-private data passed by npp_urlnotify and may be used for
tracking multiple posts. posting data to an http server the following code posts two name-value pairs to a cgi script through http. the response from the server is displayed in a new window. char* ppostdata = "content-type:\tapplication/x-www-form-urlencoded\ncontent-length:\t17\n\nname=aaashun@gmail.com\n"; uint32 npostdatalen = (uint32)strlen(ppostdata); npn_posturl(npinstance, "http://www.
AudioBufferSourceNode.loopStart - Web APIs
ffersourcenode.loopstart = startoffsetinseconds; startoffsetinseconds = audiobuffersourcenode.loopstart; value a floating-point number indicating the offset, in seconds, into the audio buffer at which each loop should begin during playback. this value is only used when the loop parameter is true. example in this example, the audiocontext.decodeaudiodata() function is used to decode an audio
track and put it into an audiobuffersourcenode. buttons are provided to play and stop the audio playback, and slider controls are used to change the playbackrate, loopstart, and loopend properties on the fly. when the audio is played to the end, it loops, but you can control how long the loops last by altering loopstart and loopend. for example, if you set their values to 20 and 25, respectively, the ...
...ed to play and stop the audio playback, and slider controls are used to change the playbackrate, loopstart, and loopend properties on the fly. when the audio is played to the end, it loops, but you can control how long the loops last by altering loopstart and loopend. for example, if you set their values to 20 and 25, respectively, the audio will start to loop between 20 and 25 seconds in to the
track. for a full working example, see this code running live, or view the source. function getdata() { source = audioctx.createbuffersource(); request = new xmlhttprequest(); request.open('get', 'viper.ogg', true); request.responsetype = 'arraybuffer'; request.onload = function() { var audiodata = request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { ...
AudioConfiguration - Web APIs
ediacapabilities.decodinginfo() to query whether a specific audio configuration is supported, smooth, and/or power efficient. properties the audioconfiguration dictionary is made up of four audio properties, including: contenttype: a valid audio mime type, for information on possible values and what they mean, see the web audio codec guide. channels: the number of channels used by the audio
track. bitrate: the number of bits used to encode one second of the audio file. samplerate: the number of audio samples making up one second of the audio file. examples //create media configuration to be tested const mediaconfig = { type : 'file', // 'record', 'transmission', or 'media-source' audio : { contenttype : "audio/ogg", // valid content type channels : 2, //...
...ts used to encode one second of the audio file. samplerate: the number of audio samples making up one second of the audio file. examples //create media configuration to be tested const mediaconfig = { type : 'file', // 'record', 'transmission', or 'media-source' audio : { contenttype : "audio/ogg", // valid content type channels : 2, // audio channels used by the
track bitrate : 132700, // number of bits used to encode 1s of audio samplerate : 5200 // number of audio samples making up that 1s. } }; // check support and performance navigator.mediacapabilities.decodinginfo(mediaconfig).then(result => { console.log('this configuration is ' + (result.supported ? '' : 'not ') + 'supported, ' + (result.smooth ? '' : 'not ') +...
AudioProcessingEvent - Web APIs
audiobuffer the buffer where the output audio data should be written. the number of channels is defined as a parameter, numberofoutputchannels, of the factory method audiocontext.createscriptprocessor(). note the the returned audiobuffer is only valid in the scope of the onaudioprocess function. example the following example shows basic usage of a scriptprocessornode to take a
track loaded via audiocontext.decodeaudiodata(), process it, adding a bit of white noise to each audio sample of the input
track (buffer) and play it through the audiodestinationnode. for each channel and each sample frame, the scriptnode.onaudioprocess function takes the associated audioprocessingevent and uses it to loop through each channel of the input buffer, and each sample in each channel, and a...
...or('pre'); var playbutton = document.queryselector('button'); // create audiocontext and buffer source var audioctx = new audiocontext(); source = audioctx.createbuffersource(); // create a scriptprocessornode with a buffersize of 4096 and a single input and output channel var scriptnode = audioctx.createscriptprocessor(4096, 1, 1); console.log(scriptnode.buffersize); // load in an audio
track via xhr and decodeaudiodata function getdata() { request = new xmlhttprequest(); request.open('get', 'viper.ogg', true); request.responsetype = 'arraybuffer'; request.onload = function() { var audiodata = request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { mybuffer = buffer; source.buffer = mybuffer; }, function(e){"error with decoding audio...
BaseAudioContext.createScriptProcessor() - Web APIs
s for this node's output, defaults to 2. values of up to 32 are supported. important: webkit currently (version 31) requires that a valid buffersize be passed when calling this method. note: it is invalid for both numberofinputchannels and numberofoutputchannels to be zero. returns a scriptprocessornode. example the following example shows basic usage of a scriptprocessornode to take a
track loaded via audiocontext.decodeaudiodata(), process it, adding a bit of white noise to each audio sample of the input
track (buffer) and play it through the audiodestinationnode. for each channel and each sample frame, the scriptnode.onaudioprocess function takes the associated audioprocessingevent and uses it to loop through each channel of the input buffer, and each sample in each channel, and a...
...or('pre'); var playbutton = document.queryselector('button'); // create audiocontext and buffer source var audioctx = new audiocontext(); source = audioctx.createbuffersource(); // create a scriptprocessornode with a buffersize of 4096 and a single input and output channel var scriptnode = audioctx.createscriptprocessor(4096, 1, 1); console.log(scriptnode.buffersize); // load in an audio
track via xhr and decodeaudiodata function getdata() { request = new xmlhttprequest(); request.open('get', 'viper.ogg', true); request.responsetype = 'arraybuffer'; request.onload = function() { var audiodata = request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { mybuffer = buffer; source.buffer = mybuffer; }, function(e){"error with decoding audio...
Document.requestStorageAccess() - Web APIs
storage access to is incremented by one. the persistent storage access permission is: persisted to disk and will remain valid in future browser sessions. reset after 30 days. when an ephemeral or persistent storage access grant expires, the number of origins the requesting origin has storage access to is decremented by one. note: if the requesting origin is not classified as a
tracking origin, the access request is automatically given an ephemeral storage access grant, which will go away when the page is reloaded. the user is never shown a prompt in this case, and calling requeststorageaccess() won’t have any side effects besides changing the value returned by document.hasstorageaccess(). debugging the storage access grant threshold may make it more difficult to test yo...
...lt to test your website under the condition where firefox prompts the user for access. to make testing easier, we have added two preferences in about:config that control prompting upon requeststorageaccess() calls: dom.storage_access.auto_grants can be set to false to disable the automatic granting of ephemeral storage access grants. all calls to requeststorageaccess() by origins classified as
trackers will trigger a prompt. dom.storage_access.max_concurrent_auto_grants controls the threshold number of storage access grants at which users will begin to receive prompts. for example, if you want to configure firefox to automatically grant access on the first site where requeststorageaccess() is called and then prompt afterwards, you should adjust the value of the dom.storage_access.max_concur...
In depth: Microtasks and the JavaScript runtime environment - Web APIs
ction returns and its context is removed from the stack and destroyed. the main program exits and its execution context is removed from the execution stack; as there are no contexts remaining on the stack, program execution ends. using execution contexts in this manner, each program and function is able to have its own set of variables and other objects. each context additionally
tracks the next line in the program that should be run and other information critical to that context's operation. by using the contexts and the context stack in this manner, many of the fundamentals of how a program operates can be managed, including local and global variables, function calls and returns, and so forth. a special note about recursive functions—that is, functions which call themselve...
...anner, many of the fundamentals of how a program operates can be managed, including local and global variables, function calls and returns, and so forth. a special note about recursive functions—that is, functions which call themselves, possibly over multiple levels of depth or recursion: each recursive call to the function creates a new execution context. this allows the javascript runtime to
track the levels of recursion and the return of results through that recursion, but it also means that each time a function recurses, more memory is needed to create the new context. run, javascript, run to run javascript code, the runtime engine maintains a set of agents in which to execute javascript code. each agent is made up of a set of execution contexts, the execution context stack, a main thr...
The HTML DOM API - Web APIs
t htmlpictureelement htmlpreelement htmlprogresselement htmlquoteelement htmlscriptelement htmlselectelement htmlslotelement htmlsourceelement htmlspanelement htmlstyleelement htmltablecaptionelement htmltablecellelement htmltablecolelement htmltableelement htmltablerowelement htmltablesectionelement htmltemplateelement htmltextareaelement htmltimeelement htmltitleelement html
trackelement htmlulistelement htmlunknownelement htmlvideoelement deprecated html element interfaces htmlmarqueeelement obsolete html element interfaces htmlbasefontelement htmlfontelement htmlframeelement htmlframesetelement htmlisindexelement htmlmenuitemelement web app and browser integration interfaces these interfaces offer access to the browser window and d...
...bjects used by the canvas api as well as the <img> element and <picture> elements. canvasgradient canvaspattern canvasrenderingcontext2d imagebitmap imagebitmaprenderingcontext imagedata offscreencanvas offscreencanvasrenderingcontext2d path2d textmetrics media interfaces the media interfaces provide html access to the contents of the media elements: <audio> and <video>. audio
track audio
tracklist mediaerror text
track text
trackcue text
trackcuelist text
tracklist timeranges
trackevent video
track video
tracklist drag and drop interfaces these interfaces are used by the html_drag_and_drop_api to represent individual draggable (or dragged) items, groups of dragged or draggable items, and to handle the drag and drop process. datatransfer datatransferitem datatra...
ImageCapture() constructor - Web APIs
the imagecapture() constructor creates a new imagecapture object. syntax const imagecapture = new imagecapture(video
track) parameters video
track a mediastream
track from which the still images will be taken. this can be any source, such as an incoming stream of a video conference, a playing movie, or the stream from a webcam. return value a new imagecapture object which can be used to capture still frames from the specified video
track. example the following example shows how to use a call to mediadevices.getusermedia() to retrieve the mediastream
track needed by the imagecapture() constructor. ...
...ecapture object which can be used to capture still frames from the specified video
track. example the following example shows how to use a call to mediadevices.getusermedia() to retrieve the mediastream
track needed by the imagecapture() constructor. navigator.mediadevices.getusermedia({video: true}) .then(mediastream => { document.queryselector('video').srcobject = mediastream const
track = mediastream.getvideo
tracks()[0]; imagecapture = new imagecapture(
track); }) .catch(error => console.log(error)); specifications specification status comment mediastream image capturethe definition of 'imagecapture' in that specification. working draft initial definition. ...
Browser storage limits and eviction criteria - Web APIs
ers shouldn’t add their own directories or files under <profile>/storage. this will cause storage initialization to fail; for example, open() will fire an error event. storage limits the maximum browser storage space is dynamic — it is based on your hard drive size. the global limit is calculated as 50% of free disk space. in firefox, an internal browser tool called the quota manager keeps
track of how much disk space each origin is using up, and deletes data if necessary. so if your hard drive is 500 gb, then the total storage for a browser is 250 gb. if this is exceeded, a process called origin eviction comes into play, deleting an entire origin's worth of data until the storage amount goes under the limit again. there is no trimming effect put in place to delete parts of origins — ...
...hrow a quotaexceedederror. note: in chrome the soft and hard storage quota limits has changed since m66. more information can be found here. lru policy when the available disk space is filled up, the quota manager will start clearing out data based on an lru policy — the least recently used origin will be deleted first, then the next one, until the browser is no longer over the limit. we
track the "last access time" for each origin using temporary storage. once the global limit for temporary storage is reached (more on the limit later), we try to find all currently unused origins (i.e., ones with no tabs/apps open that are keeping open datastores). these are then sorted according to "last access time." the least recently used origins are then deleted until there's enough space to fulfi...
Intersection Observer API - Web APIs
ment's parts. similarly, if the visible portion of an element is not rectangular, the element's intersection rectangle is construed to be the smallest rectangle that contains all the visible portions of the element. it's useful to understand a bit about how the various properties provided by intersectionobserverentry describe an intersection. the intersection root and root margin before we can
track the intersection of an element with a container, we need to know what that container is. that container is the intersection root, or root element. this can be either a specific element in the document which is an ancestor of the element to be observed, or null to use the document's viewport as the container. the root intersection rectangle is the rectangle used to check against the target or tar...
... the target element changes, too; as the intersection ratio goes down, the background color's alpha value goes down with it, resulting in an element that's more transparent. similarly, if the intersectionratio is going down, we use the string decreasingcolor and replace the word "ratio" in that with the intersectionratio before setting the target element's background-color. finally, in order to
track whether the intersection ratio is going up or down, we remember the current ratio in the variable prevratio. result below is the resulting content. scroll this page up and down and notice how the appearance of the box changes as you do so. there's an even more extensive example at timing element visibility with the intersection observer api. specifications specification status ...
MediaConfiguration - Web APIs
edia source files. a valid media encoding configuration, to be submitted as the parameter for mediacapabilities.encodinginfo() method, has it's `type` set as: record: for recording media. transmission: for media to be electronically transmitted. a valid audio configuration includes: contenttype: valid audio mime type. channels: number of channels used by the audio
track. bitrate: number of bits used to encode one second of the audio file. samplerate: number of audio samples making up one second of the audio file. a valid video configuration includes: contenttype: valid video mime type. width: width of the video. height: height of the video. bitrate: number of bits used to encode one second of the video file. framerate: number of frames ...
...f the video height : 600, // height of the video bitrate : 10000, // number of bits used to encode 1s of video framerate : 30 // number of frames making up that 1s. } }; const audioencoderconfig = { type : 'file', // 'record', 'transmission', or 'media-source' audio : { contenttype : "audio/ogg", // valid content type channels : 2, // audio channels used by the
track bitrate : 132700, // number of bits used to encode 1s of audio samplerate : 5200 // number of audio samples making up that 1s. } }; specifications specification status comment media capabilitiesthe definition of 'mediaconfiguration' in that specification. draft initial definition ...
MediaDevices.getSupportedConstraints() - Web APIs
because only constraints supported by the user agent are included in the list, each of these boolean properties has the value true. example this example outputs a list of the constraints supported by your browser. ...
...because only constraints supported by the user agent are included in the list, each of these boolean properties has the value true. example this example outputs a list of the constraints supported by your browser. ...
MediaPositionState.position - Web APIs
-standard media file format, written in javascript, uses setinterval() to establish a callback which fires once per second to refresh the position information by calling setpositionstate(). ...
...itionstate() is called with an object that specifies the duration, playback rate, and position as reported by a mymedia object that describes the
track being played. if the media is not playing, clearinterval() is used to remove the interval handler. let positioninterval = window.setinterval(() => { if (mymedia.isplaying) { navigator.mediasession.setpositionstate({ duration: mymedia.
trackdurationinseconds, playbackrate: mymedia.playbackrate, position: mymedia.
trackplaypositioninseconds }); } else { window.clearinterval(positioninterval); } }, 1000); specifications specification status comment media session standardthe definition of 'mediapositionstate.position' in that specification. draft initial definition. ...
MediaRecorder - Web APIs
ecorder interface of the mediastream recording api provides functionality to easily record media. it is created using the mediarecorder() constructor. constructor mediarecorder() creates a new mediarecorder object, given a mediastream to record. options are available to do things like set the container's mime type (such as "video/webm" or "video/mp4") and the bit rates of the audio and video
tracks or a single overall bit rate. properties mediarecorder.mimetype read only returns the mime type that was selected as the recording container for the mediarecorder object when it was created. mediarecorder.state read only returns the current state of the mediarecorder object (inactive, recording, or paused.) mediarecorder.stream read only returns the stream that was passed into the c...
...er object when it was created. mediarecorder.state read only returns the current state of the mediarecorder object (inactive, recording, or paused.) mediarecorder.stream read only returns the stream that was passed into the constructor when the mediarecorder was created. mediarecorder.ignoremutedmedia indicates whether the mediarecorder instance will record input when the input mediastream
track is muted. if this attribute is false, mediarecorder will record silence for audio and black frames for video. the default is false. mediarecorder.videobitspersecond read only returns the video encoding bit rate in use. this may differ from the bit rate specified in the constructor (if it was provided). mediarecorder.audiobitspersecond read only returns the audio encoding bit rate in use. th...
MediaSession.setActionHandler() - Web APIs
ion action. these actions let a web app receive notifications when the user engages a device's built-in physical or onscreen media controls, such as play, stop, or seek buttons. syntax navigator.mediasession.setactionhandler(type, callback) parameters type a domstring representing an action type to listen for. it will be one of play, pause, seekbackward, seekforward, seekto, skipad,previous
track, or next
track. further details on the action types can be found below under media session actions. callback a function to call when the specified action type is invoked. the callback receives no input parameters, and should not return a value. return value undefined. description to remove a previously-established action handler, call setactionhandler() again, specifying null as the callbac...
...orm the action. media session actions a media session action's type is specified using a string from the mediasessionaction enumerated type. values each of the actions is a common media session control request. implement support for each of these in order to allow that type of action to be performed. the following strings identify the currently available types of media session action: next
track advances playback to the next
track. pause pauses playback of the media. play begins (or resumes) playback of the media. previous
track moves back to the previous
track. seekbackward seeks backward through the media from the current position. seekforward seeks forward from the current position through the media. seekto moves the playback position to the specified time within the media...
MediaSession.setPositionState() - Web APIs
-standard media file format, written in javascript, uses setinterval() to establish a callback which fires once per second to refresh the position information by calling setpositionstate(). ...
...itionstate() is called with an object that specifies the duration, playback rate, and position as reported by a mymedia object that describes the
track being played. if the media is not playing, clearinterval() is used to remove the interval handler. let positioninterval = window.setinterval(() => { if (mymedia.isplaying) { navigator.mediasession.setpositionstate({ duration: mymedia.
trackdurationinseconds, playbackrate: mymedia.playbackrate, position: mymedia.
trackplaypositioninseconds }); } else { window.clearinterval(positioninterval); } }, 1000); specifications specification status comment media session standardthe definition of 'mediasession.setpositionstate()' in that specification. draft initial definition. ...
MediaStreamAudioDestinationNode - Web APIs
it is an audionode that acts as an audio destination, created using the audiocontext.createmediastreamdestination method. ...
... channel count mode "explicit" channel count interpretation "speakers" constructor mediastreamaudiodestinationnode.mediastreamaudiodestinationnode() creates a new mediastreamaudiodestinationnode object instance. properties inherits properties from its parent, audionode. mediastreamaudiodestinationnode.stream is a mediastream containing a single audiomediastream
track with the same number of channels as the node itself. you can use this property to get a stream out of the audio graph and feed it into another construct, such as a media recorder. methods inherits methods from its parent, audionode. example specification specification status comment web audio apithe definition of 'mediastreamaudiodestinationnode' in that specificat...
MediaStreamAudioSourceNode() - Web APIs
note: another way to create a mediastreamaudiosourcenode is to call theaudiocontext.createmediastreamsource() method, specifying the stream from which you want to obtain audio. syntax audiosourcenode = new mediastreamaudiosourcenode(context, options); parameters context an audiocontext representing the audio context you want the node to be associated with. ...
...e properties you want the mediastreamaudiosourcenode to have: mediastream a required property which specifies the mediastream from which to obtain audio for the node. return value a new mediastreamaudiosourcenode object representing the audio node whose media is obtained from the specified source stream. exceptions invalidstateerror the specified mediastream doesn't have any audio
tracks. examples this example uses getusermedia() to obtain access to the user's camera, then creates a new mediastreamaudiosourcenode from its mediastream. // define variables var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); // getusermedia block - grab stream // put it into a mediastreamaudiosourcenode if (navigator.mediadevices.getusermedia) { navigator.mediadevices.g...
MediaStreamAudioSourceNode.mediaStream - Web APIs
the mediastreamaudiosourcenode interface's read-only mediastream property indicates the mediastream that contains the audio
track from which the node is receiving audio. this stream was specified when the node was first created, either using the mediastreamaudiosourcenode() constructor or the audiocontext.createmediastreamsource() method. syntax audiosourcestream = mediastreamaudiosourcenode.mediastream; value a mediastream representing the stream which contains the mediastream
track serving as the source of audio for the node. the user agent uses the first audio
track it finds on the specified stream as the audio source for this node. ...
... audiocontext.createmediastreamsource() method. syntax audiosourcestream = mediastreamaudiosourcenode.mediastream; value a mediastream representing the stream which contains the mediastream
track serving as the source of audio for the node. the user agent uses the first audio
track it finds on the specified stream as the audio source for this node. however, there is no way to be certain which
track that will be on multi-
track streams. if the specific
track matters to you, or you need to have access to the
track itself, you should use a mediastream
trackaudiosourcenode instead. examples const audioctx = new window.audiocontext(); let options = { mediastream : stream } let source = new mediastreamaudiosourcenode(audioctx, options); console.log(source.mediastream); specifications ...
Recording a media element - Web APIs
sed. upon resolution, it stops the mediarecorder if it's recording. lines 18-22 these lines create a new promise which is fulfilled when both of the two promises (stopped and recorded) have resolved. once that resolves, the array data is returned by startrecording() to its caller. stopping the input stream the stop() function simply stops the input media: function stop(stream) { stream.get
tracks().foreach(
track =>
track.stop()); } this works by calling mediastream.get
tracks(), using foreach() to call mediastream
track.stop() on each
track in the stream. getting an input stream and setting up the recorder now let's look at the most intricate piece of code in this example: our event handler for clicks on the start button: startbutton.addeventlistener("click", function() { navigator.
...this is the stream we'll record. lines 5-9 when the promise returned by getusermedia() is resolved, the preview <video> element's srcobject property is set to be the input stream, which causes the video being captured by the user's camera to be displayed in the preview box. since the <video> element is muted, the audio won't play. the "download" button's link is then set to refer to the strea...
NotifyAudioAvailableEvent - Web APIs
do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. the non-standard, obsolete, notifyaudioavailableevent interface defines the event sent to audio elements when the audio buffer is full. properties framebuffer read only a float32array containing the raw 32-bit floating-point audio data obtained from decoding the audio (e.g., the raw data being sent to the audio hardware vs. encoded audio). ...
... ...
OfflineAudioContext.startRendering() - Web APIs
); offlineaudioctx.oncomplete = function(e) { // e.renderedbuffer contains the output buffer } promise-based version: offlineaudioctx.startrendering().then(function(buffer) { // buffer contains the output buffer }); parameters none. returns void. example in this simple example, we declare both an audiocontext and an offlineaudiocontext object. we use the audiocontext to load an audio
track via xhr (audiocontext.decodeaudiodata), then the offlineaudiocontext to render the audio into an audiobuffersourcenode and play the
track through. after the offline audio graph is set up, you need to render it to an audiobuffer using offlineaudiocontext.startrendering. when the startrendering() promise resolves, rendering has completed and the output audiobuffer is returned out of the promise. ...
...ise audiobuffer. this is then played as part of a simple standard audio graph. ...
OfflineAudioContext - Web APIs
se events using addeventlistener() or by assigning an event listener to the oneventname property of this interface: complete fired when the rendering of an offline audio context is complete. also available using the oncomplete event handler property. examples in this simple example, we declare both an audiocontext and an offlineaudiocontext object. we use the audiocontext to load an audio
track via xhr (audiocontext.decodeaudiodata), then the offlineaudiocontext to render the audio into an audiobuffersourcenode and play the
track through. after the offline audio graph is set up, you need to render it to an audiobuffer using offlineaudiocontext.startrendering. when the startrendering() promise resolves, rendering has completed and the output audiobuffer is returned out of the promise. ...
...ise audiobuffer. this is then played as part of a simple standard audio graph. ...
OverconstrainedError.OverconstrainedError() - Web APIs
syntax var overconstrainederror = new overconstrainederror() parameters constraint the constraint that was not satified. message text for the error's message property. ...
... syntax var overconstrainederror = new overconstrainederror() parameters constraint the constraint that was not satified. message text for the error's message property. ...
RTCConfiguration - Web APIs
constants rtcbundlepolicy enum the rtcbundlepolicy enum defines string constants which are used to request a specific policy for gathering ice candidates if the remote peer isn't "bundle-aware" (compatible with the sdp bundle standard for bundling multiple media streams on a single transport link). all browser implementations are bundle-aware. if the remote endpoint is bundle-aware, all media
tracks and data channels are bundled onto a single transport at the completion of negotiation, regardless of policy used, and any superfluous transports that were created initially are closed at that point. note: in technical terms, a bundle lets all media flow between two peers flow across a single 5-tuple; that is, from a single ip and port on one peer to a single ip and port on the other peer, usi...
... constant description "balanced" the ice agent initially creates one rtcdtlstransport for each type of content added: audio, video, and data channels. if the remote endpoint is not bundle-aware, then each of these dtls transports then handles all the communication for one type of data. "max-compat" the ice agent initially creates one rtcdtlstransport per media
track and a separate one for data channels. if the remote endpoint is not bundle-aware, everything is negotiated on these separate dtls transports. "max-bundle" the ice agent initially creates only a single rtcdtlstransport to carry all of the rtcpeerconnection's data. if the remote endpoint is not bundle-aware, then only a single
track will be negotiated and the rest ignored. rtcice...
RTCPeerConnection.addTransceiver() - Web APIs
the rtcpeerconnection method addtransceiver() creates a new rtcrtptransceiver and adds it to the set of transceivers associated with the rtcpeerconnection. each transceiver represents a bidirectional stream, with both an rtcrtpsender and an rtcrtpreceiver associated with it. syntax rtptransceiver = rtcpeerconnection.addtransceiver(
trackorkind, init); parameters
trackorkind a mediastream
track to associate with the transceiver, or a domstring which is used as the kind of the receiver's
track, and by extension of the rtcrtpreceiver itself. init optional an object that conforms to the rtcrtptransceiverinit dictionary which provides any options that you may wish to specify when creating the new transceiver. possible values are: direction optional the new transceiver's preferred directio...
...tionality. this value is used to initialize the new rtcrtptransceiver object's rtcrtptransceiver.direction property. sendencodings optional a list of encodings to allow when sending rtp media from the rtcrtpsender. each entry is of type rtcrtpencodingparameters. streams optional a list of mediastream objects to add to the transceiver'srtcrtpreceiver; when the remote peer's rtcpeerconnection's
track event occurs, these are the streams that will be specified by that event. exceptions typeerror a string was specified as
trackorkind which is not valid. the string must be either "audio" or "video". specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnection.addtransceiver()' in that speci...
RTCPeerConnection: addstream event - Web APIs
the obsolete addstream event is sent to an rtcpeerconnection when new media, in the form of a mediastream object, has been added to it. important: this event has been removed from the webrtc specification. you should instead watch for the
track event, which is sent for each media
track added to the rtcpeerconnection. bubbles no cancelable no interface mediastreamevent event handler property rtcpeerconnection.onaddstream you can, similarly, watch for streams to be removed from the connection by monitoring the removestream event. examples this example looks to determine if the user's browser supports the
track event. if it does, a
track event listener is set up; otherwise, an addstream event listener is set up. pc is an rtcpeerconnec...
... event handler property rtcpeerconnection.onaddstream you can, similarly, watch for streams to be removed from the connection by monitoring the removestream event. examples this example looks to determine if the user's browser supports the
track event. if it does, a
track event listener is set up; otherwise, an addstream event listener is set up. pc is an rtcpeerconnection. if (pc.add
track !== undefined) { pc.on
track = ev => { ev.streams.foreach(stream => doaddstream(stream)); } } else { pc.onaddstream = ev => { doaddstream(ev.stream); } } this calls a function doaddstream() once for each stream being added to the rtcpeerconnection, regardless of whether the browser sends addstream or
track. you can also use the addeventlistener() method to set an event listener:...
RTCRtpSendParameters.encodings - Web APIs
the rtcrtpsendparameters dictionary's encodings property is an rtcrtpencodingparameters object providing configuration settings for the encoder being used for the rtcrtpsender's
track. syntax sendparameters.encodings = encodingparameterlist; encodingparameterlist = sendparameters.encodings; value an array of objects conforming to the rtcrtpencodingparameters dictionary, each of which contains properties which provide settings and parameters that describe and configure a single codec that could be used to encode the
track. each object's properties are: active if true, the described encoding is currently actively being used. that is, for rtp senders, the encoding is currently being used to send data, while for receivers, the encoding is being used to decode received data. the default v...
...ly relevant for audio encodings. the user agent will try to match this as well as it can, but there is no guarantee. rid a domstring which, if set, specifies an rtp stream id (rid) to be sent using the rid header extension. this parameter cannot be modified using setparameters(). its value can only be set when the transceiver is first created. scaleresolutiondownby only used for senders whose
track's kind is video, this is a double-precision floating-point value specifying a factor by which to scale down the video during encoding. the default value, 1.0, means that the sent video's size will be the same as the original. a value of 2.0 scales the video frames down by a factor of 2 in each dimension, resulting in a video 1/4 the size of the original. the value must not be less than 1.0 (you c...
RTCRtpSender.dtmf - Web APIs
the read-only dtmf property on the rtcrtpsender interface returns a rtcdtmfsender object which can be used to send dtmf tones over the rtcpeerconnection . see using dtmf for details on how to make use of the returned rtcdtmfsender object. ...
...t which can be used to send dtmf tones over the rtcpeerconnection . see using dtmf for details on how to make use of the returned rtcdtmfsender object. syntax var dtmfsender = rtcrtpsender.dtmf; value an rtcdtmfsender which can be used to send dtmf over the rtp session, or null if the
track being carried by the rtp session or the rtcpeerconnection as a whole doesn't support dtmf. only audio
tracks can support dtmf, and typically only one audio
track per rtcpeerconnection will have an associated rtcdtmfsender example tbd specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcrtpsender.dtmf' in that specification. candidate recommendation ...
ScriptProcessorNode.bufferSize - Web APIs
e returns an integer representing both the input and output buffer size, in sample-frames. its value can be a power of 2 value in the range 256–16384. syntax var audioctx = new audiocontext(); var scriptnode = audioctx.createscriptprocessor(4096, 1, 1); console.log(scriptnode.buffersize); value an integer. example the following example shows basic usage of a scriptprocessornode to take a
track loaded via audiocontext.decodeaudiodata(), process it, adding a bit of white noise to each audio sample of the input
track (buffer) and play it through the audiodestinationnode. for each channel and each sample frame, the scriptnode.onaudioprocess function takes the associated audioprocessingevent and uses it to loop through each channel of the input buffer, and each sample in each channel, and a...
...selector('pre'); var playbutton = document.queryselector('button'); // create audiocontext and buffer source var audioctx = new audiocontext(); source = audioctx.createbuffersource(); // create a scriptprocessornode with a buffersize of 4096 and a single input and output channel var scriptnode = audioctx.createscriptprocessor(4096, 1, 1); console.log(scriptnode.buffersize); // load in an audio
track via xhr and decodeaudiodata function getdata() { request = new xmlhttprequest(); request.open('get', 'viper.ogg', true); request.responsetype = 'arraybuffer'; request.onload = function() { var audiodata = request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { mybuffer = buffer; source.buffer = mybuffer; }, function(e){"error with decoding audio da...
ScriptProcessorNode.onaudioprocess - Web APIs
d for the audioprocess event that is dispatched to scriptprocessornode node types. an event of type audioprocessingevent will be dispatched to the event handler. syntax var audioctx = new audiocontext(); var scriptnode = audioctx.createscriptprocessor(4096, 1, 1); scriptnode.onaudioprocess = function() { ... } example the following example shows basic usage of a scriptprocessornode to take a
track loaded via audiocontext.decodeaudiodata(), process it, adding a bit of white noise to each audio sample of the input
track (buffer) and play it through the audiodestinationnode. for each channel and each sample frame, the scriptnode.onaudioprocess function takes the associated audioprocessingevent and uses it to loop through each channel of the input buffer, and each sample in each channel, and a...
...or('pre'); var playbutton = document.queryselector('button'); // create audiocontext and buffer source var audioctx = new audiocontext(); source = audioctx.createbuffersource(); // create a scriptprocessornode with a buffersize of 4096 and a single input and output channel var scriptnode = audioctx.createscriptprocessor(4096, 1, 1); console.log(scriptnode.buffersize); // load in an audio
track via xhr and decodeaudiodata function getdata() { request = new xmlhttprequest(); request.open('get', 'viper.ogg', true); request.responsetype = 'arraybuffer'; request.onload = function() { var audiodata = request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { mybuffer = buffer; source.buffer = mybuffer; }, function(e){"error with decoding audio...
ScriptProcessorNode - Web APIs
rent, audionode. events listen to these events using addeventlistener() or by assigning an event listener to the oneventname property of this interface: audioprocess fired when an input buffer of a scriptprocessornode is ready to be processed. also available via the onaudioprocess event handler property. examples the following example shows basic usage of a scriptprocessornode to take a
track loaded via audiocontext.decodeaudiodata(), process it, adding a bit of white noise to each audio sample of the input
track (buffer) and play it through the audiodestinationnode. for each channel and each sample frame, the scriptnode.onaudioprocess function takes the associated audioprocessingevent and uses it to loop through each channel of the input buffer, and each sample in each channel, and a...
...selector('pre'); var playbutton = document.queryselector('button'); // create audiocontext and buffer source var audioctx = new audiocontext(); source = audioctx.createbuffersource(); // create a scriptprocessornode with a buffersize of 4096 and a single input and output channel var scriptnode = audioctx.createscriptprocessor(4096, 1, 1); console.log(scriptnode.buffersize); // load in an audio
track via xhr and decodeaudiodata function getdata() { request = new xmlhttprequest(); request.open('get', 'viper.ogg', true); request.responsetype = 'arraybuffer'; request.onload = function() { var audiodata = request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { mybuffer = buffer; source.buffer = mybuffer; }, function(e){"error with decoding audio da...
Touch - Web APIs
the touch.radiusx, touch.radiusy, and touch.rotationangle describe the area of contact between the user and the screen, the touch area. this can be helpful when dealing with imprecise pointing devices such as fingers. these values are set to describe an ellipse that as closely as possible matches the entire area of contact (such as the user's fingertip). ...
...ructor touch() creates a touch object. properties this interface has no parent, and doesn't inherits or implements any other property. basic properties touch.identifier read only returns a unique identifier for this touch object. a given touch point (say, by a finger) will have the same identifier for the duration of its movement around the surface. this lets you ensure that you're
tracking the same touch all the time. touch.screenx read only returns the x coordinate of the touch point relative to the left edge of the screen. touch.screeny read only returns the y coordinate of the touch point relative to the top edge of the screen. touch.clientx read only returns the x coordinate of the touch point relative to the left edge of the browser viewport, not including any scro...
VTTCue() - Web APIs
the vttcue() constructor creates and returns a new vttcue object. syntax vttcue = new vttcue(starttime, endtime, text); parameters starttime this is a double representing the initial text
track cue start time. this is the time, given in seconds and fractions of a second, denoting the beginning of the range of the media data to which this cue applies. for example, if a cue is to be visible from 50 seconds to a one minute, five and a half seconds in the media's playback, starttime will be 50.0. endtime this is a double representing the ending time for this text
track cue. this is the time at which the cue should stop being presented to the user, given in seconds and fractions thereof. given the example cue mentioned under starttime, the value of endtime would be 65.5. text a domstrin...
...ing the time span indicated by starttime and endtime. return value a new vttcue object representing a cue which will be presented during the time span given. example // create a cue that is shown from 2 to 3 seconds and uses the given text. var cue = new vttcue(2, 3, 'cool text to be displayed'); specifications specification status comment webvtt: the web video text
tracks formatthe definition of 'vttcue()' in that specification. candidate recommendation ...
VTTRegion - Web APIs
constructor vttregion() returns a newly created vttregion object. properties vttregion.id a domstring that identifies the region. vttregion.width a double representing the width of the region, as a percentage of the video. vttregion.lines a double representing the height of the region, in number of lines. vttregion.regionanchorx a double representing the region anchor x offset, as a percentage of the region. vttregion.regionanchory a double representing the region anchor y offset, as a percentage of the region. ...
... region.width = 50; // use 50% of the video width region.lines = 4; // use 4 lines of height. region.viewportanchorx = 25; // have the region start at 25% from the left. var cue = new vttcue(2, 3, 'cool text to be displayed'); cue.region = region; // this cue will be drawn only within this region. specifications specification status comment webvtt: the web video text
tracks format candidate recommendation ...
Animating objects with WebGL - Web APIs
» in this example, we'll actually rotate our square plane. this example uses the glmatrix library to perform its matrix and vertex math. you'll need to include it if you create your own project based on this code. our sample loads a copy from a cdn in our html's <head>. making the square rotate let's start by making the square rotate. the first thing we'll need is a variable in which to
track the current rotation of the square: var squarerotation = 0.0; now we need to update the drawscene() function to apply the current rotation to the square when drawing it. after translating to the initial drawing position for the square, we apply the rotation like this: mat4.rotate(modelviewmatrix, // destination matrix modelviewmatrix, // matrix to rotate square...
... modelviewmatrix, // matrix to rotate squarerotation, // amount to rotate in radians [0, 0, 1]); // axis to rotate around this rotates the modelviewmatrix by the current value of squarerotation, around the z axis. to actually animate, we need to add code that changes the value of squarerotation over time. ...
WebGL best practices - Web APIs
webgl is a complicated api, and it's often not obvious what the recommended ways to use it are. this page tackles recommendations across the spectrum of expertise, and not only highlights dos and don'ts, but also details why. you can rely on this document to guide your choice of approach, and ensure you're on the right
track no matter what browser or hardware your users run. general topics address and eliminate webgl errors your application should run without generating any webgl errors (as returned by geterror). every webgl error is reported in the web console as a javascript warning with a descriptive message. after too many errors (32 in firefox), webgl stops generating descriptive messages, which really hinders debugging. the only errors a well-formed page generates are out_of_memory a...
..., browsers can cache the fetch limits, whereas when vaos change, browsers must revalidate and recalculate limits. the overhead for this is relatively low, but re-using vaos means fewer vertexattribpointer calls too, so it's worth doing wherever it's easy. delete objects eagerly don't wait for the garbage collector/cycle collector to realize objects are orphaned and destroy them. implementations
track the liveness of objects, so 'deleting' them at the api level only releases the handle that refers to the actual object. (conceptually releasing the handle's ref-pointer to the object) only once the object is unused in the implementation is it actually freed. for example, if you never want to access your shader objects directly again, just delete their handles after attaching them to a program obj...
WebRTC connectivity - Web APIs
e the call's format or other configuration needs to change. regardless of whether it's a new call, or reconfiguring an existing one, these are the basic steps which must occur to exchange the offer and answer, leaving out the ice layer for the moment: the caller captures local media via navigator.mediadevices.getusermedia() the caller creates rtcpeerconnection and called rtcpeerconnection.add
track() (since addstream is deprecating) the caller calls rtcpeerconnection.createoffer() to create an offer. the caller calls rtcpeerconnection.setlocaldescription() to set that offer as the local description (that is, the description of the local end of the connection). after setlocaldescription(), the caller asks stun servers to generate the ice candidates the caller uses the signaling server to...
...idates the caller uses the signaling server to transmit the offer to the intended receiver of the call. the recipient receives the offer and calls rtcpeerconnection.setremotedescription() to record it as the remote description (the description of the other end of the connection). the recipient does any setup it needs to do for its end of the call: capture its local media, and attach each media
tracks into the peer connection via rtcpeerconnection.add
track() the recipient then creates an answer by calling rtcpeerconnection.createanswer(). the recipient calls rtcpeerconnection.setlocaldescription(), passing in the created answer, to set the answer as its local description. the recipient now knows the configuration of both ends of the connection. the recipient uses the signaling server to se...
Starting up and shutting down a WebXR session - Web APIs
s; since your app is probably not going to go back and forth much on whether or not to use the polyfill, you can simplify this to just the specific case you need. permissions and security there are a number of security measures in place revolving around webxr. first among these is that use of immersive-vr mode—which entirely replaces the user's view of the world—requires that the xr-spatial-
tracking feature policy be in place. on top of that, the document needs to be secure and currently focused. finally, you must call requestsession() from a user event handler, such as the handler for the click event. for more specifics about securing webxr actitvities and usage, see the article permissions and security for webxr. confirming the session type you need is available before trying to cre...
...k; } }; this example changes a variable myframerate depending on the visibility state as it changes. presumably the renderer uses this value to compute how often to render new frames as the animation loop progresses, thus rendering less frequently the more "blurred" the scene becomes. detecting reference space resets occasionally, discontinuities or jumps in the native origin may occur while
tracking the user's position in the world. the most common scenarios in which this happens are when the user requests a recalibration of their xr device or when a hiccup or glitch occurs in the flow of
tracking data received from the xr hardware. these situations cause the native origin to jump abruptly by the distance and directional angle necessary to bring the native origin back into alignment with ...
Controlling multiple parameters with ConstantSourceNode - Web APIs
chord. gainnode1, gainnode2, and gainnode3 the three gainnode instances which provide the volume levels for each of the three oscillators. gainnode2 and gainnode3 will be linked together to have the same, adjustable, value using the constantsourcenode. constantnode the constantsourcenode used to control the values of gainnode2 and gainnode3 together. playing a boolean that we'll use to keep
track of whether or not we're currently playing the tones. now let's look at the setup() function, which is our handler for the window's load event; it handles all the initialization tasks that require the dom to be in place. function setup() { context = new (window.audiocontext || window.webkitaudiocontext)(); playbutton = document.queryselector("#playbutton"); volumecontrol = document.query...
...rm. set the oscillator's frequency to the desired value; in this case, oscnode1 is set to a middle c, while oscnode2 and oscnode3 round out the chord by playing the e and g notes. connect the new oscillator to the corresponding gain node. once all three oscillators have been created, they're started by calling each one's constantsourcenode.start() method in turn, and playing is set to true to
track that the tones are playing. stopping the oscillators stopping the oscillators when the user toggles the play state to pause the tones is as simple as stopping each node. function stoposcillators() { oscnode1.stop(); oscnode2.stop(); oscnode3.stop(); playing = false; } each node is stopped by calling its constantsourcenode.stop() method, then playing is set to false. result ...
Migrating from webkitAudioContext - Web APIs
ent on the source nodes, as shown above. code using the activesourcecount attribute of the audiocontext, like this snippet: var src0 = context.createbuffersource(); var src1 = context.createbuffersource(); // set buffers and other parameters... src0.start(0); src1.start(0); // some time later... console.log(context.activesourcecount); could be rewritten like that: // array to
track the playing source nodes: var sources = []; // when starting the source, put it at the end of the array, // and set a handler to make sure it gets removed when the // audiobuffersourcenode reaches its end. // first argument is the audiobuffersourcenode to start, other arguments are // the argument to the |start()| method of the audiobuffersourcenode. function startsource() { var...
...m read-only attributes the following read-only attributes have been removed from audioparam: name, units, minvalue, and maxvalue. these used to be informational attributes. here is some information on how you can get these values if you need them: the name attribute is a string representing the name of the audioparam object. for example, the name of gainnode.gain is "gain". you can simply
track where the audioparam object is coming from in your code if you need this information. the minvalue and maxvalue attributes are read-only values representing the nominal range for the audioparam. for example, for gainnode, these values are 0 and 1, respectively. note that these bounds are not enforced by the engine, and are merely used for informational purposes. as an example, it's perfectly ...
Using Web Workers - Web APIs
error occurred. lineno the line number of the script file on which the error occurred. spawning subworkers workers may spawn more workers if they wish. so-called sub-workers must be hosted within the same origin as the parent page. also, the uris for subworkers are resolved relative to the parent worker's location rather than that of the owning page. this makes it easier for workers to keep
track of where their dependencies are. importing scripts and libraries worker threads have access to a global function, importscripts(), which lets them import scripts. it accepts zero or more uris as parameters to resources to import; all of the following examples are valid: importscripts(); /* imports nothing */ importscripts('foo.js'); /* imports just "foo.
...xample #1: advanced passing json data and creating a switching system if you have to pass some complex data and have to call many different functions both on the main page and in the worker, you can create a system which groups everything together. ...
WindowOrWorkerGlobalScope.setTimeout() - Web APIs
a web audio api audiocontext is actively playing sound. firefox 51 further amends this such that background tabs are no longer throttled if an audiocontext is present in the tab at all, even if no sound is being played. these resolve a number of issues with apps which play note-based music not being able to time or synchronize the music properly when the tab is in the background. throttling of
tracking timeout scripts since firefox 55,
tracking scripts (e.g. google analytics, any script url that firefox recognises as a
tracking script through its tp lists) have been subject to further throttling. when running in the foreground, the throttling minimum delay is still 4ms. in background tabs, however, the throttling minimum delay is 10,000 ms, or 10 seconds, which comes into effect 30 seconds ...
... url that firefox recognises as a
tracking script through its tp lists) have been subject to further throttling. when running in the foreground, the throttling minimum delay is still 4ms. in background tabs, however, the throttling minimum delay is 10,000 ms, or 10 seconds, which comes into effect 30 seconds after a document has first loaded. the prefs that control this behaviour are: dom.min_
tracking_timeout_value: 4 dom.min_
tracking_background_timeout_value: 10000 dom.timeout.
tracking_throttling_delay: 30000 late timeouts in addition to "clamping", the timeout can also fire later when the page (or the os/browser itself) is busy with other tasks. one important case to note is that the function or code snippet cannot be executed until the thread that called settimeout() has terminated.
XRBoundedReferenceSpace - Web APIs
eferencespace interface describes a virtual world reference space which has preset boundaries. this extends xrreferencespace, which describes an essentially unrestricted space around the viewer's position. these bounds are defined using an array of points, each of which defines a vertex in a polygon inside which the user is allowed to move. this is typically used when the xr system is capable of
tracking the user's physical movement within a limited distance of their starting position. the specified bounds may, in fact, describe the shape and size of the room the user is located in, in order to let the webxr site or application prevent the user from colliding with the walls or other obstacles in the real world. at a minimum, the boundaries indicate the area in which the xr device is capable o...
...g the user's physical movement within a limited distance of their starting position. the specified bounds may, in fact, describe the shape and size of the room the user is located in, in order to let the webxr site or application prevent the user from colliding with the walls or other obstacles in the real world. at a minimum, the boundaries indicate the area in which the xr device is capable of
tracking the user's movement. see the article using bounded reference spaces for details on how bounded spaces work and why they're useful. properties in addition to the properties of xrreferencespace, xrboundedreferencespace includes the following: boundsgeometry read only an array of dompointreadonly objects, each of which defines a vertex in the polygon defining the boundaries within which th...
XRFrame - Web APIs
a webxr device api xrframe object is passed into the requestanimationframe() callback function and provides access to the information needed in order to render a single frame of animation for an xrsession describing a vr or ar sccene. events which communicate the
tracking state of objects also provide an xrframe reference as part of their structure. ...
...a reference to the xrsession for which this frame is to be rendered, the getviewerpose() method is provided to obtain the xrviewerpose describing the viewer's position and orientation in space, and getpose() can be used to create an xrpose describing the relative position of one xrspace relative to another. properties session read only the xrsession that for which this xrframe describes the
tracking details for all objects. the information about a specific object can be obtained by calling one of the methods on the object. methods getpose() returns an xrpose object representing the spatial relationship between the two specified xrspace objects. getviewerpose() returns an xrviewerpose describing the viewer's position and orientation in a given xrreferencespace. specifications ...
XRInputSource.gripSpace - Web APIs
the read-only xrinputsource property gripspace returns an xrspace whose native origin
tracks the pose used to render virtual objects so they appear to be held in (or part of) the user's hand. for example, if a user were holding a virtual straight rod, the native origin of this xrspace would be located at the approximate center of mass of the user's fist. syntax var xrspace = xrinputsource.gripspace; value an xrspace object representing the position and orientation of the input device in virtual space, suitable for rendering an image of the device into the scene. gripspace is null if the input source is inherently un
trackable. for example, only inputs whose targetraymode is
tracked-pointer provide a gripspace. imagine that the controller is shaped like a straight rod, held in the...
... the coordinate system for the left hand's grip space. the coordinate system for the right hand's grip space. ...
XRInputSource - Web APIs
te of the buttons and axes on the xr input source, if it is a gamepad or comparable device. if the device isn't a gamepad-like device, this property's value is null. note: while xrinputsource uses the gamepad interface from the gamepad api, this input device is strictly associated with the webxr hardware and is not a general-purpose gaming device. gripspaceread only an xrspace whose origin
tracks the pose which is used to render objects which should appear as if they're held in the hand indicated by handedness. the orientation of this space indicates the angle at which the hand is gripping the object. read on in the main article on gripspace for more details on how to use this space. handednessread only a domstring that indicates which hand the device represented by this xrinputsource...
...hand the device represented by this xrinputsource is being used in, if any. the value will be left, right, or none. profilesread only an array of domstring objects, each specifying the name of an input profile describing the preferred visual representation and behavior of this input source. targetraymoderead only a domstring indicating the methodology used to produce the target ray: gaze,
tracked-pointer, or screen. targetrayspaceread only an xrspace object defining the origin of the target ray and the direciton in which it extends. this space is established using the method defined by targetraymode. methods the xrinputsource interface defines no methods. usage notes actions and the target ray if the device provides an indication of the direction in which it is pointed, this ...
XRInputSourceArray.entries() - Web APIs
to walk through the list of xrinputsource objects included in the input source array. examples this example snippet gets the list of inputs for a session and tries to handle each type of input device it supports using. ...
...de === "
tracked-pointer" && input.handedness === player.handedness) { /* handle main hand controller */ handlemainhandinput(input); } else { /* handle other inputs */ } } } for each input in the llist, gamepad inputs are dispatched to a checkgamepad() with the input's gamepad object, taken from its gamepad property, as an input for other devices, we look for
tracked-pointer devices in the player's main hand, dispatching those to a handlemainhandinput() method. specifications specification status comment webxr device apithe definition of 'xrinputsourcearray' in that specification.1 working draft xrinputsourcearray interface [1] see iterator-like methods in information contained in a webidl file for information on h...
XRInputSourceArray.forEach() - Web APIs
it thisarg, since all arrow functions lexically bind this. return value undefined. examples this example snippet gets the list of inputs for a session and tries to handle each type of input device it supports using. ...
... specifications specification status comment webxr device apithe definition of 'xrinputsourcearray' in that specification.1 working draft xrinputsourcearray interface [1] see iterator-like methods in information contained in a webidl file for information on h...
XRInputSourcesChangeEvent.added - Web APIs
ilable for use. syntax let addedinputs = xrinputsourceschangeevent.added; value an array of zero or more xrinputsource objects, each representing one input device added to the xr system. examples the example below creates a handler for the inputsourceschange event that processes the lists of added and removed from the webxr system. ...
..., each representing one input device added to the xr system. examples the example below creates a handler for the inputsourceschange event that processes the lists of added and removed from the webxr system. it looks for new and removed devices whose targetraymode is
tracked-pointer. xrsession.oninputsourcescchange = event => { for (let input of event.added) { if (input.targetraymode == "
tracked-pointer") { addedpointerdevice(input); } } for (let input of event.removed) { if (input.targetraymode == "
tracked-pointer") { removedpointerdevice(input); } } }; specifications specification status comment webxr device apithe definition of 'xrinputsourceschangeevent.added' in that specification. working draft initial definition. ...
XRInputSourcesChangeEvent.removed - Web APIs
xrsession. syntax removedinputs = xrinputsourceschangeevent.removed; value an array of zero or more xrinputsource objects, each representing one input device removed from the xr system. examples the example below creates a handler for the inputsourceschange event that processes the lists of added and removed from the webxr system. ...
...ch representing one input device removed from the xr system. examples the example below creates a handler for the inputsourceschange event that processes the lists of added and removed from the webxr system. it looks for new and removed devices whose targetraymode is
tracked-pointer. xrsession.oninputsourcescchange = event => { for (let input of event.added) { if (input.targetraymode == "
tracked-pointer") { addedpointerdevice(input); } } for (let input of event.removed) { if (input.targetraymode == "
tracked-pointer") { removedpointerdevice(input); } } }; specifications specification status comment webxr device apithe definition of 'xrinputsourceschangeevent.removed' in that specification. working draft initial definition...
XRPose.emulatedPosition - Web APIs
from the xr device, or it's simulated or computed based on other sources. syntax let emulated = xrpose.emulatedposition; value a boolean which is true if the pose's position is computed based on estimates or is derived from sources other than direct sensor data. if the position is precisely gbased on direct sensor inputs, the value is false. usage notes there are two basic categories of xr
tracking systems. a basic xr headset provides three degrees of freedom (3dof),
tracking the pitch, yaw, and roll of the user's head. no information is available about movement forward, backward, or to the sides. any such data is taken from other sources, such as keyboard or mouse inputs or game controllers. as such, the position is considered to be emulated, so the emulatedposition property is true. c...
... the same notion applies not just to the user's head, but to any object. ...
XRPose.transform - Web APIs
pecified when the pose was obtained by calling xrframe.getpose(). syntax let posetransform = xrpose.transform; value an xrrigidtransform which provides the position and orientation of the xrpose relative to the xrframe to which this xrpose is aligned. this is the same pose that's returned by the frame's getpose() method. example this handler for the xrsession event select handles events for
tracked pointers. it determines the targeted object by passing the event frame's pose into a function called findtargetusingray(), then dispatches the event differently depending on the user's handedness; this is done by comparing the value of the xrinputsource property handedness to a value in the variable user.handedness. if the source is a controller in the user's primary hand, a function is called ...
...d on the targeted object called primaryaction(); otherwise, it calls the targeted object's offhandaction() function. xrsession.addeventlistener("select", event => { let source = event.inputsource; let frame = event.frame; let targetraypose = frame.getpose(source.targetrayspace, myrefspace); let targetobject = findtargetusingray(targetray.transform.matrix); if (source.targetraymode == "
tracked-pointer") { if (source.handedness == user.handedness) { targetobject.primaryaction(); } else { targetobject.offhandaction(); } } }); specifications specification status comment webxr device apithe definition of 'xrpose.transform' in that specification. working draft initial definition. ...
XRSession.onselect - Web APIs
the onselect property of the xrsession object is the event handler for the select event, which is dispatched when a primary action is completed successfully by the user. this typically represents the pressing of a button or trigger, a hand gesture, or a spoken command. the select event is sent after
tracking of the primary action begins, as announced by the selectstart event, and immediately before the
tracking of the primary action ends, which is announced by the selectend event. to learn more about how webxr actions work, see inputs and input sources. syntax xrsession.onselect = selecthandlerfunction; value an event handler function to be invoked when the xrsession receives a select event. example this example handles select event which occur on the user's main hand (as gi...
... this example handles select event which occur on the user's main hand (as given by a user object's handedness property); if that value matches the value of the xrinputsource property handedness, we know that the device is held in the user's main hand. xrsession.onselect = event => { let source = event.inputsource; if (source.handedness == user.handedness) { if (source.targetraymode == "
tracked-pointer") { let targetraypose = event.frame.getpose(source.targetrayspace, myrefspace); if (targetraypose) { myhandleselectwithray(targetraypose); } } } }; specifications specification status comment webxr device apithe definition of 'xrsession.onselect' in that specification. working draft initial definition. ...
XRSession.requestAnimationFrame() - Web APIs
next time the browser is ready to paint the session's virtual environment to the xr display. the specified callback is executed once before the next repaint; if you wish for it to be executed for the following repaint, you must call requestanimationframe() again. this can be done from within the callback itself. the callback takes two parameters as inputs: an xrframe describing the state of all
tracked objects for the session, and a time stamp you can use to compute any animation updates needed. you can cancel a previously scheduled animation by calling cancelanimationframe(). note: despite the obvious similarities between these methods and the global requestanimationframe() function provided by the window interface, you must not treat these as interchangeable. there is no guarantee that t...
...d before the next repaint in order to allow you to update and render the xr scene based on elapsed time, animation, user input changes, and so forth. the callback receives as input two parameters: time a domhighrestimestamp indicating the time offset at which the updated viewer state was received from the webxr device. xrframe an xrframe object describing the state of the objects being
tracked by the session. this can be used to obtain the poses of the viewer and the scene itself, as well as other information needed to render a frame of an ar or vr scene. return value an integer value which serves as a unique, non-zero id or handle you may pass to cancelanimationframe() if you need to remove the pending animation frame request. example the following example requests xrsessio...
-webkit-border-before - CSS: Cascading Style Sheets
the element's writing mode, directionality, and text orientation. it corresponds to the border-top, border-right, border-bottom, or border-left property depending on the values defined for writing-mode, direction, and text-orientation. it relates to -webkit-border-after, -webkit-border-start, and -webkit-border-end, which define the other borders of the element. this property is on the standard
track as border-block-start. syntax values one or more of the following, in any order: <'border-width'> see border-width <'border-style'> see border-style <'color'> see color formal definition initial valueas each of the properties of the shorthand:border-width: as each of the properties of the shorthand:border-top-width: mediumborder-right-width: mediumborder-bottom-width: mediumborder-l...
... ...
::-webkit-scrollbar - CSS: Cascading Style Sheets
browsers on ios, and others). css scrollbar selectors you can use the following pseudo elements to customize various parts of the scrollbar for webkit browsers: ::-webkit-scrollbar — the entire scrollbar. ::-webkit-scrollbar-button — the buttons on the scrollbar (arrows pointing upwards and downwards). ::-webkit-scrollbar-thumb — the draggable scrolling handle. ::-webkit-scrollbar-
track — the
track (progress bar) of the scrollbar. ::-webkit-scrollbar-
track-piece — the part of the
track (progress bar) not covered by the handle. ::-webkit-scrollbar-corner — the bottom corner of the scrollbar, where both horizontal and vertical scrollbars meet. ::-webkit-resizer — the draggable resizing handle that appears at the bottom corner of some elements. syntax syntax not found...
... proin at nulla elementum, consectetur ex eget, commodo ante. sed eros mi, bibendum ut dignissim et, maximus eget nibh. phasellus blandit quam turpis, at mollis velit pretium ut. nunc conseq...
::cue-region - CSS: Cascading Style Sheets
::cue-region { color: yellow; font-weight: bold; } the properties are applied to the entire set of cues as if they were a single unit. the only exception is that background and its shorthand properties apply to each cue individually, to avoid creating boxes and obscuring unexpectedly large areas of the media. ...
... candidate recommendation initial definition. ...
::cue - CSS: Cascading Style Sheets
::cue { color: yellow; font-weight: bold; } the properties are applied to the entire set of cues as if they were a single unit. the only exception is that background and its longhand properties apply to each cue individually, to avoid creating boxes and obscuring unexpectedly large areas of the media. ...
... candidate recommendation initial definition. ...
Box alignment in grid layout - CSS: Cascading Style Sheets
rks in the context of css grid layout. as this page aims to detail things which are specific to css grid layout and box alignment, it should be read in conjunction with the main box alignment page which details the common features of box alignment across layout methods. basic example in this example using grid layout, there is extra space in the grid container after laying out the fixed width
tracks on the inline (main) axis. this space is distributed using justify-content. on the block (cross) axis the alignment of the items inside their grid areas is controlled with align-items. the first item overrides the align-items value set on the group by setting align-self to center. grid axes as a two-dimensional layout method, when working with grid layout we always have two axes on which to ...
...elf and justify-self is stretch so the item will stretch over the entire grid area. the exception to this rule is where the item has an intrinsic aspect ratio, for example an image. in this case the item will be aligned to start in both dimensions in order that the image is not distorted. content alignment justify-content align-content place-content these properties deal with aligning the
tracks of the grid when there is extra space to distribute. this scenario will occur if the
tracks that you have defined total less than the total width of the grid container. gap and legacy grid-gap properties row-gap column-gap gap grid-row-gap grid-column-gap grid-gap the grid specification originally contained the definition for the properties grid-row-gap, grid-column-gap and grid-gap. ...
CSS Box Alignment - CSS: Cascading Style Sheets
the box alignment specification should be referred to as it may add additional capabilities over what is currently in flexbox. basic examples the following examples demonstrate how some of the box alignment properties are applied in grid and flexbox. css grid layout alignment example in this example using grid layout, there is extra space in the grid container after laying out the fixed width
tracks on the inline (main) axis. this space is distributed using justify-content. on the block (cross) axis the alignment of the items inside their grid areas is controlled with align-items. the first item overrides the align-items value set on the group by setting align-self to center. flexbox alignment example in this example, three flex items are aligned on the main axis using justify-content a...
...olumn-gap properties. these properties enable the setting of a consistent gap between items in a row or column, in any layout method which has items arranged in this way. the gap property is a shorthand for row-gap and column-gap, which allows us to set these properties at once: row-gap column-gap gap in the below example, a grid layout uses the gap shorthand to set a 10px gap between row
tracks, and a 2em gap between column
tracks. in this example i am using the grid-gap property in addition to gap. the gap properties were originally prefixed with grid- in the grid layout specification and some browsers only support these prefixed versions. grid-row-gap grid-column-gap grid-gap the prefixed versions will be maintained as an alias of the unprefixed ones, however you can always...
CSS Grid Layout - CSS: Cascading Style Sheets
tml primitives. like tables, grid layout enables an author to align elements into columns and rows. however, many more layouts are either possible or easier with css grid than they were with tables. for example, a grid container's child elements could position themselves so they actually overlap and layer, similar to css positioned elements. basic example the example below shows a three-column
track grid with new rows created at a minimum of 100 pixels and a maximum of auto. items have been placed onto the grid using line-based placement. * {box-sizing: border-box;} .wrapper { max-width: 940px; margin: 0 auto; } .wrapper > div { border: 2px solid rgb(233,171,88); border-radius: 5px; background-color: rgba(233,171,88,.5); padding: 1em; color: #d9480f; } html <div class="wr...
...ies grid-template-columns grid-template-rows grid-template-areas grid-template grid-auto-columns grid-auto-rows grid-auto-flow grid grid-row-start grid-column-start grid-row-end grid-column-end grid-row grid-column grid-area row-gap column-gap gap css functions repeat() minmax() fit-content() css data types <flex> glossary entries grid grid lines grid
tracks grid cell grid area gutters grid axis grid row grid column guides basic concepts of grid layout relationship of grid layout to other layout methods layout using line-based placement grid template areas layout using named grid lines auto-placement in css grid layout box alignment in css grid layout css grid, logical values and writing modes css grid layout and accessibility ...
Touch events (Mozilla experimental) - Developer guides
18.0 / seamonkey 2.15), when support for the standard touch events was implemented. the experimental touch events api described on this page was available from gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) to gecko/firefox 17. you should instead use the standard touch events api, supported since gecko/firefox 6 with multi-touch support added in gecko/firefox 12. this api allowed you to
track the movement of the user's finger on a touch screen, monitoring the raw touch events generated by the system. although touch events were based on — and work similarly to — mouse events, each event included an identifier that allowed you to
track multiple fingers moving on the screen at the same time. event fields touch events were based upon mouseevent, and thereby shared all mouse event fiel...
...ouch events were based upon mouseevent, and thereby shared all mouse event fields. they included one additional field. streamid a unique integer identifying the finger generating the event. when the moztouchdown event is built, a unique value is assigned to that finger. corresponding moztouchmove and moztouchup events for that finger will have the same streamid value. this lets you
track each finger's movements on the touch screen independently. the stream id is unique until the moztouchup event occurs; after that, the value may be recycled for another series of events. types of touch events moztouchdown sent when the user begins a screen touch action. moztouchmove sent when the user moves his finger on the touch screen. moztouchup sent...
Index - Developer guides
o> elements remains pretty much the same. currently, to support all browsers we need to specify two formats, although with the adoption of mp3 and mp4 formats in firefox and opera, this is changing fast. you can find compatibility information in the guide to media types and formats on the web. 7 adding captions and subtitles to html5 video html5, media, webvtt, captions, subtitles,
track in other articles we looked at how to build a cross browser video player using the htmlmediaelement and window.fullscreen apis, and also at how to style the player. this article will take the same player and show how to add captions and subtitles to it, using the webvtt format and the <
track> element. 8 creating a cross-browser video player apps, html5, video, full screen ...
...e sent when handling media that are embedded in html documents using the <audio> and <video> elements; this section lists them and provides some helpful information about using them. 21 mouse gesture events advanced, dom gecko 1.9.1 added support for several mozilla-specific dom events used to handle mouse gestures. these are special movements that can be made with a mouse or
trackpad and can be interpreted to perform specific tasks. 22 mutation events advanced, dom, guide mutation events provide a mechanism for a web page or an extension to get notified about changes made to the dom. use mutation observers instead if possible. 23 orientation and motion data explained intermediate, mobile, motion, needscontent, orientation, páginas_a_tra...
<img>: The Image Embed element - HTML: Hypertext Markup Language
replace the image with the text in the element's alt attribute. for these reasons and others, provide a useful value for alt whenever possible. omitting alt altogether indicates that the image is a key part of the content and no textual equivalent is available. setting this attribute to an empty string (alt="") indicates that this image is not a key part of the content (it’s decoration or a
tracking pixel), and that non-visual browsers may omit it from rendering. visual browsers will also hide the broken image icon if the alt is empty and the image failed to display. this attribute is also used when copying and pasting the image to text, or saving a linked image to a bookmark. crossorigin indicates if the fetching of the image must be done using a cors request. image data from a c...
...loading the image until it reaches a calculated distance from the viewport, as defined by the browser. the intent is to avoid the network and storage bandwidth needed to handle the image until it's reasonably certain that it will be needed. this generally improves the performance of the content in most typical use cases. note: loading is only deferred when javascript is enabled. this is an anti-
tracking measure, because if a user agent supported lazy loading when scripting is disabled, it would still be possible for a site to
track a user's approximate scroll position throughout a session, by strategically placing images in a page's markup such that a server can
track how many images are requested and when. referrerpolicy a string indicating which referrer to use when fetching the ...
<input type="color"> - HTML: Hypertext Markup Language
the default is #000000, which is black. the value must be in seven-character hexadecimal notation, meaning the "#" character followed by two digits each representing red, green, and blue, like this: #rrggbb. if you have colors that are in any other format (such as css color names or css color functions such as rgb() or rgba()), you'll have to convert them to hexadecimal before setting the value.
tracking color changes as is the case with other <input> types, there are two events that can be used to detect changes to the color value: input and change. input is fired on the <input> element every time the color changes. the change event is fired when the user dismisses the color picker. in both cases, you can determine the new value of the element by looking at its value. here's an example that...
...u to choose a color from (in this case, the macos picker): validation a color input's value is considered to be invalid if the user agent is unable to convert the user's input into seven-character lower-case hexadecimal notation. if and when this is the case, the :invalid pseudo-class is applied to the element. example let's create an example which does a little more with the color input by
tracking the change and input events to take the new color and apply it to every <p> element in the document. html the html is fairly straightforward — a couple of paragraphs of descriptive material with an <input> of type color with the id colorwell, which we'll use to change the color of the paragraphs' text. <p>an example demonstrating the use of the <code><input type="color"></code> c...
<input type="hidden"> - HTML: Hypertext Markup Language
ubmitted, a hidden input whose name is set to _charset_ will automatically be reported with the value set to the character encoding used to submit the form. using hidden inputs as mentioned above, hidden inputs can be used anywhere that you want to include data the user can't see or edit along with the form when it's submitted to the server. let's look at some examples that illustrate its use.
tracking edited content one of the most common uses for hidden inputs is to keep
track of what database record needs to be updated when an edit form is submitted. a typical workflow looks like this: user decides to edit some content they have control over, such as a blog post, or a product entry. they get started by pressing the edit button. the content to be edited is taken from the database and ...
...ps the secret associated with the data and automatically includes it when the form is sent to the server. you need to use well-designed secrets to actually secure your website. validation hidden inputs don't participate in constraint validation; they have no real value to be constrained. examples let's look at how we might implement a simple version of the edit form we described earlier (see
tracking edited content), using a hidden input to remember the id of the record being edited. the edit form's html might look a little bit like this: <form> <div> <label for="title">post title:</label> <input type="text" id="title" name="title" value="my excellent blog post"> </div> <div> <label for="content">post content:</label> <textarea id="content" name="content" cols="60" ...
HTML documentation index - HTML: Hypertext Markup Language
erties to an item. every html element can have an itemprop attribute specified, and an itemprop consists of a name-value pair. each name-value pair is called a property, and a group of one or more properties forms an item. property values are either a string or a url and can be associated with a very wide range of elements including <audio>, <embed>, <iframe>, <img>, <link>, <object>, <source> , <
track>, and <video>. 23 itemref attribute, global attribute, html, html microdata, microdata, reference properties that are not descendants of an element with the itemscope attribute can be associated with an item using the global attribute itemref. 24 itemscope attribute, global attribute, html, html microdata, microdata, reference itemscope is a boolean globa...
...(<title>) defines the document's title that is shown in a browser's title bar or a page's tab. 212 <tr>: the table row element element, html, html tabular data, reference, tables, web, tag, tr, tr tag the html <tr> element defines a row of cells in a table. the row's cells can then be established using a mix of <td> (data cell) and <th> (header cell) elements. 213 <
track>: the embed text
track element accessibility, cues, element, html, html embedded content, html5, multimedia, reference, text
track, web, a11y,
track the html <
track> element is used as a child of the media elements, <audio> and <video>. it lets you specify timed text
tracks (or time-based data), for example to automatically handle subtitles. 214 <tt>: the teletype text element...
Evolution of HTTP - HTTP
ding http over a basic tcp/ip stack, netscape communications created an additional encrypted transmission layer on top of it: ssl. ssl 1.0 was never released outside the company, but ssl 2.0 and its successor ssl 3.0 allowed for the creation of e-commerce web sites by encrypting and guaranteeing the authenticity of the messages exchanged between the server and client. ssl was put on the standards
track and eventually became tls, with versions 1.0, 1.1, 1.2, and 1.3 appearing successfully to close vulnerabilities. during the same time, the need for an encrypted transport layer raised: the web left the relative trustiness of a mostly academic network, to a jungle where advertisers, random individuals or criminals compete to get as much private information about people, try to impersonate them or...
...tion of this policy. how much and when such restrictions are lifted is transmitted by the server to the client using a new bunch of http headers. these are defined in specifications like cross-origin resource sharing (cors) or the content security policy (csp). in addition to these large extensions, numerous other headers have been added, sometimes experimentally only. notable headers are do not
track (dnt) header to control privacy, x-frame-options, or upgrade-insecure-requests but many more exist. http/2 – a protocol for greater performance over the years, web pages have become much more complex, even becoming applications in their own right. the amount of visual media displayed, the volume and size of scripts adding interactivity, has also increased: much more data is transmitted over ...
DNT - HTTP
the dnt (do not
track) request header indicates the user's
tracking preference. it lets users indicate whether they would prefer privacy rather than personalized content. header type request header forbidden header name yes syntax dnt: 0 dnt: 1 dnt: null directives 0 the user prefers to allow
tracking on the target site. 1 the user prefers not to be
tracked on the target site. null the user has not specified a preference about
tracking. ...
...they would prefer privacy rather than personalized content. header type request header forbidden header name yes syntax dnt: 0 dnt: 1 dnt: null directives 0 the user prefers to allow
tracking on the target site. 1 the user prefers not to be
tracked on the target site. null the user has not specified a preference about
tracking. examples reading do not
track status from javascript the user's dnt preference can also be read from javascript using the navigator.donot
track property: navigator.donot
track; // "0" or "1" specifications specification status comment
tracking preference expression (dnt)the definition of 'dnt header field for http requests' in that specification. obsolete initial definition. ...
HTTP headers - HTTP
od used when issuing a preflight request to let the server know which http method will be used when the actual request is made. origin indicates where a fetch originates from. timing-allow-origin specifies origins that are allowed to see values of attributes retrieved via features of the resource timing api, which would otherwise be reported as zero due to cross-origin restrictions. do not
track dnt expresses the user's
tracking preference. tk indicates the
tracking status of the corresponding response. downloads content-disposition indicates if the resource transmitted should be displayed inline (default behavior without the header), or if it should be handled like a download and the browser should present a “save as” dialog. message body information content-length ...
...ructured header whose value is a boolean so possible values are ?0 for false and ?1 for true. sec-fetch-dest it is a request header that indicates the request's destination to a server. it is a structured header whose value is a token with possible values audio, audioworklet, document, embed, empty, font, image, manifest, object, paintworklet, report, script, serviceworker, sharedworker, style,
track, video, worker, xslt, and nested-document. server-sent events last-event-id ... nel defines a mechanism that enables developers to declare a network error reporting policy. ping-from ... ping-to ... report-to used to specify a server endpoint for the browser to send warning and error reports to. transfer coding transfer-encoding specifies the form of encoding used to safely ...
WeakSet - JavaScript
. if no other references to an object stored in the weakset exist, those objects can be garbage collected. note: this also means that there is no list of current objects stored in the collection. weaksets are not enumerable. use case: detecting circular references functions that call themselves recursively need a way of guarding against circular data structures by
tracking which objects have already been processed. weaksets are ideal for this purpose: // execute a callback on everything stored inside an object function execrecursively(fn, subject, _refs = null){ if(!_refs) _refs = new weakset(); // avoid infinite recursion if(_refs.has(subject)) return; fn(subject); if("object" === typeof subject){ _refs.add(subject); for(let key in subject) ...
...oo = { foo: "foo", bar: { bar: "bar" } }; foo.bar.baz = foo; // circular reference! execrecursively(obj => console.log(obj), foo); here, a weakset is created on the first run, and passed along with every subsequent function call (using the internal _refs parameter). the number of objects or their traversal order is immaterial, so a weakset is more suitable (and performant) than a set for
tracking object references, especially if a very large number of objects is involved. constructor weakset() creates a new weakset object. instance methods weakset.prototype.add(value) appends value to the weakset object. weakset.prototype.delete(value) removes value from the weakset. weakset.prototype.has(value) will return false afterwards. weakset.prototype.has(value) returns a boolea...
Web video codec guide - Web media technologies
ting the first frame to the right by two pixels, then by taking the difference. this compensates for the panning of the camera, allowing for more overlap between the two frames. images from wikipedia there are two general types of motion compensation: global motion compensation and block motion compensation. global motion compensation generally adjusts for camera movements such as
tracking, dolly movements, panning, tilting, rolling, and up and down movements. block motion compensation handles localized changes, looking for smaller sections of the image that can be encoded using motion compensation. these blocks are normally of a fixed size, in a grid, but there are forms of motion compensation that allow for variable block sizes, and even for blocks to overlap. there are, howe...
...m; codecs="av01.2.19h.12.0.000.09.16.09.1, flac"', bitspersecond: 800*mbps, }; let recorder = new mediarecorder(sourcestream, options); this example creates a mediarecorder configured to record av1 video using bt.2100 hdr in 12-bit color with 4:4:4 chroma subsampling and flac for lossless audio. the resulting file will use a bit rate of no more than 800 mbps shared between the video and audio
tracks. you will likely need to adjust these values depending on hardware performance, your requirements, and the specific codecs you choose to use. this bit rate is obviously not realistic for network transmission and would likely only be used locally. breaking down the value of the codecs parameter into its dot-delineated properties, we see the following: value desccription ...
2015 MDN Fellowship Program - Archive of obsolete content
og post, may 14 2015. mdn fellows successfully oriented blog post, july 6 2015. mdn fellows: what they did & what’s next blog post, september 23, 2015. 2015 mdn fellowship program launching in q1 2015, the mozilla developer fellowship intends to accelerate the involvement of highly-skilled and experienced web developers with the open web. who web and mobile developers with an established
track record of contributions and expertise in a specific web technology, function or domain who wish to increase the effectiveness of their teaching and communications. what seven weeks of partnering closely with mozilla to (1) build curriculum, code, or likely both; and (2) receive coaching, training and best practices for effectively communicating and educating with technical information. we expec...
SDK API Lifecycle - Archive of obsolete content
otice in the release notes, the add-ons blog, and the jetpack google group. the deprecation notice should point developers at a migration guide. migration the deprecation period defaults to 18 weeks (that is, three releases) although in some cases, generally those out of our control, it might be shorter than this. during this time, the module will be in the deprecated state. the sdk team will
track usage of deprecated modules on addons.mozilla.org and support developers migrating their code. the sdk will continue to provide warnings: api documentation will inform users that the module is deprecated. attempts to use a deprecated module at runtime will log an error to the error console. the amo validator will throw errors when deprecated modules are used, and these add-ons will therefore...
private-browsing - Archive of obsolete content
for example, the "downloads" window might want to display all downloads while there are still some private windows open, then clean out all the private data when all private windows have closed. to do ...
dev/panel - Archive of obsolete content
two-way messaging the panel document does not have an equivalent postmessage method, so if you want your panel document to communicate back to the add-on, you can use channel messaging. in the add-on side: require the sdk/messaging module create a messagechannel keep one messageport in the add-on side for receiving messages from the panel document pass the other messag...
ui/button/action - Archive of obsolete content
th a button, destroy it by calling its destroy() method. after that, any attempts to access any of its properties or to call any of its methods will throw exceptions. globals constructors actionbutton(options) creates an action button. parameters options : object required options: name type id string the button's id. this is used internally to keep
track of this button. the id must be unique within your add-on. label string the button's human-readable label. when the button is in the toolbar, this appears in a tooltip, and when the button is in the menu, it appears underneath the button as a legend. icon url, string, object one or more icons for the button. you can specify this in one of three ways:...
ui/button/toggle - Archive of obsolete content
ith a button, destroy it by calling its destroy() method. after that, any attempts to access any of its properties or to call any of its methods will throw exceptions. globals constructors togglebutton(options) creates a toggle button. parameters options : object required options: name type id string the button's id. this is used internally to keep
track of this button. the id must be unique within your add-on. label string the button's human-readable label. when the button is in the toolbar, this appears in a tooltip, and when the button is in the menu, it appears underneath the button as a legend. icon url, string, object one or more icons for the button. you can specify this in one of three ways:...
Miscellaneous - Archive of obsolete content
example for firefox: services.startup.quit(services.startup.eforcequit|services.startup.erestart); mouse and keyboard detecting mouse wheel events when scrolling the mouse wheel on an element, the dommousescroll event fires. event.detail contains the number of lines to scroll. this event is mozilla-only; othe...
JavaScript Daemons Management - Archive of obsolete content
daemons are all processes created by javascript timers or by a worker instantiation. here are some code snippets that simplify and abstract the management of daemons. the following daemons management framework is the major version of setinterval – a little framework. introduction sometimes a page uses dozens and dozens of animations. in such a condition it is difficult and unnatural to keep
track of all events started and then to stop them when appropriate through the cleartimeout() function. a possible approach to solve this problem is to nest all the information needed by each animation to start, stop, etc. in different objects (daemons) and then to create a constructor for such a class of objects (daemon) in order to standardize and simplify the instantiation of them. note: a minimali...
How to convert an overlay extension to restartless - Archive of obsolete content
at your typed array with. data that's homogeneous might get away with using something like uint32array or one of the other standard typed array views, but it's probably a bad idea. the basic typed array views are not endian-safe. this is incredibly stupid. you'd think such an important new javascript feature made available for web content and chrome alike would at least have a way to set and keep
track of endianness, but no, it doesn't. don't use any of the basic typed arrays for any data you did not earlier write into them in the same program session. also, they're not particularly helpful if your data isn't all of the exact same type (which it probably isn't). the solution to read arbitrary binary data, of various sizes, in an endian-safe way, is to use dataview. the other typed array stuff ...
Appendix F: Monitoring DOM changes - Archive of obsolete content
easible. often times, this must be used in combination with a slight delay, or even polling, via settimeout, for cases where the url change happens before the page is fully loaded. this method works particularly well with services like google instant, and the gawker family of sites. network listeners ajax-based page changes are almost universally tied to xmlhttprequests. these requests can be
tracked from chrome code using a variety of methods, including web progress listeners, http observers, and content policies. while these are not exceptionally efficient (they run for every http request, and considerably more often for some methods), they work very well for certain applications pure css pure css can be more powerful than most people suspect. it is often possible to do things for which...
Connecting to Remote Content - Archive of obsolete content
to rdf. this was more useful when rdf was the default storage format. you can still use rdf as an intermediate format, though, and then use templates to generate xul and display the data. http debugging when you start debugging http requests, you may find it hard to know exactly what data was sent, especially with post data. we recommend you to use extensions like tamper data. they help you to
track http/https requests and responses occurring in firefox. after installation, you can find a tamper data menu item in the menu bar: tools > tamper data or view > sidebar > tamper data once you open the tamper data view, all requests and responses will begin to appear in it. you can discover some interesting things about firefox like this, such as the automatic update urls for extensions, and...
Handling Preferences - Archive of obsolete content
st place to put miscellaneous files your extension needs. download this sample hello world using preferences. there are a couple of additions in the makefiles, to include the preference file xulschoolhello.js. the contents of the file are fairly simple: // amount of messages shown to the user. pref("extensions.xulschoolhello.message.count", 0); this defines a preference we'll use to keep
track of the amount of times we have displayed a greeting message to the user. its default value is 0. you'll see this preference appear in about:config after installing the extension. just type "xulschool" in the filter box to see your new preference. note: always begin your preference names with "extensions", followed by some namespacing and finally the actual name of the preference. name parts are ...
Mozilla Documentation Roadmap - Archive of obsolete content
re thousands of extensions out there, and you may strike luck and find one that does exactly what you need. be sure to look at the license the extension's code is released with before thinking about copying large sections of it. also, remember to give credit when it's due. mozilla's bugzilla repository. pretty much every code change done in firefox and mozilla projects is documented in this huge
tracking database. but this also means that finding exactly what you need can be time-consuming, and often fruitless. the advanced search is very useful in filtering results, but it is our experience that it's often better to be too general than too specific. better to scan a list of hundreds of bugs than getting no results at all, right? anywhere else. use your favorite search engine and patiently lo...
Setting Up a Development Environment - Archive of obsolete content
xtension and browser code, right-click on the loaded scripts panel and uncheck exclude browser files. the list of loaded scripts will grow long to include all of the scripts in firefox. having our file naming conventions prove very useful in this case. you can set breakpoints, step in and out of methods, and even get profiling information from javascript execution. you can inspect variables, keep
track of watch expressions, and evaluate arbitrary js at any point in execution. this extension has seen little maintenance in quite some time, so it is very buggy. it is specially unreliable when debugging code in javascript xpcom and xbl files. nevertheless, it is a valuable tool when trying to figure out why a certain function is misbehaving. tamper data tamper data intercepts http requests and t...
Useful Mozilla Community Sites - Archive of obsolete content
nificant portion of users that use a localized version of firefox, so you shouldn't neglect them. using babelzilla takes little time and is very valuable. mozdev mozdev.org provides free project hosting and software development tools for mozilla applications and add-ons. it is the only hosting service tailored to the needs of the mozilla community. it offers many necessary services such as bug
tracking, source code repositories, download mirrors and many communication tools. there are other free hosting sites such as souceforge and google code that are also very good, but not as specialized as mozdev. you should pick the one that best fits your development needs. conclusion that's it! this is the end of the xul school tutorial. hopefully this guide has helped you get started with add-on d...
XPCOM Objects - Archive of obsolete content
ponent using jsm and the xpcomutils module. download this version of the hello world project with xpcom to see how xpcom files are structured in the project and built. (your build will probably break, we'll cover this later on.) in the components directory, the file xsihellocounter.idl has the following contents: #include "nsisupports.idl" /** * counter for the hello world extension. keeps
track of how many times the * hello world message has been shown. */ [scriptable, uuid(bd46f689-6c1d-47d0-bc07-bb52b546b8b5)] interface xsihellocounter : nsisupports { /* the maximum allowed count. */ const short max_count = 100; /* the current count. */ readonly attribute short count; /** * increments the display count and returns the new count. * @return the incremented count. ...
Supporting search suggestions in search plugins - Archive of obsolete content
turn an url to a map in this array. if you don't specify a query url, the default query is used based on the search described by the <url> element in the search plugin's xml description. query urls are not supported in firefox, and are ignored. this enhancement request - the handling of a selected suggestion, namely calling of a full specified url as proposed in the opensearch standard - is
tracked in bug 386591. for example, if the search term is "fir", and you don't need to return descriptions or alternate query urls, you might return the following json: ["fir", ["firefox", "first choice", "mozilla firefox"]] note that in this example, only the query string and completion array are specified, leaving out the optional elements. your completion list can include as many suggestions as...
Promises - Archive of obsolete content
est. xhr = yield request(updateurl, { data: form }); // use the response of the second request. notifyuser(xhr.responsetext); }); downloading remote files nearly all previous methods of downloading remote files have been superseded by the much simpler downloads.jsm module. the downloads object provides a promise-based api for downloading remote files, with full support for progress
tracking, pause and resume, and, optionally, integration with the download manager ui. representative example usage components.utils.import("resource://gre/modules/downloads.jsm"); task.spawn(function* () { // fetch a file in the background. let download_1 = downloads.fetch(url_1, path_1); // fetch a file visible in the download manager. let download_2 = yield downloads.createdownloa...
Inner-browsing extending the browser navigation paradigm - Archive of obsolete content
gh embeddable third-party resources like flash, java, vrml, etc. additionally, server-side technologies have also evolved, supporting and connecting different resources to different browsers. despite all the evolution, we still see the underpinnings of the original model in modern web sites. we still connect through a set of links that mostly drive us to a new page, and we still occasionally lose
track of where we are. also, on the server side, the server often has to rebuild all of the context of the user interface with each new request. of course, this traditional approach is useful and easy to implement, which is why it is still so widely used. but the real showcase for new browser features and web standards like html 4.0 and dom level 2, and xml are models like inner-browsing, where these t...
Source code directories overview - Archive of obsolete content
index (stored in fat.db in mozilla classic). this code originated at uc berkeley. directory contains the ldap sdk. docshell contains c interfaces and code for loading and displaying a single web page (e.g. scroll). the [#seamonkey-embedding embedding] code wraps this code with higher level browser functions like forward, back and history. dom contains c interfaces and code for implementing and
tracking dom (document object model) objects in javascript. it forms the c substructure which creates, destroys and manipulates built-in and user-defined objects according to the javascript script. for example, if the javascript script adds a user-defined attribute to the document (e.g. document.goofy = 1), this code will create the "goofy" node, put it on the "document" node and manipulate it accordin...
Conclusion - Archive of obsolete content
you modify the xpi structure and installer script to install these files in that subdirectory? how could you modify the extension to load the tinderbox page when you click on the status icon? mozilla has a fourth ui layer--localized text--that wasn't discussed in the tutorial because there is no text to localize. how could it be added to the extension if necessary? tinderbox actually keeps
track of more than one codebase. in particular, it
tracks both the main mozilla codebase (the trunk) and a stable branch. how could you modify tinderstatus to show the status of both the trunk and the branch? this extension can be installed into netscape 7 without problems. firefox has slightly different chrome registry requirements, so you may need to modify the contents.rdf files. for example, you ...
Tamarin - Archive of obsolete content
n in c++. it currently implements adobe actionscript™ 3 (a superset of ecmascript edition 3) and is embedded within the adobe® flash® player versions 9 and later. tamarin's jit-compiler, nanojit, is also used in tracemonkey ergo spidermonkey, which is mozilla’s javascript engine in firefox. tamarin is available under the mpl/gpl/lgpl tri-license. releases release
tracking information on current, past, and upcoming releases of tamarin. documentation adobe actionscript virtual machine 2 (avm2) overview (pdf, 400k) the instructions, architecture, and file format supported by the avm2. see also the possible errata. tamarin build documentation how to get, build, and use tamarin. tamarin build system doc...
The Download Manager schema - Archive of obsolete content
the table is kept in a database file named "downloads.sqlite", in a table called "moz_downloads". the current database schema version is 8. this information is available using nsidownloadmanager methods to retrieve nsidownload objects for each download entry; however, if you feel like poking directly into the table, you can do so using the storage api. the schema table field name type description id integer a unique id for the download. this field is the primary key for the table. name text the download's file name. ...
Treehydra Manual - Archive of obsolete content
y, which have many ports of gcc macros and other functions for conveniently accessing gimple data in javascript. esp abstract interpretation library treehydra includes a library for creating abstract interpretation analyses based on esp. users only need to define their esp property variables, abstract values, and the flow semantics of gimple statements, and the library will do all of the substate
tracking and fixed-point solving. the library is at unstable/esp.js. there is a sample application that checks for double-locking in a simple mutex api in test/esp_lock.js. abstract interpretation is a big topic, which is not yet fully documented here. for now, here is an explanation of some of the terminology that is often confusing: concrete value. a value in the programming language being analyzed.
Venkman Internals - Archive of obsolete content
defines the dd debug dump and friends windowrecord representation of the open windows. filecontainerrecord - list of script tags found in the parent record's window.document property. to obtain the antecedent files: doc.getelementsbytagname("script"); then extract the urls from the src attributes. scriptwrapper newsgroup, 2002, rgrinda here is a bit more information about how venkman
tracks files and functions... a scriptwrapper is a pure js object defined only inside venkman. as you pointed out, there is a 1:1 relationship between scriptwrappers and functions. scriptwrapper has-a jsdscript property, which is an object which supports the jsdiscript interface. jsdiscript is a lower level access to the function than the scriptwrapper. in order to set a breakpoint in a particular func...
Venkman Introduction - Archive of obsolete content
submenu of the view menu. the list displayed there includes all of the basic views in venkman. as you change which views are displayed and where in the ui they appear, your preferences are stored and persisted across sessions. loading scripts into the debugger whether or not you start venkman first or the browser component, when the mozilla suite starts up, the javascript engine begins to keep
track of and compile all the scripts that are loaded in web pages and in the various mozilla user interfaces themselves. the engine tells venkman about the scripts it knows about, and those scripts are loaded into the "loaded scripts" view in the debugger. if you want to load new scripts in—say from a web page you are trying to troubleshoot—you can do so by simply opening that web page in the regu...
XBL - Archive of obsolete content
see also: xbl removal design review packet, problems with xbl and the xbl and web components comparison. xml binding language (xbl, sometimes also called extensible bindings language) is a language for describing bindings that can be attached to elements in other documents. the element that the binding is attached to, called the bound element, acquires the new behavior specified by the binding. ...
Learn XPI Installer Scripting by Example - Archive of obsolete content
install api reference for a list of keywords). registering the software registering software is sometimes a requirement of both the operating system and of the netscape 6 platform. when you install new chrome, for example, like the browser.xpi install does, you need to alert the chrome registry to these changes, so that skins, user preferences, packaging lists, and localization bundles will all
track the new software. for registering software with the win32 operating system, the xpinstall api provides two special install objects, winprofile and winreg. these two objects provide programmatic access to the windows user profile and the windows registry, respectively. the browser.xpi install script does not demonstrate the use of these objects, but see the xpinstall api reference for more inform...
XML Templates - Archive of obsolete content
example '*' which is typically used. an example: <listbox datasources="people.xml" ref="*" querytype="xml"> <template> ... </template> <listbox> the url in the datasources attribute may be a relative url or an absolute url. note: if you want to have the state of the disclosure triangles ("twisties") be persistent, be sure to give each node a unique "id" attribute. these are used to
track the current state of the disclosure triangles. support for this was introduced in gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4). for this and the following examples, we are going to use the following xml document containing a list of people: <people> <person name="napoleon bonaparte" gender="male"/> <person name="cleopatra" gender="female"/> <person name="julius caesar" gender...
Focus and Selection - Archive of obsolete content
r. you can use it for any element and event type. it takes three parameters, the event type, a function to execute when the event occurs and a boolean indicating whether to capture or not. getting the currently focused element the currently focused element is held by an object called a command dispatcher, of which there is only one for the window. the command dispatcher is responsible for keeping
track of the focused element as the user uses the interface. the command dispatcher has other roles, which will be discussed in a later section on commands. for now, we'll look at some of the focus related features of the command dispatcher. you can retrieve the command dispatcher from a window using the document's commanddispatcher property. from there, you can get the focused element with the dispatc...
More Tree Features - Archive of obsolete content
t will have a level of 2, and so on. the tree will query the view for the level of each item in order to determine how to draw the rows. the tree will draw the open and close icons to open and close a parent item as well as lines connecting the children to their parents. the tree will also handle drawing the rows with the right level of indenting. however, the view will need to make sure it keeps
track of the level of the rows as necessary. this can sometimes be quite tricky, but fortunately, the built-in content tree view does all of the hard work for us. to create a set of nested rows, all we need to do is add a second treechildren element inside the parent treeitem. you can then add items inside that to specify the child rows of an item. don't put the inner treechildren element inside the tr...
The Implementation of the Application Object Model - Archive of obsolete content
single content node could be initialized with its uri by its parent node, it could store its uri in a member variable, and it could use that as a basis for resolving the pluggable data source from which it would obtain its information. statement #2 all content nodes that reside in the aom and that implement the content tree interfaces must be the same class of object. so now we're on the right
track, but there are still some flaws in our architecture. let's consider another required feature that has heretofore gone unmentioned in this document: the need to take the same set of data and present it as completely different content models. the perfect example of this requirement is the personal toolbar. the personal toolbar must show up in a tree widget (in which case it has to be faking a tree ...
tabbrowser - Archive of obsolete content
atindex( index ) return type: browser element returns a browser at the specified tab index. getbrowserindexfordocument( document ) return type: integer returns the index of the browser for the specified document in the tabbrowser the method was invoked on. the returned index is dependent on the tabs in the tabbrowser and is invalidated when the tab ordering changes. it should not be used to
track per-tab data during a session; the use of linkedpanel on the corresponding tab is preferred instead. getbrowserfordocument( document ) return type: browser element returns a browser for the specified document. getbrowserfortab( tab ) return type: browser element returns a browser for the specified tab element. geticon( atab ) return type: string returns the url of the specifie...
XULRunner 1.8.0.1 Release Notes - Archive of obsolete content
ed on xulrunner will be available in future releases. i'm writing a xul application, how can i deploy that application to my users? right now mozilla recommends that xulrunner should be deployed privately with each application. see deploying xulrunner 1.8 for more information. where is the source code? here. i think i've found a bug, how do i report it? bugzilla.mozilla.org is used to
track bugs in all mozilla products. please search to make sure that your bug has not already been reported. how can i help? if you want to help with xulrunner but don't know where to start, visit the xulrunner:community page and ask questions on the newsgroups or the irc channel. ...
XULRunner 1.8.0.4 Release Notes - Archive of obsolete content
on xulrunner will be available in future releases. i'm writing a xul application, how can i deploy that application to my users? right now mozilla recommends that xulrunner should be deployed privately with each application. see deploying xulrunner 1.8 for more information. where is the source code? here. i think i've found a bug, how do i report it? bugzilla.mozilla.org is used to
track bugs in all mozilla products. please search to make sure that your bug has not already been reported. how can i help? if you want to help with xulrunner but don't know where to start, visit the xulrunner:community page and ask questions on the newsgroups or the irc channel. interwiki language links ...
XULRunner 1.9.1 Release Notes - Archive of obsolete content
writing a xul application, how can i deploy that application to my users? right now mozilla recommends that xulrunner should be deployed privately with each application. see deploying xulrunner for more information. where is the source code? here. where is the sdk? here. i think i've found a bug, how do i report it? bugzilla.mozilla.org is used to
track bugs in all mozilla products. please search to make sure that your bug has not already been reported. how can i help? if you want to help with xulrunner but don't know where to start, visit the xulrunner:community page and ask questions on the newsgroups or the irc channel. ...
XULRunner 1.9.2 Release Notes - Archive of obsolete content
lrunner will be available in future releases. i'm writing a xul application, how can i deploy that application to my users? right now mozilla recommends that xulrunner should be deployed privately with each application. see deploying xulrunner for more information. where is the source code? here. where is the sdk? here. i think i've found a bug, how do i report it? bugzilla.mozilla.org is used to
track bugs in all mozilla products. please search to make sure that your bug has not already been reported. how can i help? if you want to help with xulrunner but don't know where to start, visit the xulrunner:community page and ask questions on the newsgroups or the irc channel. ...
XULRunner 1.9 Release Notes - Archive of obsolete content
will be available in future releases. i'm writing a xul application, how can i deploy that application to my users? right now mozilla recommends that xulrunner should be deployed privately with each application. see deploying xulrunner for more information. where is the source code? here. where is the sdk? here. i think i've found a bug, how do i report it? bugzilla.mozilla.org is used to
track bugs in all mozilla products. please search to make sure that your bug has not already been reported. how can i help? if you want to help with xulrunner but don't know where to start, visit the xulrunner:community page and ask questions on the newsgroups or the irc channel. ...
XULRunner 2.0 Release Notes - Archive of obsolete content
i'm writing a xul application, how can i deploy that application to my users? right now mozilla recommends that xulrunner should be deployed privately with each application. see deploying xulrunner for more information. where is the source code? here. where is the sdk? here. see gecko sdk for information about the sdk. i think i've found a bug, how do i report it? bugzilla.mozilla.org is used to
track bugs in all mozilla products. please search to make sure that your bug has not already been reported. how can i help? if you want to help with xulrunner but don't know where to start, visit the xulrunner:community page and ask questions on the newsgroups or the irc channel. ...
XULRunner FAQ - Archive of obsolete content
ner will be available in future releases. i'm writing a xul application, how can i deploy that application to my users? right now mozilla recommends that xulrunner should be deployed privately with each application. see deploying xulrunner 1.8 for more information. where is the source code? here. i think i've found a bug, how do i report it? bugzilla.mozilla.org is used to
track bugs in all mozilla products. please search to make sure that your bug has not already been reported. how can i help? if you want to help with xulrunner but don't know where to start, visit the xulrunner:community page and ask questions on the newsgroups or the irc channel. ...
XULRunner Hall of Fame - Archive of obsolete content
n matthew kastor's xulrunner examples at https://github.com/matthewkastor/xulrunner-examples/ exch a currency conversion tool using updated data from http://finance.yahoo.com/currency. you can use the firefox extension or the stand-alone xul application. opendocument viewer cross-platform viewer for opendocument files. taskpool taskpool is a little application to help keep
track of time. you can add tasks to a pool, turn them on and off, and it will tick off seconds. svgclock an svg-based clock. crowbar a web scraping environment based on the use of a server-side headless mozilla-based browser. 30b a xulrunner-based wrapper for 30boxes.com xul explorer "a lightweight xul ide... an easy way to experiment with xul" xulexplorer a patc...
XULRunner - Archive of obsolete content
tutorial on building desktop applications with xulrunner. xul tutorial once you have a working xulrunner application, use the xul tutorial to expand it into a fantastic xul application. xulrunner tips a collection of tips for working with xulrunner. deploying xulrunner an introduction on how to package your application with xulrunner. xulrunner hall of fame
tracks all available applications based on xulrunner. build documentation learn how to get the source and build it. debug documentation steps to configure venkman to debug your app xulrunner guide a fairly complete, but outdated, introduction and tutorial for xulrunner which collates much of the documentation found here. view all... community ...
nsIContentPolicy - Archive of obsolete content
content policy implementations, and should not be used outside gecko core code. type_internal_video 31 an internal constant used to represent content loaded from <video> elements. important: this type is mapped to type_media before being passed to content policy implementations, and should not be used outside gecko core code. type_internal_
track 32 an internal constant used to represent content loaded from <
track> elements. important: this type is mapped to type_media before being passed to content policy implementations, and should not be used outside gecko core code. reject_request -1 returned from shouldload() or shouldprocess() if the load or process request is rejected based on details of...
Mozilla release FAQ - Archive of obsolete content
t the sender is *using* netscape communicator to deliver the mail. if you're getting mail contents of one of the mozilla newsgroups, it's likely because you subscribed (or someone subscribed you) to the mailing list form of those groups. as to the first case, there's no connection between the mozilla project and the spam. you might want to visit the open directory project's spam pages to help you
track down the origin. for the second case, go to the mozilla community section to unsubscribe original document information author(s): pat gunn last updated date: may 28, 2005 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
2006-10-06 - Archive of obsolete content
discussions firefox trunk and rc1 slowdown using tabs discussion regarding certain theme components (specifically alpha-transparency) creating a high cpu load on os/2. ...
2006-11-10 - Archive of obsolete content
other important notes are contained in the link above firefox and thunderbird 1.5.0.8 were released firefox and thunderbird 1.5.0.8 were released on november 7, 2006 blocker nomination and code freeze for 1.5.0.9/2.0.0.1 blocker nomination is due on november 10. ...
2006-10-06 - Archive of obsolete content
summary: mozilla.dev.platform - september 30th to october 6th 2006 announcements mike schroepfer is attending a vista compatibility lab with some other people this week. they are testing firefox and thunderbird on vista. they are
tracking issues on http://wiki.mozilla.org/vistalab , and on #vista on irc. other traffic there was no traffic on mozilla.dev.platform this week. please see the faq instead ...
NPN_GetValue - Archive of obsolete content
window on which plug-in drawing occurs. the method returns a value of type hwnd. in many cases, a plug-in may still have to create its own window (a transparent child window of the browser window) to act as the owner window for popup menus and modal dialogs. this transparent child window can have its own windowproc within which the plug-in can deal with wm_command messages sent to it a result of
tracking the popup menu or modal dialog. see also npn_setvalue, npp_getvalue ...
Adobe Flash - Archive of obsolete content
ows fscommands in action. if you are embedding a flash animation and wish to use fscommands in netscape gecko browsers, currently you must use the embed element and not the object element. you can always nest the embed element within the object element that you serve to ie. future flash versions may support the object element for use with fscommands in netscape gecko browsers. this issue is being
tracked in mozilla's bug 184722. the background color of the entire page is toggled by clicking on a color within the flash animation. clicking on the animation makes a callback to the external environment that hosts the plugin (the html page) and looks for a javascript method to handle the call from within flash. the call is made within the flash animation's actionscript methods. javascript functions...
::-ms-fill-lower - Archive of obsolete content
a slider control is one possible representation of <input type="range">. allowable properties only the following css properties can be used in a rule with ::-ms-fill-lower in its selector. other properties are ignored. ...
New in JavaScript 1.8 - Archive of obsolete content
using javascript 1.8 in order to use some of the new features of javascript 1.8 in html, use: <script type="application/javascript;version=1.8"> ... your code ... </script> another way (not recommended) to do this is to use the deprecated <script> language attribute and define it as "javascript1.8". when using the javascript shell, javascript xpcom components, or xul <script> elements, the latest js version (js1.8 in mozilla 1.9) is used automatically (bug 381031, bug 385159). ...
Old Proxy API - Archive of obsolete content
do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. warning: the spidermonkey proxy implementation is a prototype and the proxy api and semantics specifications are unstable. the spidermonkey implementation may not reflect the latest specification draft. it is subject to change anytime. it is provided as an experimental feature. do not rely on it for production code. ...
Window.importDialog() - Archive of obsolete content
do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. obsoletethis feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. this function was only available in the original, xul-based version of firefox for android, which is no longer supported; for that reason, this function is obsolete and should never be used. ...
RDF in Mozilla FAQ - Archive of obsolete content
ng tricks and tips from the field. my rdf/xml file won't load. the most common cause for rdf/xml not to load from a web server is incorrect mime type. make sure your server is delivering the file as text/xml (recommended) or text/rdf (bogus). note that the w3c rdf core wg are registering application/rdf+xml, though this isn't understood by any mozilla code yet. (do we have a bug registered to
track this? -- danbri) another possible problem: for remotely-loaded xul and rdf, you might need to adjust mozilla's security restrictions (see belowfor example code). if xul isn't loading your rdf, and the mimetype is ok, this could well be your problem. you can use the rdfcat and rdfpoll utilities to verify that the rdf/xml is actually valid. both of these programs are built by default on windows, ...
Using the Right Markup to Invoke Plugins - Archive of obsolete content
rs by using the appropriate java mime type. here is an example: <object type="application/x-java-applet;jpi-version=1.4.1_01" width="460" height="160"> <param name="code" value="animator.class" /> <param name="imagesource" value="images/beans" /> <param name="backgroundcolor" value="0xc0c0c0" /> <param name="endimage" value="10" /> <param name="soundsource" value="audio"> <param name="sound
track" value="spacemusic.au" /> <param name="sounds" value="1.au|2.au|3.au|4.au|5.au|6.au|7.au|8.au|9.au|0.au" /> <param name="pause" value="200" /> <p>you need the java plugin. get it from <a href="http://java.sun.com/products/plugin/index.html">here.</a></p> </object> the above code mentions a version specific mime type, and if the mozilla-based browser such as netscape 7 doesn't have j...
Desktop gamepad controls - Game development
function that is executed once when the new state is created: create() { // ... var message = 'gamepad connected! press y for controls'; var textgamepad = this.add.text(message, ...); textgamepad.visible = false; } in the update() function, which is executed every frame, we can wait until the controller is actually connected, so the proper text can be shown. then we can keep the
track of the information about pressed buttons by using the gamepad.update() method, and react to the given information: update: function() { // ... if(gamepadapi.active) { if(!this.textgamepad.visible) { this.textgamepad.visible = true; } gamepadapi.update(); if(gamepadapi.buttons.pressed('start')) { // start the game } i...
2D breakout game using pure JavaScript - Game development
dge. after working through this tutorial you should be able to build your own simple web games. lesson details all the lessons — and the different versions of the mdn breakout game we are building together — are available on github: create the canvas and draw on it move the ball bounce off the walls paddle and keyboard controls game over build the brick field collision detection
track the score and win mouse controls finishing up starting with pure javascript is the best way to get a solid knowledge of web game development. after that, you can pick any framework you like and use it for your projects. frameworks are just tools built with the javascript language; so even if you plan on working with them, it's good to learn about the language itself first to know what exactly...
2D maze game with device orientation - Game development
hysics.arcade.collide(this.ball, this.levels[this.level-1], this.wallcollision, null, this); this will tell the framework to execute the wallcollision function when the ball hits any of the walls. we can use the wallcollision function to add any functionality we want like playing the bounce sound and implementing the vibration api. adding the sound among the preloaded assets there was an audio
track (in various formats for browser compatibility), which we can use now. it has to be defined in the create() function first: this.bouncesound = this.game.add.audio('audio-bounce'); if the status of the audio is true (so the sounds in the game are enabled), we can play it in the wallcollision function: if(this.audiostatus) { this.bouncesound.play(); } that's all — loading and playing the s...
Alignment subject - MDN Web Docs Glossary: Definitions of Web-related terms
iners (including table cells) the entire content of the block as a single unit. multicol containers the column boxes, with any spacing inserted between column boxes added to the relevant column gaps. flex containers for justify-content, the flex items in each flex line. for align-content, the flex lines. note, this only has an effect on multi-line flex containers. grid containers the grid
tracks in the appropriate axis, with any spacing inserted between
tracks added to the relevant gutters. collapsed gutters are treated as a single opportunity for space insertion. learn more css box alignment ...
Call stack - MDN Web Docs Glossary: Definitions of Web-related terms
when a script calls a function, the interpreter adds it to the call stack and then starts carrying out the function. any functions that are called by that function are added to the call stack further up, and run where their calls are reached. when the current function is finished, the interpreter takes it off the stack and resumes execution where it left off in the last code listing. ...
Empty element - MDN Web Docs Glossary: Definitions of Web-related terms
ations have no semantic meaning, for example an <audio> element nested inside an <hr> element. in html, using a closing tag on an empty element is usually invalid. for example, <input type="text"></input> is invalid html. the empty elements in html are as follows: <area> <base> <br> <col> <embed> <hr> <img> <input> <keygen>(html 5.2 draft removed) <link> <meta> <param> <source> <
track> <wbr> ...
Grid Cell - MDN Web Docs Glossary: Definitions of Web-related terms
in a css grid layout, a grid cell is the smallest unit you can have on your css grid. it is the space between four intersecting grid lines and conceptually much like a table cell. if you do not place items using one of the grid placement methods, direct children of the grid container will be placed one into each individual grid cell by the auto-placement algorithm. additional row or column
tracks will be created to create enough cells to hold all items. in the example we have created a three column
track grid. the five items are placed into grid cells working along an initial row of three grid cells, then creating a new row for the remaining two. * {box-sizing: border-box;} .wrapper { border: 2px solid #f76707; border-radius: 5px; background-color: #fff4e6; } .wrapper >...
Grid Column - MDN Web Docs Glossary: Definitions of Web-related terms
it is defined by the grid-template-columns property or in the shorthand grid or grid-template properties. in addition, columns may be created in the implicit grid when items are placed outside of columns created in the explicit grid. these columns will be auto-sized by default, or can have a size specified with the grid-auto-columns property. when working with alignment in css grid layout, the axis down which columns run is known as the block, or column, axis. ...
Grid Row - MDN Web Docs Glossary: Definitions of Web-related terms
it is defined by the grid-template-rows property or in the shorthand grid or grid-template properties. in addition, rows may be created in the implicit grid when items are placed outside of rows created in the explicit grid. these rows will be auto sized by default, or can have a size specified with the grid-auto-rows property. when working with alignment in css grid layout, the axis along which rows run is known as the inline, or row, axis. ...
SCM - MDN Web Docs Glossary: Definitions of Web-related terms
scm (source control management) is a system for managing source code. usually it refers to the use of software to handle versioning of source files. a programmer can modify source code files without being afraid of editing out useful stuff, because a scm keeps
track of how the source code has changed and who made the changes. some scm systems include cvs, svn, git. learn more general knowledge revision control on wikipedia ...
Style origin - MDN Web Docs Glossary: Definitions of Web-related terms
a developer tool or from a browser extension that automatically applies custom styles to content, such as stylus or stylish. author origin the author origin is the style origin which contains all of the styles which are part of the document, whether embedded within the html or loaded from an external stylesheet file. the style origins are used to determine where to stop rolling back (or back
tracking through) the cascade of styles that have been applied to an element when removing styles, such as when using the unset or revert keywords. learn more technical information css cascading and inheritance: cascading origins ...
MDN Web Docs Glossary: Definitions of Web-related terms
eneral header gif gij git global object global scope global variable glyph gonk google chrome gpl gpu graceful degradation grid grid areas grid axis grid cell grid column grid container grid lines grid row grid
tracks guard gutters gzip compression h hash head high-level programming language hmac hoisting host hotlink houdini hpkp hsts html html5 http http header http/2 http/3 https hyperlink hypert...
What is accessibility? - Learn web development
group of people has either low hearing levels or no hearing at all. hearing-impaired people do use ats (see assistive devices for people with hearing, voice, speech, or language disorders), but there are not really special ats specific for computer/web use. there are, however, specific techniques for providing textual alternatives to audio content which range from simple text transcripts to text
tracks (i.e. captions) that can be displayed along with video. an article, later on, will discuss these. hearing-impaired people also represent a significant userbase — "466 million people worldwide have disabling hearing loss", says the world health organization's deafness and hearing loss fact sheet. people with mobility impairments these people have disabilities concerning movement, which might...
Fundamental CSS comprehension - Learn web development
ain card container. float the image to the right so that it sticks to the right hand side of the main business card contents, and give it a max-height of 100% (a clever trick that ensures that it will grow/shrink to stay the same height as its parent container, regardless of what height it becomes.) beware! there are two errors in the provided rulesets. using any technique that you know,
track these down and fix them before moving on. new rulesets you need to write: write a ruleset that targets both the card header, and card footer, giving them both a computed total height of 50px (including a content height of 30px and padding of 10px on all sides.) but express it in ems. the default margin applied to the <h2> and <p> elements by the browser will interfere with our design, so wr...
Responsive design - Learn web development
ng of flex items. .container { display: flex; } .item { flex: 1; } note: as an example, we have rebuilt the simple responsive layout above, this time using flexbox. you can see how we no longer need to use strange percentage values to calculate the size of the columns: example, source code. css grid in css grid layout the fr unit allows the distribution of available space across grid
tracks. the next example creates a grid container with three
tracks sized at 1fr. this will create three column
tracks, each taking one part of the available space in the container. you can find out more about this approach to create a grid in the learn layout grids topic, under flexible grids with the fr unit. .container { display: grid; grid-template-columns: 1fr 1fr 1fr; } note: the grid la...
Getting started with CSS - Learn web development
l to make the document less accessible with your changes — we will aim to highlight potential pitfalls in appropriate places. note: you will often see mention of accessibility in these lessons and across mdn. when we talk about accessibility we are referring to the requirement for our webpages to be understandable and usable by everyone. your visitor may well be on a computer with a mouse or
trackpad, or a phone with a touchscreen. or they might be using a screenreader, which reads out the content of the document, or they may need to use much larger text, or be navigating the site using the keyboard only. a plain html document is generally accessible to everyone — as you start to style that document it is important that you don't make it less accessible. combining selectors and combin...
How can we design for all types of users? - Learn web development
(most designs are done in pixel-based software, so the math has to be done by the person coding the css). enter rem. this unit is relative to the root element's size and not to any other parent. the css can be rewritten thus: body { font-size:1em; } /* 1em = 100% of the browser's base font size, so in most cases this w...
What are hyperlinks? - Learn web development
ine. objective: learn about links on the web and why they matter. summary hyperlinks, usually called links, are a foundational concept behind the web. to explain what links are, we need to step back to the very basics of web architecture. back in 1989, tim berners-lee, the web's inventor, spoke of the three pillars on which the web stands: url, an address system that keeps
track of web documents http, a transfer protocol to find documents when given their urls html, a document format allowing for embedded hyperlinks as you can see in the three pillars, everything on the web revolves around documents and how to access them. the web's original purpose was to provide an easy way to reach, read, and navigate through text documents. since then, the web has evolved to prov...
What is a Domain Name? - Learn web development
every domain name was bought, the web would quickly fill up with unused domain names that were locked and couldn't be used by anyone. instead, you pay for the right to use a domain name for one or more years. you can renew your right, and your renewal has priority over other people's applications. but you never own the domain name. companies called registrars use domain name registries to keep
track of technical and administrative information connecting you to your domain name. note : for some domain name, it might not be a registrar which is in charge of keeping
track. for instance, every domain name under .fire is managed by amazon. finding an available domain name to find out whether a given domain name is available, go to a domain name registrar's website. most of them provide a ...
Styling web forms - Learn web development
want to thoroughly customize those widgets, you really have to create your own using html, css, and javascript. this is beyond the scope of the core form articles, but we do look at this in an advanced article how to build custom form controls. note: there are some proprietary css pseudo-elements available that allow you to style internal components of these form controls, such as ::-moz-range-
track, but these are not consistent across browsers, so can't be relied upon. we will mention these later as well. the good to style form controls that are easy to style with css, you shouldn't face much if any difficulties, since they mostly behave like any other html element. we already looked at some simple form styling in your first form, and the css building blocks module contains some useful f...
Your first form - Learn web development
article). for usability and accessibility, we include an explicit label for each form control. note the use of the for attribute on all <label> elements, which takes as its value the id of the form control with which it is associated — this is how you associate a form control with its label. there is great benefit to doing this — it associates the label with the form control, enabling mouse,
trackpad, and touch device users to click on the label to activate the corresponding control, and it also provides an accessible name for screen readers to read out to their users. you'll find further details of form labels in how to structure a web form. on the <input> element, the most important attribute is the type attribute. this attribute is extremely important because it defines the way the <in...
HTML basics - Learn web development
/title> — the <title> element. this sets the title of your page, which is the title that appears in the browser tab the page is loaded in. it is also used to describe the page when you bookmark/favourite it. <body></body> — the <body> element. this contains all the content that you want to show to web users when they visit your page, whether that's text, images, videos, games, playable audio
tracks or whatever else. images let's turn our attention to the <img> element again: <img src="images/firefox-icon.png" alt="my test image"> as we said before, it embeds an image into our page in the position it appears. it does this via the src (source) attribute, which contains the path to our image file. we have also included an alt (alternative) attribute. in this attribute, you specify descr...
Use JavaScript within a webpage - Learn web development
user a way to cancel it. let users initiate interactions. that means, don't update content, redirect, or refresh automatically. don't use carousels or display popups without warning. have a plan b for users without javascript. people may have javascript turned off to improve speed and security, and users often face network issues that prevent loading scripts. moreover, third-party scripts (ads,
tracking scripts, browser extensions) might break your scripts. at a minimum, leave a short message with <noscript> like this: <noscript>to use this site, please enable javascript.</noscript> ideally, replicate the javascript functionality with html and server-side scripting when possible. if you're only looking for simple visual effects, css can often get the job done even more intuitively...
Getting started with HTML - Learn web development
an help avoid some problems later. <title></title>: the <title> element. this sets the title of the page, which is the title that appears in the browser tab the page is loaded in. the page title is also used to describe the page when it is bookmarked. <body></body>: the <body> element. this contains all the content that displays on the page, including text, images, videos, games, playable audio
tracks, or whatever else. active learning: adding some features to an html document if you want to experiment with writing some html on your local computer, you can: copy the html page example listed above. create a new file in your text editor. paste the code into the new text file. save the file as index.html. note: you can also find this basic html template on the mdn learning area githu...
Test your skills: Multimedia and embedding - Learn web development
files. the files are called video.mp4 and video.webm, and are in a folder inside the current folder called media. let the browser know in advance what video formats the sources point to, so it can make an informed choice of which one to download ahead of time. give the <video> a width and height equal to its intrinsic size (320 by 240 pixels). make the video muted by default. display the text
tracks contained in the media folder, in a file called subtitles_en.vtt, when the video is playing. you must explicitly set the type as subtitles, and the subtitle language to english. try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor. multimedia and embedding 3 for this final task you ...
Choosing the right approach - Learn web development
webview android full support yeschrome android full support yesfirefox android ? opera android ? safari ios ? samsung internet android full support yesthrottling of
tracking timeout scriptschrome ? edge ? firefox full support 55ie ? opera ? safari ? webview android ? chrome android ? firefox android ...
Third-party APIs - Learn web development
her apis may require that you include the key in a slightly different way, but the pattern is relatively similar for most of them. requiring a key enables the api provider to hold users of the api accountable for their actions. when the developer has registered for a key, they are then known to the api provider, and action can be taken if they start to do anything malicious with the api (such as
tracking people's location or trying to spam the api with loads of requests to stop it working, for example). the easiest action would be to just revoke their api privileges. extending the mapquest example let's add some more functionality to the mapquest example to show how to use some other features of the api. to start this section, make yourself a copy of the mapquest starter file, in a new...
A first splash into JavaScript - Learn web development
lass="loworhi"></p> </div> the next two constants store references to the form text input and submit button and are used to control submitting the guess later on. <label for="guessfield">enter a guess: </label><input type="text" id="guessfield" class="guessfield"> <input type="submit" value="submit guess" class="guesssubmit"> our final two variables store a guess count of 1 (used to keep
track of how many guesses the player has had), and a reference to a reset button that doesn't exist yet (but will later). note: you'll learn a lot more about variables/constants later on in the course, starting with the next article. functions next, add the following below your previous javascript: function checkguess() { alert('i am a placeholder'); } functions are reusable blocks of code th...
Basic math in JavaScript — numbers and operators - Learn web development
an be found in expressions and operators. increment and decrement operators sometimes you'll want to repeatedly add or subtract one to or from a numeric variable value. this can be conveniently done using the increment (++) and decrement (--) operators. we used ++ in our "guess the number" game back in our first splash into javascript article, when we added 1 to our guesscount variable to keep
track of how many guesses the user has left after each turn. guesscount++; note: these operators are most commonly used in loops, which you'll learn about later on in the course. for example, say you wanted to loop through a list of prices, and add sales tax to each one. you'd use a loop to go through each value in turn and do the necessary calculation for adding the sales tax in each case. the incr...
What went wrong? Troubleshooting JavaScript - Learn web development
find out how). what's even more useful is that the console gives you error messages whenever a syntax error exists inside the javascript being fed into the browser's javascript engine. now let's go hunting. go to the tab that you've got number-game-errors.html open in, and open your javascript console. you should see an error message along the following lines: this is a pretty easy error to
track down, and the browser gives you several useful bits of information to help you out (the screenshot above is from firefox, but other browsers provide similar information). from left to right, we've got: a red "x" to indicate that this is an error. an error message to indicate what's gone wrong: "typeerror: guesssubmit.addeventlistener is not a function" a "learn more" link that links t...
JavaScript object basics - Learn web development
you move on — see test your skills: object basics. summary congratulations, you've reached the end of our first js objects article — you should now have a good idea of how to work with objects in javascript — including creating your own simple objects. you should also appreciate that objects are very useful as structures for storing related data and functionality — if you tried to keep
track of all the properties and methods in our person object as separate variables and functions, it would be inefficient and frustrating, and we'd run the risk of clashing with other variables and functions that have the same names. objects let us keep the information safely locked away in their own package, out of harm's way. in the next article we'll start to look at object-oriented programming (oo...
Aprender y obtener ayuda - Learn web development
quickly you can do it. if you are doing a university or college course to learn web development, then most of this planning is done for you — lucky you! when you have worked out a weekly schedule, then you should keep a record of what you manage to do each week in a simple spreadsheet or even in a notebook! also, it might be a good idea to have some sub-goals worked out to allow you to keep
track of where you are more easily, for example: html and css basics learnt by summer javascript basics learnt by december example website project built by next april etc. keep thinking about how much progress you are making, and adjust your plan if needs be. staying motivated it is hard to stay motivated, especially if you are trying to learn a complex skill like programming or web developme...
The business case for web performance - Learn web development
is article discusses how certain business metrics directly relate to a user's web performance experience and how to apply service design to boost the user's experiences of web performance. it highlights the importance of understanding how cumulative experiences impact conversion and retention rates. performance budgets setting a web performance budget can help you make sure the team stays on
track in keeping the site and help prevent regressions. a performance budget is a set of limits that are set to specify limits, such as maximum number of http requests allowed, the maximum total size of all the assets combined, the minimum allowable fps on a specific device, etc, that must be maintained. the budget can be applied to a single file, a file type, all files loaded on a page, a specific me...
The "why" of web performance - Learn web development
to increase visitor retention and user satisfaction. slow content has been shown to lead to site abandonment, with some visitors leaving to never return. reducing the amount of data that passes between the client and the server lowers the costs to all parties. reducing html/css/javascript and media file sizes reduces both the time to load and a site's power consumption (see performance budgets).
tracking performance is important. multiple factors, including network speed and device capabilities affect performance. there is no single performance metric; and differing business objectives may mean different metrics are more relavant to the goals of the site or the organization that it supports. how the performance of your site is perceivedd is user experience! conclusion web performance is impo...
Web performance - Learn web development
on each user agent's capability, size, and pixel density is possible. in this article we discuss the impact images have on performance, and the methods to reduce the number of bytes sent per image. multimedia: video the lowest hanging fruit of web performance is often media optimization. in this article we discuss the impact video content has on performance, and cover tips like removing audio
tracks from background videos can improve performance. javascript performance best practices javascript, when used properly, can allow for interactive and immersive web experiences — or it can significantly harm download time, render time, in-app performance, battery life, and user experience. this article outlines some javascript best practices that should be considered to ensure even complex cont...
Website security - Learn web development
one that is delivered via some physical hardware that only the user will have, such as a code in an sms sent to their phone). configure your web server to use https and http strict transport security (hsts). https encrypts data sent between your client and server. this ensures that login credentials, cookies, post requests data and header information are not easily available to attackers. keep
track of the most popular threats (the current owasp list is here) and address the most common vulnerabilities first. use vulnerability scanning tools to perform automated security testing on your site. later on, your very successful website may also find bugs by offering a bug bounty like mozilla does here. only store and display data that you need. for example, if your users must store sensitive in...
Introduction to client-side frameworks - Learn web development
the need to make them. exploring the why requires first examining the challenges of software development. consider a common kind of application: a to-do list creator, which we'll look at implementing using a variety of frameworks in future chapters. this application should allow users to do things like render a list of tasks, add a new task, and delete a task; and it must do this while reliably
tracking and updating the data underlying the application. in software development, this underlying data is known as state. each of our goals is theoretically simple in isolation. we can iterate over the data to render it; we can add to an object to make a new task; we can use an identifier to find, edit, or delete a task. when we remember that the application has to let the user to do all of these th...
React interactivity: Events and state - Learn web development
ling with user input and data updates, however, we need something more. for one thing, props come from the parent of a component. our <form /> will not be inheriting a new name for our task; our <input /> element lives directly inside of <form />, so <form/> will be directly responsible for creating that new name. we can't ask <form /> to spontaneously create its own props, but we can ask it to
track some of its own data for us. data such as this, which a component itself owns, is called state. state is another powerful tool for react because components not only own state, but can update it later. it's not possible to update the props a component receives; only to read them. react provides a variety of special functions that allow us to provide new capabilities to components, like state. the...
React interactivity: Editing, filtering, conditional rendering - Learn web development
y-hidden">renaming {props.name}</span> </button> with this code in place, you should be able to press the "edit" and "cancel" buttons in your todo items to toggle between templates. the next step is to actually make the editing functionality work. editing from the ui much of what we're about to do will mirror the work we did in form.js: as the user types in our new input field, we need to
track the text they enter; once they submit the form, we need to use a callback prop to update our state with the new name of the task. we'll start by making a new hook for storing and setting the new name. still in todo.js, put the following underneath the existing hook: const [newname, setnewname] = usestate(''); next, create a handlechange() function that will set the new name; put this underneat...
Working with Svelte stores - Learn web development
extremely powerful, way to handle complex app state from a global data store in a reactive way. and because svelte compiles our code, it can provide the $store auto-subscription syntax that allows us to work with stores in the same way as local variables. because stores has a minimal api, it's very simple to create our custom stores to abstract away the inner workings of the store itself. bonus
track: transitions let's change the subject now, and do something fun and different — let's add an animation to our alerts. svelte provides a whole module to define transitions and animations so we can make our user interfaces more appealing. a transition is applied with the transition:fn directive, and is triggered by an element entering or leaving the dom as a result of a state change. the svelte...
Using Vue computed properties - Learn web development
ist-summary" class="stack-large"> <li v-for="item in todoitems" :key="item.id"> <to-do-item :label="item.label" :done="item.done" :id="item.id"></to-do-item> </li> </ul> you should now see the list summary in your app, and the total number of items update as you add more todo items! however, if you try checking and unchecking some items, you'll reveal a bug. currently, we're not actually
tracking the "done" data in any fashion, so the number of completed items does not change.
tracking changes to "done" we can use events to capture the checkbox update and manage our list accordingly. since we're not relying on a button press to trigger the change, we can attach a @change event handler to each checkbox instead of using v-model. update the <input> element in todoitem.vue to look like...
Vue conditional rendering: editing existing todos - Learn web development
l" button: when the "save" button is clicked, the component emits the new label via an item-edited event. when the "cancel" button is clicked, the component signals this by emitting an edit-cancelled event. modifying our todoitem component before we can add todoitemeditform to our app, we need to make a few modifications to our todoitem component. specifically, we need to add a variable to
track if the item is being edited, and a button to toggle that variable. we’ll also add a delete button since deletion is closely related. update your todoitem’s template as shown below. <template> <div class="stack-small"> <div class="custom-checkbox"> <input type="checkbox" class="checkbox" :id="id" :checked="isdone" @change="$emit('checkbox-changed')" /> <label :...
Creating our first Vue component - Learn web development
ibute on the <input> element, so that it can serve as a record of whether the checkbox is checked or not. however, it's important that props serve as one-way data binding — a component should never alter the value of its own props. there are a lot of reasons for this. in part, components editing props can make debugging a challenge. if a value is passed to multiple children, it could be hard to
track where the changes to that value were coming from. in addition, changing props can cause components to re-render. so mutating props in a component would trigger the component to rerender, which may in-turn trigger the mutation again. to work around this, we can manage the done state using vue’s data property. the data property is where you can manage local state in a component, it lives inside ...
Adding a new todo form: Vue events, methods, and models - Learn web development
submitting the form now, you'll notice that the page doesn't reload. if you open the console, you can see the results of the console.log() we added inside our onsubmit() method. binding data to inputs with v-model next up, we need a way to get the value from the form's <input> so we can add the new to-do item to our todoitems data list. the first thing we need is a data property in our form to
track the value of the to-do. add a data() method to our todoform component object that returns a label field. we can set the initial value of the label to an empty string. your component object should now look something like this: export default { methods: { onsubmit() { console.log("form submitted"); } }, data() { return { label: "" }; } }; we now...
Focus management with Vue refs - Learn web development
"edit" button, it makes sense to move focus to the edit name text box, and back to the "edit" button when canceling or saving from the edit screen. however, unlike with the edit form, we don’t have a clear location for focus to move to when an element is deleted. we also need a way to provide assistive technology users with information that confirms that an element was deleted. we're already
tracking the number of elements in our list heading — the <h2> in app.vue — and it's associated with our list of to-do items. this makes it a reasonable place to move focus to when we delete a node. first, we need to add a ref to our list heading. we also need to add a tabindex="-1" to it — this makes the element programmatically focusable (i.e. it can be focused via javascript), when by default...
Styling Vue components with CSS - Learn web development
lp improve the spacing of our to-do items a bit. update it as follows: <ul aria-labelledby="list-summary" class="stack-large"> adding scoped styles the last component we want to style is our todoitem component. to keep the style definitions close to the component we can add a <style> element inside it. however, if these styles alter things outside of this component, it could be challenging to
track down the styles responsible, and fix the problem. this is where the scoped attribute can be useful — this attaches a unique html data attribute selector to all of your styles, preventing them from colliding globally. to use the scoped modifier, create a <style> element inside todoitem.vue, at the bottom of the file, and give it a scoped attribute: <style scoped> </style> next, copy the follo...
Understanding client-side JavaScript frameworks - Learn web development
and then breaking that html structure into components. 3. ember interactivity: events, classes and state at this point we'll start adding some interactivity to our app, providing the ability to add and display new todo items. along the way, we'll look at using events in ember, creating component classes to contain javascript code to control interactive features, and setting up a service to keep
track of the data state of our app. 4. ember interactivity: footer functionality, conditional rendering now it's time to start tackling the footer functionality in our app. here we'll get the todo counter to update to show the correct number of todos still to complete, and correctly apply styling to completed todos (i.e. where the checkbox has been checked). we'll also wire up our "clear completed" b...
Handling common accessibility problems - Learn web development
scription of the image that successfully conveys its meaning and content on the page, to be picked up by a screenreader and read out to the user. note: for more information, read text alternatives. missing alt text can be tested for in a number of ways, for example using accessibility auditing tools. alt text is slightly more complex for video and audio content. there is a way to define text
tracks (e.g. subtitles) and display them when video is being played, in the form of the <
track> element, and the webvtt format (see adding captions and subtitles to html5 video for a detailed tutorial). browser compatibility for these features is fairly good, but if you want to provide text alternatives for audio or support older browsers, a simple text transcript presented somewhere on the page or on ...
Introduction to cross browser testing - Learn web development
work, and run some different code in those cases that does work. once a fix has been made, you'll want to repeat your testing process to make sure your fix is working ok, and hasn't caused the site to break in other places or in other browsers. reporting bugs just to reiterate on what was said above, if you discover bugs in browsers, you should report them: firefox bugzilla edgehtml issue
tracker safari chrome opera summary this article should have given you a high-level understanding of the most important concepts you need to know about cross browser testing. armed with this knowledge, you are now ready to move on and start learning about cross browser testing strategies. overview: cross browser testing next in this module introduction to cross browser testing strate...
Strategies for carrying out testing - Learn web development
u'll need a google account. use this account to sign into google analytics. choose the google analytics (web) option, and click the sign up button. enter your web site/app details into the signup page. this is fairly intuitive to set up; the most important field to get right is the website url. this needs to be your site/app's root url. once you've finished filling in everything, press the get
tracking id button, then accept the terms of service that appear. the next page provides you with some code snippets and other instructions. for a basic website, what you need to do is copy the website
tracking code block and paste it into all the different pages you want to
track using google analytics on your site. you could place the snippets below your closing </body> tag, or somewhere else approp...
Setting up your own test automation environment - Learn web development
e element that you want to perform a test on, make sure that it has a stable id, or position on the page that can be selected using a css selector, which isn't going to just change with the next site iteration. you want to make your tests as non-brittle as possible, i.e. they won't just break when something changes. write atomic tests: each test should test one thing only, making it easy to keep
track of what test file is testing which criterion. as an example, the google_test.js test we looked at above is pretty good, as it just tests a single thing — whether the title of a search results page is set correctly. we could work on giving it a better name so it is easier to work out what it does if we add more google tests. perhaps results_page_title_set_correctly.js would be slightly better? ...
Deploying our app - Learn web development
line to storing your code in a git repository, but it is a far cry from a git tutorial. there’s many great tutorials and books available, and our git and github page is a good place to start. we initialized our working directory as a git working directory earlier on. a quick way to verify this is to run the following command: git status you should get a status report of what files are being
tracked, what files are staged, and so on — all terms that are part of the git grammar. if you get the error fatal: not a git repository returned, then the working directory is not a git working directory and you’ll need to initialise git using git init. now we have three tasks ahead of us: add any changes we’ve made to the stage (a special name for the place that git will commit files from).
Introducing a complete toolchain - Learn web development
stall that contribute to our toolchain, we mentioned two web services in the above list of tools. let's take this opportunity to make sure we are set up with them before we continue. you will need to create accounts with each of github and netlify if you wish to complete the tutorial. as mentioned previously, github is a source code repository service that adds community features such as issue
tracking, following project releases and much more. in the next chapter we will push to a github code repository, which will cause a cascade effect that (should) deploy all the software to a home on the web. netlify is a hosting service for static websites (that is, websites that entirely consist of files that do not change in real time), which lets us deploy multiple times a day and freely hosts stat...
Package management basics - Learn web development
r software downloaded and displayed in your visitors’ browser. in addition, what happens if you find a better tool that you want to use instead of the current one, or a new version of your dependency is released that you want to update to? this is not too painful for a couple of dependencies, but in larger projects with many dependencies this kind of thing can become really challenging to keep
track of. it makes more sense to use a package manager such as npm, as this will guarantee that the code is added and removed cleanly, as well as a host of other advantages. what exactly is a package manager? we've met npm already, but stepping back from npm itself, a package manager is a system that will manage your project dependencies. the package manager will provide a method to install new depe...
Accessibility API cross-reference
e item can get the keyboard focus focusable focusable focusable tabindex attribute with value of 0 or more the item has focus for text input. for other kinds of keyboard operation, e.g. ui controls, see armed focused focused focused available to javascript as document.activeelement appearance has changed for mouseover hot
tracked n/a n/a especially used for sliders, scrollbars, toolbars, tablists... n/a horizontal horizontal aria-orientation=horizontal indicates whether the element is exposed to an accessibility api. note the reversed logic in some apis invisible visible visible aria-hidden hidden (boolean attribute) ...
Accessibility Features in Firefox
les from both afb's access world and nfb's voice of the nation's blind, reviewers found no significant roadblocks in moving to firefox from internet explorer for screen reader users. in fact, the same keyboard commands are still available, so users can become comfortable and productive right away. screen magnifier users can also benefit from firefox's powerful features today, as caret and focus
tracking are fully enabled. mozilla corporation is currently reaching out to work with ai squared, the makers of zoomtext, in order to enable complete support of advanced zoomtext features such as the doc reader and app reader. we are also optimistic that the the makers of magic and lunar/supernova will add firefox support in the coming year. mozilla has support for dragon naturally speaking. some use...
Accessibility information for UI designers and developers
design is flexible enough to allow for this. text sizing users should be able to enlarge their text size up to 200 percent without breaking functionality. text spacing users should be able to make the following changes to their text spacing: set line height (leading) to at least 1.5 times the font size set spacing following paragraphs to at least 2 times the font size set letter spacing (
tracking) to at least 0.12 times the font size set word spacing to at least 0.16 times the font size this does not mean that your page needs to offer controls to make such changes, merely that if someone does these things in a custom stylesheet, they should not break the interface. forms in forms, provide labels for all controls. this includes form elements like inputs and select boxes, but also b...
CSUN Firefox Materials
icles from both afb's access world and nfb's voice of the nation's blind, reviewers found no significant roadblocks in moving to firefox from internet explorer for screen reader users. in fact, the same keyboard commands are still available, so users can become comfortable and productive right away. screen magnifier users can also benefit from firefox's powerful features today, as caret and focus
tracking are fully enabled. mozilla corporation is currently reaching out to work with ai squared, the makers of zoomtext, in order to enable complete support of advanced zoomtext features such as the doc reader and app reader. firefox on linux currently boasts the best onscreen keyboard support in the industry via gok, the gnome onscreen keyboard. basic screen reader accessibility is available via gno...
Mozilla Plugin Accessibility
plugins), as well as the linux-specific bug 84159 and mac-specific bug 180426. ? no target 2. focus gets stuck in plugin. user cannot keyboard navigate out of a plugin we will apply the same solution as in problem 4 above. the plugin will be responsible for bubbling up shift+tab and tab when the user has reached the end of the tab cycle within the plugin. the bug
tracking this work is bug 93149. ? no target 3. many plugins lack accessibility api support most plugins that work with mozilla do not yet support accessibility apis. a notable acception is the adobe pdf plugin on windows, which supports msaa. in other cases, vendors need to find or be convinced of the business justification so that resources are applied to the problem...
Mozilla's Section 508 Compliance
cessibility features has been documented by the manufacturer of the operating system and is available to the product developer. complete. (c) a well-defined on-screen indication of the current focus shall be provided that moves among interactive interface elements as the input focus changes. the focus shall be programmatically exposed so that assistive technology can
track focus and focus changes. complete. we expose focus programmatically via msaa (windows) and atk (linux/unix). incomplete, we show focus but need to expose it programmatically by supporting carbon/cocoa accessibility. (d) sufficient information about a user interface element including the identity, operation and state of the element shall be available to assist...
Software accessibility: Where are we today?
isabled people to rely on the companies which produce this software to make it accessible. these companies were often reluctant for various reasons including the large amount of time required to do so. on a positive note, recent federal purchasing rules such as section 508 have caused many companies to pay attention and implement msaa support. enter open source software microsoft was on the right
track with microsoft active accessibility, but because the source code to most popular desktop applications which are used in large corporations is not publicly available, they were never made fully accessible. in open source, however, making the necessary modifications to make them accessible is very possible. open source software is an ideal way to the needs of disabled users, because accessibility c...
A bird's-eye view of the Mozilla framework
idref uuid, iid_is(uuid),retval] out nsqiresult result); [noscript, notxpcom] nsrefcnt addref(); [noscript, notxpcom] nsrefcnt release(); }; the uuid parameter to queryinterface() is the iid uniqely identifying the interface. if nsirdfnode doesn't support nsirdfliteral, it returns null and it's up to the client to choose an alternate course of action. the xpcom component keeps
track of all interface pointers currently held by its clients using an internal reference count it increments via client calls to addref(). it is up to the client to call release() when it no longer needs the interface. release() decrements the reference count and then the object becomes a candidate for destruction. javascript handles its own garbage collection, so it doesn’t need to call addref() a...
Bugzilla
bugzilla.mozilla.org (often abbreviated b.m.o) is mozilla.org's bug-
tracking system, a database for recording bugs and enhancement requests for firefox, thunderbird, seamonkey, camino, and other mozilla.org projects. documentation about b.m.o. what to do and what not to do in bugzilla tips for how to use bugzilla, as well as things you should avoid. bugzilla etiquette a guide to etiquette; this guide will help you understand how best to conduct yourself on b.m.o. and how using proper manners and civility will help ensure your problem gets solved sooner rather than later. how to tell if a bug has already been reported it's useful (but not mandatory) for you to check if the problem you're reporting has been already
tracked. this guide will help you do so. view all... other...
Continuous Integration
p tests. games benchmarking (firefox) under development, the games benchmarking harness (aka mozbench) will allow a number of games-related benchmarks to be run against firefox and chrome. eventually, the system will likely be expanded with support for android. post-job analysis and alerts there is some analysis of test data that occurs out-of-band after jobs complete. perfherder alerts we
track changes to talos and other performance frameworks inside perfherder, and try to automatically alert when there is a sustained change exceeding a certain magnitude (specified per test). performance sheriffs review the list of alerts on a regular basis and file bugs if appropriate. you can view the current set of alerts on the perfherder alerts dashboard. intermittent failures after functional te...
Cookies Preferences in Mozilla
may apply to you. the default values given are for firefox 3. network.cookie.cookiebehavior default value: 0 0 = accept all cookies by default 1 = only accept from the originating site (block third party cookies) 2 = block all cookies by default 3 = use p3p settings (note: this is only applicable to older mozilla suite and seamonkey versions.) 4 = storage access policy: block cookies from
trackers network.cookie.lifetimepolicy default value: 0 0 = accept cookies normally 1 = prompt for each cookie (prompting was removed in firefox 44) 2 = accept for current session only 3 = accept for n days network.cookie.lifetime.days default value: 90 only used if network.cookie.lifetimepolicy is set to 3 sets the number of days that the lifetime of cookies should be limited to. network.co...
How to get a process dump with Windows Task Manager
this article describes how to get a process dump with task manager on windows. (to get a process dump for thunderbird or some other product, substitute the product name where ever you see firefox in these instructions.) caution the memory dump that will be created through this process is a complete snapshot of the state of firefox when you create the file, so it contains urls of active tabs, history information, and possibly even passwords depending on what you are doing when the snapshot is taken. it is advisable to create a new, blank profile to use when reproducing the hang and capturing the memory dump. ...
JavaScript-DOM Prototypes in Mozilla
es of real classes, and class prototype names are names of "classes" that are inherited by real classes, but are not real classes. a few examples of class constructor names would be htmlimageelement, htmldocument, element, nodelist, and two examples of class prototype names would be node and characterdata. this registration is done with the nsscriptnamespacemanager, which is in charge of keeping
track of what names are registered in the global namespace, and what kinds of names those names are (i.e. class constructor name, class prototype name). when a class constructor name is registered (nsglobalnamestruct::etypeclassconstructor), the nsscriptnamespacemanager is given a dom class info id (a 32 bit id that identifies class info defined in nsdomclassinfo). when a class prototype name is regist...
AddonInstall
instances can be created using the getinstallforfile() or getinstallforurl() methods on the addonmanager. once you have an instance the install() method is used to start automatic download and installation. this can be canceled at any time with the cancel() method. method overview void install() void cancel() void addlistener(in installlistener listener) void removelistener(in installlistener listener) properties attribute type description name string the name of the add-on being installed. version string the version of the add-on being installed. ...
CustomizableUI.jsm
isterarea method and unregistered using the unregisterarea method. when a customizable toolbar's xbl binding is constructed (generally, that is when a <toolbar customizable="true"/> node is appended to the document and isn't invisible), the binding will call into customizableui and register the toolbar's node as being one of the concrete instances of its area. for each area, customizableui keeps
track of a list of the widgets they contain, generally refered to as 'placements'. this is analogous to the old currentset attribute. if consumers make a change to the placements in an area, customizableui will update the actual nodes in each area instance for them. toolbars generally function the same way they always have. however, they can now be 'overflowable', that is, if there are too many widget...
Log.jsm
the log.jsm javascript code module (formerly named log4moz.js) provides a log4j style api for logging log messages to various endpoints, such as the browser console or a file on disk. ...
source-editor.jsm
on" fired when the current selection in the editor changes. sourceeditor.events.text_changed "textchanged" fired when the editor's content changes. methods addbreakpoint adds a breakpoint to be triggered at a certain line in the code, under an optional condition. note: implementing actual support for debugger features such as breakpoints is up to you. the editor simply
tracks their existence and marks them with annotations in the editor. void addbreakpoint( number alineindex, [optional] string acondition ); parameters alineindex the 0-based line number at which to place the breakpoint. acondition optional a string describing the condition under which the breakpoint should be triggered. this information is simply recorded as part of the breakpoint annot...
Index
14 qa phase localization after all of your hard work localizing we're sure that you not only want to see your work but you want to make sure it's accurate! if you don't have a lot of experience with code, you might even be concerned that you've broken something (oops!). now we'll walk you through performing some quality assurance testing on your work to make sure you're on the right
track. 15 release phase localization you've made it! you've setup up your local and remote environments, you've selected your l10n tools and projects, done some localization and even some testing! now you're ready for the final phase: becoming an official l10n release. here, we'll continue to stay true to the original intent of this guide and only present you with the technical inf...
Localization content best practices
l10n-drivers is not necessary for each landing involving strings, as long as you're following the basic rules described in this document. if you have doubts about the localizability of some text or structure (not about the text itself, that would need copywriters), it's definitely good to ask feedback. keywords: l12y, late-l10n two keywords are generally used on bugzilla: l12y: it's used to
track "localizability" bugs. a bug marked with l12y describes an issue that prevents localizers to create a good quality localization. some examples: hard-coded strings, implicit grammar structure in the code, lack of plural forms support, ui that breaks with long strings, etc. late-l10n: it's used by release-drivers to identify bugs, involving new strings, that will land late in the cycle, typically ...
Initial setup
at should you choose to use them, you may need to create a personal account. mozilla ldap you will need a mozilla ldap account once you're ready to have your localization registered on the main mozilla repositories. add a request about creating your ldap account to the new locales newsgroup. locale-specific bugzilla component having a bugzilla component specific to your locale will help us to
track your localization's progress from first steps to official release. it will also notify us when you're having problems unique to your localization team's work. add a request about creating your locale's bugzilla component to the new locales newsgroup. local environment tools similar to accounts, there is a number of environment tools that you should install on your personal computer. these tool...
QA phase
after all of your hard work localizing we're sure that you not only want to see your work but you want to make sure it's accurate! if you don't have a lot of experience with code, you might even be concerned that you've broken something (oops!). now we'll walk you through performing some quality assurance testing on your work to make sure you're on the right
track. if you're localizing mozilla websites, your work will display soon after you've committed it without needing a language pack. since such is the case, this part of the guide may not be entirely applicable to you. feel free to skip ahead to the next section by clicking on the next link at the bottom of the page. in order to see your work on firefox (or another mozilla application), you'll need to have a built language pack to...
Translation phase
d newsgroups client, an html editor, web development tools, and an irc chat client. firefox mobile by adding firefox® to your mobile phone, you can access rich web content and enjoy your favorite firefox features wherever you go. lightning lightning is a popular calendaring, scheduling and task management extension. if your locale has an hg repository hosted on the mozilla servers, you can
track your localization's current progress by visiting the l10n dashboards. note: if you are starting a new localization and decide to use an offline tool for localizing mozilla applications, you will need to become familiar with using mercurial (hg). visit the tutorial on using hg in your localization efforts here. mozilla websites so you're interested in localizing mozilla websites. each l10n t...
Localization sign-off reviews
:pike as the requestee. once you have made the formal request in bugzilla and you have pushed your work into your l10n repo, refer to the dashboards to follow your review's progress. sign-off dashboards to the right, you'll see the current sign-offs page for a german localization. sign-offs are approved using the buttons in the farthest column to the right. you can work with the l10n-drivers to
track the progress of your review and correlate your review/sign-off's approval progress with specific bugzilla bugs. as your work is approved, you'll see a green circle in the farthest column to the right. if bugs are discovered, your technical review/sign-off is rejected and the bugs are filed in bugzilla. once filed, they appear on your dashboard for you to fix. once they are fixed, push your fix to...
Fonts for Mozilla's MathML engine
em "fonts.dtd"> <fontconfig> <dir>/your/path/to/texmf-dist/fonts/opentype</dir> </fontconfig> finally, add this configuration file to the system font location list and regenerate the fontconfig cache: ln -sf /etc/fonts/conf.avail/09-texlive-fonts.conf /etc/fonts/conf.d/ fc-cache -sf android you must use the mathml-fonts add-on. note: there is an enhancement request opened on the noto bug
tracker to improve math support. firefox os you must use the mathml-fonts add-on. note: we plan to bundle a math font in the default installation. other systems on other systems, consider installing a math font using your package manager. note that these fonts are generally delivered with tex distributions such as tex live, but you might need to follow specific instructions so that your system ...
MathML3Testsuite
rror (crash, etc). this exception also holds for obsolete features (such as macro, mode etc) or for other undefined behaviors (attribute href for example). note that in general, comparing with the "sample rendering" is not enough to conclude on the success/failure of the test. so please do not edit these pages if you are not able to explain gecko's rendering. however, any report is welcome on the
tracking bug for the mathml testsuite. characters blocks symbols variants entitynames numericrefs utf8 general clipboard genattribs math presentation css dynamicexpressions generallayout scriptsandlimits tablesandmatrices tokenelements topics accents bidi elementarymathexamples embellishedop largeop linebreak nesting stretchychars whitespace torturetests errorhandling original ...
Mozilla DOM Hacking Guide
methods[];: help me! (bug 91557) static nsixpconnect *sxpconnect: used to call nsixpconnect methods that we need. initialized in init(). static nsiscriptsecuritymanager *ssecman: used by the dom security engine. initialized in init(). static nsresult definestaticjsvals(jscontext *cx);: used to define all the static jsstring data members of nsdomclassinfo. static prbool sisinitialized: keeps
track of wether class info was already initialized, because init() shouldn't be called twice. static jsval *sx_id: strings used in the global resolve methods for comparison with the passed in arguments. they represent special words for the dom. initialized by definestaticjsvals(). static const jsclass *sobjectclass: help me! static prbool sdosecuritycheckinaddproperty;: help me! nsdomclassinfo::in...
Mozilla projects on GitHub
count. to learn more about setting up a github account, visit the github website. most mozilla project code is located in repositories within the mozilla github organization. this is a great place to start looking for any projects not listed below. projects this listing covers the larger-scale and more important mozilla projects on github. it does not include everything since it's hard to keep
track of all the smaller projects. look to github for the most complete list of mozilla projects on github. project name description pdf.js a portable document format (pdf) reader written entirely in javascript. shumway shumway is a flash vm and runtime written in javascript. addon-sdk the mozilla add-on sdk. asknot the what can i do for ...
Are We Slim Yet
the are we slim yet project (commonly known as awsy) for several years
tracked memory usage across builds on the (now defunct) website areweslimyet.com. it used the same infrastructure as about:memory to measure memory usage on a predefined snapshot of alexa top 100 pages known as tp5. since firefox transitioned to using multiple processes by default, we moved awsy into the taskcluster infrastructure. this allowed us to run measurements on all branches and platforms. the results are posted to perfherder where we can
track regressions automatically. as new processes are added to firefox we want to make sure their memory usage is also
tracked by awsy. to this end we request that memory reporting be integrated into any new process before it is enabled on nightly. ...
Build Metrics
num_constructors number of static constructors found by the compiler in the firefox c++ codebase. lower is better. static constructors are undesirable because their initialization imposes an unavoidable time penalty every time firefox is started. installer size size in bytes of the firefox installer. lower is better here, especially on space-restricted platforms like android. build times amount of time it takes to build firefox in automation on a specific platform / configuration. lower is better. ...
BloatView
down by class. here's a sample of the bloatview output. ...
Profiling with Xperf
lts similar to shark. heap profiling xperf has good tools for heap allocation profiling, but they have one major limitation: you can't build with jemalloc and get heap events generated. the stock windows crt allocator is horrible about fragmentation, and causes memory usage to rise drastically even if only a small fraction of that memory is in use. however, even despite this, it's a useful way to
track allocations/deallocations. capturing heap data the "-heap" option is used to set up heap tracing. firefox generates lots of events, so you may want to play with the buffersize/minbuffers/maxbuffers options as well to ensure that you don't get dropped events. also, when recording the stack, i've found that a heap trace is often missing module information (i believe this is a bug in xperf). it's po...
Profiling with the Firefox Profiler
e base. the stacks you see in the ui are chains of these tags. this is good for highlighting particularly interesting parts of the code, but they miss out on un-annotated areas of the code base, and give no visibility into system libraries or drivers. tagging is done by adding macros of the form auto_profiler_label("namespace", "name"). these add raii helpers, which are used by the profiler to
track entries/exits of the annotated functions. for this to be effective, you need to liberally use auto_profiler_label throughout the code. see geckoprofiler.h for more variations like auto_profiler_label_dynamic. because of the non-zero overhead of the instrumentation, the sample label shouldn't be placed inside hot loops. a profile reporting that a large portion is spent in "unknown" code indicat...
TraceMalloc
o). to enable tracemalloc in your build, configure with --enable-trace-malloc. the built mozilla application will support the following additional command-line options: --trace-malloc filename the application will log allocation and deallocation events with stack traces in a binary format to the given file. if filename is -, nothing is written to a file, but tracemalloc will be active and will
track live allocations and their stack traces. --shutdown-leaks=filename on shutdown, the application will save live allocations (with stack traces) to the given file. analyzing the trace-malloc log tools such as bloatblame (tools/trace-malloc/bloatblame.cpp) can be used to process filename. try running with the unified output format option, -u. the output is a large html file that hyperlinks ancest...
Performance
ory-related operations like trigger gc and cc, dump gc & cc logs, and dump dmd reports. about:memory is built on top of firefox's memory reporting infrastructure. dmd dmd is a tool that identifies shortcomings in about:memory's measurements, and can also do multiple kinds of general heap profiling. are we slim yet areweslimyet.com (a.k.a. awsy) is a memory usage and regression
tracker. bloatview bloatview prints per-class statistics on allocations and refcounts, and provides gross numbers on the amount of memory being leaked broken down by class. it is used as part of mozilla's continuous integration testing. refcount tracing and balancing refcount tracing and balancing are ways to
track down leaks caused by incorrect uses of reference counting. they are ...
PRCallOnceType
syntax #include <prinit.h> typedef struct prcalloncetype { printn initialized; print32 inprogress; prstatus status; } prcalloncetype; fields the structure has these fields: initialized if not zero, the initialization process has been completed. inprogress if not zero, the initialization process is currently being executed. calling threads that observe this status block until inprogress is zero. status an indication of the outcome of the initialization process. description the client is responsible for initializing the prcalloncetype structure to all zeros. this initialization must be accomplished before any threading issues exist. ...
An overview of NSS Internals
rforming an operation often involves allocating many individual data items, and the code might be required to abort a task at many positions in the logic. an arena is requested once processing of a task starts, and all memory allocations that are logically associated to that task are requested from the associated arena. the implementation of arenas makes sure that all individual memory blocks are
tracked. once a task is done, regardless whether it completed or was aborted, the programmer simply needs to release the arena, and all individually allocated blocks will be released automatically. often freeing is combined with immediately erasing (zeroing, zfree) the memory associated to the arena, in order to make it more difficult for attackers to extract keys from a memory dump. nss uses many c...
HTTP delegation
lient library and implement the callback functions as a thin layer that forwards requests from nss to the http client library. to learn about all the details, please read the documentation contained in the nss c header files. look for function sec_registerdefaulthttpclient and all functions having names that start with sec_http. to find an example implementation, you may look at bug 111384, which
tracks the implementation in mozilla client applications. specifying an ocsp proxy the remainder of this document is a short howto. one might expect the api defines a simple function that accepts the uri and data to be sent, and returns the result data. but there is no such simple interface. the api should allow nss to use the http client either asynchronously or synchronously. in addition, during an a...
HTTP delegation
lient library and implement the callback functions as a thin layer that forwards requests from nss to the http client library. to learn about all the details, please read the documentation contained in the nss c header files. look for function sec_registerdefaulthttpclient and all functions having names that start with sec_http. to find an example implementation, you may look at bug 111384, which
tracks the implementation in mozilla client applications. specifying an ocsp proxy the remainder of this document is a short howto. one might expect the api defines a simple function that accepts the uri and data to be sent, and returns the result data. but there is no such simple interface. the api should allow nss to use the http client either asynchronously or synchronously. in addition, during an a...
Index
rforming an operation often involves allocating many individual data items, and the code might be required to abort a task at many positions in the logic. an arena is requested once processing of a task starts, and all memory allocations that are logically associated to that task are requested from the associated arena. the implementation of arenas makes sure that all individual memory blocks are
tracked. once a task is done, regardless whether it completed or was aborted, the programmer simply needs to release the arena, and all individually allocated blocks will be released automatically. often freeing is combined with immediately erasing (zeroing, zfree) the memory associated to the arena, in order to make it more difficult for attackers to extract keys from a memory dump. nss uses many c...
JSS
the jss project has been relocated! as of april 6, 2018, jss has been migrated from mercurial on mozilla to git on github. jss source should now be checked out from the github: git clone git@github.com:dogtagpki/jss.git -- or -- git clone https://github.com/dogtagpki/jss.git all future upstream enquiries to jss should now use the pagure issue
tracker system: https://pagure.io/jss/issues documentation regarding the jss project should now be viewed at: http://www.dogtagpki.org/wiki/jss note: as much of the jss documentation is sorely out-of-date, updated information will be a work in progress, and many portions of any legacy documentation will be re-written over the course of time. stay tuned! legacy jss information can still be found at: source: https://hg.moz...
Notes on TLS - SSL 3.0 Intolerant Servers
correctly are not interoperable with tls/ssl spec-compliant clients. normally the servers which have this problem are not equipped to deal with the tls protocol, but instead of rolling back to ssl 3.0 as the rollback provision provides, they terminate/drop the connection, thus resulting in most cases a blank page display. for up-to-date information, you can read a bugzilla bug report which keeps
track of this problem with mozilla-based browsers. see bug 59321. servers currently known to exhibit this intolerant behavior as of this writing, this problem has been reported for the following servers: (wherever there is an upgraded version which fixes the problem, it is indicated by an asterisked remark in the parentheses. ) domino-go-webserver/4.6.2.6 (and perhaps some later versions) ibm_htt...
NSS PKCS11 Functions
his is a retry. this implies that the callback has previously returned the wrong password. arg a pointer supplied by the application that can be used to pass state information. can be null. this callback function returns one of these values: if successful, a pointer to the password. this memory must have been allocated with pr_malloc or pl_strdup. if unsuccessful, returns null. many tokens keep
track of the number of attempts to enter a password and do not allow further attempts after a certain point. therefore, if the retry argument is pr_true, indicating that the password was tried and is wrong, the callback function should return null to indicate that it is unsuccessful, rather than attempting to return the same password again. failing to terminate when the retry argument is pr_true can re...
PKCS11 Implement
iews the information. the supplied library names are used as the default library names; currently, these names should not include any double quotation marks. (this is more restrictive than pkcs 2.0 and may change in future versions of nss.). slot and token management c_getslotlist the nss calls c_getslotlist on startup or when it loads a new module, requests all the module's slots, and keeps
track of the list from that point on. the slots are expected to remain static: that is, the module never has more slots or fewer slots than the number on the original list. c_getslotinfo the nss calls c_getslotinfo on startup or when it loads a new module and reads in the information that can be viewed on the slot information page. if the ckf_removable_device flag is set, nss also calls c_getslotinf...
Python binding for NSS
y illustrate suggested usage and best practice. test code in addition the test directory contains unit tests that also illustrate python-nss usage, however unlike the examples the unit tests are geared towards testing rather than expository illustration. other documentation the doc directory contains other files you may wish to review. how to report a bug python-nss bugs are currently being
tracked in the red hat bugzilla system for fedora. you can enter a bug report here. source download area source downloads are maintained here. links to download url for a specific release can be found in the release information section. mozilla source code management (scm) information on march 21, 2013 the nss project switched from using cvs as it's source code manager (scm) to mercurial, also know...
gtstd.html
any given server or client, one or more pkcs #11 modules may be available. figure 2.1 relationships among nss libraries, cryptographic modules, slots, and tokens as shown in the figure, ssl communicates with pkcs #11 modules through the pkcs #11 interface. any pkcs #11 module that supports pkcs #11 can be used with the nss libraries. netscape software uses a file called secmod.db to keep
track of the modules available. a pkcs #11 module always has one or more slots, which may be implemented as physical hardware slots in some form of physical reader (for example, for smart cards) or as conceptual slots in software. each slot for a pkcs #11 module can in turn contain a token, which is the hardware or software device that actually provides cryptographic services and optionally stores ce...
pkfnc.html
password. arg a pointer supplied by the application that can be used to pass state information. can be null. this callback function returns one of these values: if successful, a pointer to the password. this memory must have been allocated with pr_malloc or pl_strdup. if unsuccessful, returns null. many tokens keep
track of the number of attempts to enter a password and do not allow further attempts after a certain point. therefore, if the retry argument is pr_true, indicating that the password was tried and is wrong, the callback function should return null to indicate that it is unsuccessful, rather than attempting to return the same password again. failing to terminate when the retry argument is pr_true can re...
sslfnc.html
ket to facilitate looking up the ssl session when it is tunneling through a proxy. syntax #include "ssl.h" int ssl_setsockpeerid(prfiledesc *fd, char *peerid); parameters this function has the following parameters: fd a pointer to the file descriptor for the ssl socket. peerid an id number assigned by the application to keep
track of the ssl session associated with the peer. returns the function returns one of these values: if successful, zero. if unsuccessful, -1. use pr_geterror to obtain the error code. description ssl peers frequently reconnect after a relatively short time has passed. to avoid the overhead of repeating the full ssl handshake in situations like this, the ssl protocol suppo...
Pork
s having the prefix "xform". documentation installing pork download, installation and dependency info for pork pork tools description of rewriting tools pork tool development in progress page... old pork page pork details that haven't been moved to mdc renaming with pork sample pork application todos pork 1.0 release
tracking bug pork releases download pork here community view pork forums... mailing list newsgroup rss feed #static on irc.mozilla.org related topics dehydra, treehydra, mozilla 2, spidermonkey ...
Rhino overview
is less than the second one. all other versions are ecma compliant. string.prototype.split for version 1.2 only, split performs the perl4 special case when given a single space character as an argument (skips leading whitespace, and splits on whitespace). all other versions split on the space character proper as specified by ecma. security the security features in rhino provide the ability to
track the origin of a piece of code (and any pieces of code that it may in turn generate). these features allow for the implementation of a traditional url-based security policy for javascript as in netscape navigator. embeddings that trust the javascript code they execute may ignore the security features. embeddings that run untrusted javascript code must do two things to enable the security features...
Shumway
ay manages it in detail. several buttons are available at the bottom of the screen to enable or disable various shumway options. note: if your applet runs at an abnormal speed, try toggling "turbo" at the bottom of the inspector window. you may wish to do this before opening your swf file. limitations of shumway might be encountered through testing. there are two places where shumway bugs are
tracked: github (via issues and pull requests) manages problems relating to shumway, itself. bugzilla is intended for problems with integrating shumway into firefox. end-users and less involved developers may report issues by hovering over "shumway" within flash content, clicking "report problems", and filling the form. performance and compatibility issues with flash content should be reported t...
SpiderMonkey compartments
touch objects in the same compartment. this invariant is very useful for security purposes. the javascript engine enforces this requirement at a very low level. it means that a "google.com" object can never accidentally leak into an untrusted website such as "evil.com". only a special object type can cross the compartment boundaries. we call these objects cross-compartment wrappers. spidermonkey
tracks the creation of these cross-compartment wrappers and thus it knows at all times what objects from a compartment are kept alive by outside references (through cross-compartment wrappers). this allows the garbage collecting of individual compartments, in addition to global collection. spidermonkey simply assumes that all objects referenced from outside the compartment are live, and then walks the ...
Exact Stack Rooting
special. unlike other gcpointers, they are not traced as part of the gc. instead, every pointer on the cstack should be considered part of the rootset. to that end, we have a special "rooting" mechanism for stack pointers that is very efficiently able to add and remove gcpointers to the rootedset. the downside of this efficiency is that gcpointers must be added to and removed from this rootedset
tracking structure in lifo order. for this reason it is highly recommended that this rooting mechanism only be used on the cstack. js::rooted<t> typedef js::rooted<t> rootedt; -> rootedobject, rootedstring, rootedscript, etc. because of the lifo restriction, using this interface manually is extremely cumbersome. instead, spidermonkey has a convenient suite of c++ raii classes to do this for you, ca...
Statistics API
there are several ways to get access to this data: the environment variable moz_gctimer controls text dumping of gc stats. moz_gctimer may be none, stderr, stdout, or a filename. if a filename is given, data is appended to that file. when logging to a file is used in combination with multi-process firefox (e10s) it is necessary to set security.sandbox.content.level = 0, otherwise the content process will crash. the browser preference javascript.options.mem.log controls dumping of human-readable gc stats messages to the developer console. ...
Tracing JIT
mode eventually involve returning to monitoring mode: if the recorder is asked to record a bytecode that it cannot, for various low-level reasons, faithfully record, the recorder may choose to abort the recording. aborting a recording is always an option in tracemonkey, and on abort the monitor simply discards the recorder and its fragment and returns to monitoring mode. the monitor also keeps
track of how many times it has attempted to record a trace starting at each pc value, so if a particular pc causes too many aborted recordings, the monitor blacklists the pc and will not attempt recording it any longer. if the recorder completes recording at a backward branch back to the initial pc value that triggered recording mode, it is said to have successfully closed the loop. a closed loop is p...
JIT Optimization Strategies
ormation is currently collected for the following operations: getproperty (obj.prop) setproperty (obj.prop = val) getelement (obj[elemname]) setelement (obj[elemname] = val) call (func(...)) at each operation site, ionmonkey tries a battery of strategies, from the most optimized but most restrictive to the least optimized but least restrictive. for each strategy attempted, its outcome is
tracked. an outcome is either success or a reason why the strategy failed to apply. this page documents the various optimization strategies and their outcomes. it provides information on what they attempt to do, what general level of speed-up they provide, what kind of program characteristics can prevent them from being used, and common ways to enable the engine to utilize that optimization. getprope...
JSAPI User Guide
ional engine calls. an advantage of this method is that your application can contain native methods that directly manipulate the object embedding. in either case, if you create an object and then want it to persist in the run time where it can be used by other scripts, you must root the object by calling js_add*root or js_addnamed*root. using these functions ensures that the js engine will keep
track of the objects and clean them up during garbage collection, if appropriate. creating an object from a script one reason to create a custom js object from a script is when you only need an object to exist as long as the script that uses it is executing. to create objects that persist across script calls, you can embed the object code in your application instead of using a script. note: you can ...
JS_SetOptions
y. mxr id search for jsoption_native_branch_callback jsoption_dont_report_uncaught when returning from the outermost api call, prevent uncaught exceptions from being converted to error reports. mxr id search for jsoption_dont_report_uncaught jsoption_relimit added in spidermonkey 1.8 throw an exception if a regular expression back
tracks more than n3 times, where n is the length of the input string. mxr id search for jsoption_relimit jsoption_anonfunfix added in spidermonkey 1.8 disallow function () {} in statement context, per ecma-262 edition 3. this behavior is the default in releases where this option has been removed. mxr id search for jsoption_anonfunfix jsoption_jit obs...
WebReplayRoadmap
ction instead of ipc should work pretty efficiently. recording firefox ui (partially implemented) right now only content tabs can be recorded and replayed. firefox's ui and privileged code is largely written in js, and it would be nice to be able to use web replay to help debug and develop firefox itself, for better dogfooding and gathering internal feedback. this is partially underway and is
tracked in bug 1521566. ...
Zest usecase: Reporting Security Vulnerabilities to Developers
unfortunately in many cases developers may lack the security knowledge to understand or reproduce the problem. also security teams often use tools which the developers do not have access to or have no experience with. and developers sometime fail to solve the underlying problems. while it will still be necessary to describe vulnerabilities, zest allows security teams to create reproducible test cases which they can then share with the developers. ...
Handling Mozilla Security Bugs
cally have access to all mozilla bugs marked "security-sensitive." the members of the mozilla security bug group will be drawn primarily from the following groups: security developers (i.e., those whose bugs are often singled out as security-relevant or who have security-relevant bugs assigned to them), and security qa people who are the qa contacts for those bugs. exploit hunters with a good
track record of finding significant mozilla security vulnerabilities. representatives of the various companies and groups actively distributing mozilla-based products. super-reviewers and drivers. the bugzilla administrators will technically be in the mozilla security bug group as well, mainly because they already have visibility into all bugzilla data hosted through mozilla.org. the mozilla secur...
Task graph
ude build and test tasks, along with lots of other kinds of tasks to build docker images, build toolchains, perform analyses, check syntax, and so on. these tasks are arranged in a "task graph", with some tasks (e.g., tests) depending on others (builds). once its prerequisite tasks complete, a dependent task begins. the result of each task is sent to treeherder where developers and sheriffs can
track the status of the push. the outputs from each task, log files, firefox installers, and so on, appear attached to each task when it completes. these are viewable in the task inspector. all of this is controlled from within the gecko source code, through a process called task-graph generation. this means it's easy to add a new job or tweak the parameters of a job in a try push, eventually landi...
Gecko states
ed applied to: events: concomitant state: state_focusable state_pressed the object is pressed. state_checked the object is checked state_mixed indicates that the state of a three-state check box or toolbar button is not determined. the check box is neither checked nor unchecked and is therefore in the third or mixed state. state_readonly the object is designated read-only. state_hot
tracked the object is hot-
tracked by the mouse, which means that its appearance has changed to indicate that the mouse pointer is located over it. isn't used state_default this state represents the default button in a window. state_expanded children of this object that have the role_outlineitem role are displayed. state_collapsed children of this object that have the role_outlineitem role ar...
Life After XUL: Building Firefox Interfaces with HTML
this page gathers technical solutions to common problems encountered by teams shipping html-based interfaces inside firefox. background: discussion of how to replace xul is ongoing within the platform team. in the meantime, some teams are already experimenting with html5-based interfaces. ...
History Service Design
while frecency is the relevance the page will have in locationbar queries. finally observers are notified a new visit has been added. every visit is identified by its visit date, and a visit type (also known as transition type) that represents how we have come to that page (typed, click, redirect, bookmark, etc.). an additional property of a visit is the visit we have come from, this is used to
track visit chains in global history, so for example if clicking a link causes a redirect the from visit will allow to follow up the chain of visits. at the moment this is used when catching favicons or bookmarks for redirected pages. querying for data querying data is a basic feature for places. thanks to the underlying database, history size has increased far more than 10 times from the previous mo...
An Overview of XPCOM
es a component supports at runtime. this section introduces the base interface-the mother of all interfaces in xpcom - nsisupports, which provides solutions to both of these issues for xpcom developers. object ownership in xpcom, since components may implement any number of different interfaces, components must be reference counted. when a component gets created, an integer inside the component
tracks the number of clients who have an interface to the components -- also known as the reference count. the reference count is incremented automatically when the client instantiates the component; over the course of the component's life, the reference count goes up and down. when all clients lose interest in the component, the reference count hits zero, and the component deletes itself. when client...
Building the WebLock UI
to be able to represent the basic state of the lock as soon as it's loaded. like the secure page icon, the weblock icon that appears in the lower right corner of the browser should indicate whether the browser is currently locked or unlocked. since the weblock component is always initialized as unlocked, we can have the client code - the javascript code in the interface - represent this state and
track it as the user manipulates the iweblock interface. a boolean wlocked variable can do this: // initialize the wlocked variable as unlocked var wlocked = 0; then the functions that get called from the interface and call through to the lock and unlock methods of the weblock component must also adjust this variable accordingly: function wlock() { // check to see if locking is on or off webloc...
Using XPCOM Components
's divided into three subsections: one about actually finding all these binary components in mozilla and two others corresponding to the two main ways that clients typically access xpcom components: finding mozilla components this book attempts to provide reference information for xpcom components and their interfaces that are frozen as of the time of this writing. the mozilla embedding project
tracks the currently frozen interfaces. mozilla also has some tools that can find and display information about the interfaces available in gecko such as the xpcom component viewer, described below, and mxr, which is a web-based source code viewing tool. the challenge to making good information about xpcom components available to prospective clients, however, is that the process of freezing the inter...
Using XPCOM Utilities to Make Things Easier
array of structures represented by the components parameter. each structure describes a cid that is to be registered with xpcom. the first parameter for each of these macros is an arbitrary string that names the module. in a debugging environment, this string will be printed to the screen when the component library is loaded or unloaded. you should pick a name that makes sense and helps you keep
track of things. the four required parts[other-parts] of the structure contain the following information: a human readable class name the class id (cid) the contract id (an optional but recommended argument) a constructor for the given object static const nsmodulecomponentinfo components[] = { { "pretty class name", cid, contract_id, constructor }, // ... }; the important th...
Detailed XPCOM hashtable guide
e entry is removed. the important files to read are xpcom/glue/nsbasehashtable.h and xpcom/glue/nshashkeys.h. these classes can be used on the stack, as a class member, or on the heap. initialize using the init() function; you can specify whether you need thread-safety at this time. use the put(), get(), and remove() methods to alter the table. using nsthashtable as a hash-set a hash set only
tracks the existence of keys: it does not associate data with the keys. this can be done using nsthashtable<nssomehashkey>. the appropriate entries are getentry and putentry. future plans nsisimpleenumerator support the (obsolete) nshashtable has a wrapper that exposes an nsisimpleenumerator on its items. i will add this support to the various nsbasehashtable classes as well, as needed. hash functi...
Mozilla internal string guide
(' '); } } you may change the length of a string via setlength(). note that iterators become invalid after changing the length of a string: /** * replace every tab character in `data` with four spaces. */ void replacetabs2(nsastring& data) { int len = data.length(); char16_t *cur = data.beginwriting(); char16_t *end = data.endwriting(); // because `cur` may change during the loop,
track the position // within the string. int pos = 0; while (cur < end) { if (char16_t('\t') != *cur) { ++pos; ++cur; } else { len += 3; data.setlength(len); // after setlength, read `cur` and `end` again cur = data.beginwriting() + pos; end = data.endwriting(); // move the remaining data over if (pos < len - 1) memmove(cur ...
Index
terface reference note: gecko is a fast evolving project. please check dom/network/interfaces/nsidomnetworkstatsmanager.idl to make sure this data is accurate. 505 nsidommoztouchevent interfaces, xpcom interface reference the nsidommoztouchevent interface describes a raw touch event. this provides a mechanism for working with events from touch screens. this differs from
tracking mouse events in that touch events can be generated independently for each finger touching the screen. this lets you process multi-finger touch gestures and actions. 506 nsidomnshtmldocument dom, document, gecko, interfaces, interfaces:scriptable, needscontent, xpcom api reference, xpcom interface reference provided for compatibility with netscape 4.x, but does not actually...
Components.utils.Sandbox
ge by allowing sandboxes to be discarded when that zone goes away. content scripts should pass the window they're running in as this parameter, in order to ensure that the script is cleaned up at the same time as the content itself. sandboxname a string value which identifies the sandbox in about:memory (and possibly other places in the future). this property is optional, but very useful for
tracking memory usage of add-ons and other javascript compartments. a recommended value for this property is an absolute path to the script responsible for creating the sandbox. as of gecko 13 (firefox 13.0 / thunderbird 13.0 / seamonkey 2.10), if you don't specify a sandbox name it will default to the caller's filename. sandboxprototype a prototype object for the sandbox. the sandbox will inheri...
Components object
do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. warning: this object is only intended for code running with chrome privileges. exposing the object to regular web code was a mistake. if you use this object on your web page, your site might break at any time! in current versions of firefox only a few interfaces required for compatibility are still accessible. ...
Development
source the latest source code is available on the mozilla trunk, in the extensions/java/xpcom directory. build instructions the build instructions are available here: building javaxpcom. bugs all javaxpcom bugs are
tracked in bugzilla, using the "core" product and "java to xpcom bridge" component. list of open javaxpcom bugs open a new javaxpcom bug checkins within the last month ...
mozIPlacesAutoComplete
1.0 66 introduced gecko 1.9.2 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void registeropenpage(in nsiuri auri); void unregisteropenpage(in nsiuri auri); constants constant value description match_anywhere 0 match anywhere in each searchable term. ...
nsIAccessibleStates
bject is focused. state_pressed 0x00000008 the object is pressed. state_checked 0x00000010 the object is checked. state_mixed 0x00000020 indicates that the state of a three-state check box or toolbar button is not determined. the check box is neither checked nor unchecked and is therefore in the third or mixed state. state_readonly 0x00000040 the object is designated read-only. state_hot
tracked 0x00000080 the object is hot-
tracked by the mouse, which means that its appearance has changed to indicate that the mouse pointer is located over it. currently unused. state_default 0x00000100 this state represents the default button in a window. state_expanded 0x00000200 children of this object that have the role_outlineitem role are displayed. (see nsiaccessiblerole.constants). state_co...
nsIContentPrefService2
ferences' name. context the private-browsing context, if any. callback handleresult is called once for each preference. if no such preferences exist, handleresult is not called at all. getcachedbydomainandname() synchronously retrieves from the in-memory cache the preference with the given domain and name. in addition to caching preference values, the cache also keeps
track of preferences that are known not to exist. if the preference is known not to exist, the value attribute of the returned object will be undefined (nsidatatype.vtype_void()). if the preference is neither cached nor known not to exist, then null is returned, and get() must be called to determine whether the preference exists. nsicontentpref getcachedbydomainandname( in astring domain, in astrin...
nsIDOMSimpleGestureEvent
1.0 66 introduced gecko 1.9.1 inherits from: nsidommouseevent last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) the nsidomsimplegestureevent interface is the datatype for all mozilla-specific simple gesture events in the document object model. the following events are generated: mozswipegesture - generated when the user completes a swipe across across the input device. mozmagnifygesturestart - generated when the user begins the magnify ("pinch") gesture. the "delta" value represents the initial movement. ...
nsIDocumentLoader
it is also responsible for sending nsiwebprogresslistener notifications. inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) implemented by: @mozilla.org/docloaderservice;1. ...
nsIDownloadHistory
1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview void adddownload(in nsiuri asource, [optional] in nsiuri areferrer, [optional] in prtime astarttime); methods adddownload() adds a download to history. ...
nsIDownloader
download completes. downloadlocation the location where the stream contents should be written. if null, the downloader will select a location and the resulting file will be deleted (or otherwise made invalid) when the downloader object is destroyed. if an explicit download location is specified then the resulting file will not be deleted, and it will be the callers responsibility to keep
track of the file, and so on. ...
nsINavHistoryResultNode
f the page. for folders and queries, this is the place: uri of the corresponding folder or query. this may be empty for other types of objects, like host containers. read only. viewindex long value with undefined meaning for use by the view. its initial value will be -1. the result implementation treats nodes with this property set to -1 as invisible! view-implementations may use this value to
track the node index in the view, for example the tree view uses this value to indicate the row in the tree that this node is at. other views may choose not to use this, but should inititalize this value to anything but -1 for visible nodes. obsolete since gecko 1.9.2 constants constant value description result_type_uri 0 nsinavhistoryresultnode. result_type_visit 1 nsinavhistoryvisitresultno...
nsIPropertyBag
_error_failure if a property with that name doesn't exist. examples get user agent information (operating system specifics. the window scope is not always accessible so the window.navigator cannot be accessed. ...
nsIProtocolHandler
ble for loading by this protocol, where the uri string is given as an utf-8 string. the caller may provide the charset from which the uri string originated, so that the uri string can be translated back to that charset (if necessary) before communicating with, for example, the origin server of the uri string. (many servers do not support utf-8 iris at the present time, so we must be careful about
tracking the native charset of the origin server.) nsiuri newuri( in autf8string aspec, in string aorigincharset, in nsiuri abaseuri ); parameters aspec the uri string in utf-8 encoding. depending on the protocol's implementation, unicode character sequences may or may not be %xx escaped. aorigincharset the character set of the document from which this uri string originated. this corresp...
nsISmsRequestManager
stid, in long aerror); void notifysmssendfailed(in long arequestid, in long aerror); void notifysmssent(in long arequestid, in nsidommozsmsmessage amessage); constants all sms related errors that could apply to smsrequest objects. constant value description success_no_error 0 no_signal_error 1 not_found_error 2 unknown_error 3 internal_error 4 methods addrequest()
track an already existing request object. long addrequest( in nsidommozsmsrequest arequest ); parameters arequest an smsrequest. return value the request id. createrequest() create a new request object. long createrequest( in nsidommozsmsmanager amanager, out nsidommozsmsrequest arequest ); parameters amanager an smsmanager. arequest an smsrequest. return value the request id. notifycreatem...
nsITelemetry
toolkit/components/telemetry/nsitelemetry.idlscriptable a service to gather performance data that can be
tracked over time to allow generating histograms. 1.0 66 introduced gecko 6.0 inherits from: nsisupports last changed in gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4) implemented by: @mozilla.org/base/telemetry;1 as a service: let telemetry = components.classes["@mozilla.org/base/telemetry;1"] .getservice(components.interfaces.nsitelemetry); method overview jsval gethistogrambyid(in acstring id); jsval snapshothistograms(in uint32_t adataset, in boolean asubsession, in boolean aclear); jsval getkeyedhistogrambyid(in acstring id); void capturestack(in acstring name); jsval s...
nsITraceableChannel
netwerk/base/public/nsitraceablechannel.idlscriptable this interface is used to allow intercepting of http traffic. it is implemented by nsihttpchannel. 1.0 66 introduced gecko 1.9.0.4 inherits from: nsisupports last changed in gecko 1.9.0.4 the typical way to use this interface is as follows: register for the "http-on-examine-response" notification to
track all http responses; skip redirects (responsestatus = 3xx on nsihttpchannel), since otherwise you may end up with two listeners registered for a channel; qi the channel passed as the "subject" to your observer to nsitraceablechannel, and replace the default nsistreamlistener (that passes the data to the original requester - e.g. to xmlhttprequest or to the browser tab that made the request) with your own implementation...
nsITransactionListener
editor/txmgr/idl/nsitransactionlistener.idlscriptable this interface is implemented by an object that
tracks transactions. inherits from: nsisupports last changed in gecko 1.7 method overview void didbeginbatch(in nsitransactionmanager amanager, in nsresult aresult); void diddo(in nsitransactionmanager amanager, in nsitransaction atransaction, in nsresult adoresult); void didendbatch(in nsitransactionmanager amanager, in nsresult aresult); void didmerge(in nsitransactionmanager amanager, in nsitransaction atoptransaction, in nsitransaction atransactiontomerge, in boolean adidmerge, in nsresult amergeresult); void didredo(in nsitransactionmanager amanager, in nsitransaction atransaction, in nsresult aredoresult); void didundo(in nsitransactionmanager amanager, in nsi...
nsITransactionManager
editor/txmgr/idl/nsitransactionmanager.idlscriptable this interface is implemented by an object that wants to manage/
track transactions. inherits from: nsisupports last changed in gecko 1.7 method overview void addlistener(in nsitransactionlistener alistener); void beginbatch(); void clear(); void dotransaction(in nsitransaction atransaction); void endbatch(); nsitransactionlist getredolist(); nsitransactionlist getundolist(); nsitransaction peekredostack(); nsitransaction peekundostack(); void redotransaction(); void removelistener(in nsitransactionlistener alistener); void undotransaction(); attributes attribute type description maxtransactioncount long sets the maximum number of transaction items the transaction manager will maintain at any t...
nsITransferable
urned data. init() initializes a transferable object. this should be called on all transferable objects. failure to do so will result in fatal assertions in debug builds. void init( in nsiloadcontext acontext ); parameters acontext the load context associated with the transferable object. this can be set to null if a load context is not available. remarks the load context is used to
track whether the transferable is storing privacy-sensitive information. for example, we try to delete data that you copy to the clipboard when you close a private browsing window. to get the appropriate load context in javascript callers, one needs to get to the document that the transferable corresponds to, and then get the load context from the document like this: var loadcontext = doc.defaultview...
nsIUpdate
ore detail. crc_error (4) a checksum error occurred. parse_error (5) an error occurred while parsing the patch. read_error (6) an error occurred while reading the patch. write_error (7) an error occurred while writing the patched application. unexpected_error (8) an unanticipate type of error occurred. extensionversion astring the add-on version of this update. used by the extension system to
track compatibility of installed add-ons with this update. obsolete since gecko 2.0 installdate long long the date and time at which the update was installed. iscompleteupdate boolean true if the update is a complete replacement of the existing installation; false if the update is a patch representing the difference between the new version and the existing version. issecurityupdate boolean true i...
nsIWinTaskbar
ments on the window. unlike window previews, tab previews require most of the functionality of the nsitaskbarpreviewcontroller interface be implemented. warning: this api has undergone changes that are not yet documented. among these is the addition of the method getoverlayiconcontroller(). this method is currently known to crash if used under certain conditions. see bug 744992 for details and to
track progress on a fix. implemented by: @mozilla.org/windows-taskbar;1. to create an instance, use: var wintaskbar = components.classes["@mozilla.org/windows-taskbar;1"] .getservice(components.interfaces.nsiwintaskbar); method overview nsijumplistbuilder createjumplistbuilder(); nsitaskbartabpreview createtaskbartabpreview(in nsidocshell shell, in nsitaskbarpreviewcontroller co...
nsIWindowMediator
inherits from: nsisupports last changed in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) the two most common uses of nsiwindowmediator are, enumerating all windows of a given type and getting the most recent / any window of a given type. ...
nsIXFormsModelElement
void refresh(); void revalidate(); methods getinstancedocument() nsidomdocument getinstancedocument( in domstring instanceid ); parameters instanceid the id of the instance element to be returned. return value an nsidomdocument. exceptions thrown domexception if there is no matching instance data. rebuild() signals the xforms processor to rebuild any internal data structures used to
track computational dependencies within the given xforms model. void rebuild(); parameters none. recalculate() signals the xforms processor to perform a full recalculation of the given xforms model. note: script invocation is not necessarily equivalent to performing the recalculate action handler. though the script is assumed to have modified instance data prior to invoking recalculate, the dom mutati...
Setting HTTP request headers
st header is to have a specific web site be able to check if a specific plugin / addon / extension is installed. the good practice is not to have this specific http header (for example "x-site.net-extension") sent all the time but only when doing requests with this specific web sites. by not advertising to all sites what extensions are installed this improves both privacy (this makes it harder to
track a user known by his set of plugins, addons and extensions) and security (some plugins, addons and extensions may be known to have flaws by attackers). with this privacy and security addition the code to use becomes: observe: function(subject, topic, data) { if (topic == "http-on-modify-request") { var httpchannel = subject.queryinterface(ci.nsihttpchannel); if (/site.net/.test(httpc...
Events
composition event name event type fired when... ...
Index
ad pane (aka message list) is driven by classes that implement nsimsgdbview and inherit from nsmsgdbview. these are the main view classes: 24 events there are a lot of events that can be fired in mail code. some of these are standard events, such as those created by the dom. others are internal to gecko or other parts of mozilla application code. this reference will help you
track those events down and learn how to use them. 25 filelink providers thunderbird filelink is a thunderbird feature that makes it easy for users to upload large attachments to web-based storage services such as hightail. 26 nsimsgcloudfileprovider nsimsgcloudfileprovider is the interface that must be implemented by new filelink providers. 27 fold...
Mail composition back end
e nsnull if you want to do the delivery operation "blind" the addlistener/removelistener methods let the caller add and remove listeners to the sending interface. ns_imethod addlistener(nsimsgsendlistener *alistener) = 0; ns_imethod removelistener(nsimsgsendlistener *alistener) = 0; sending listener interfaces the nsimsgsendlistener interface will let a caller keep
track of the progress and any status of a send operation. these are critical for message delivery since message sending is asynchronous. it is the only way to determine if the operation was successful or not. an important item to note is the fact that this interface should also implement the nsimsgcopyservicelistener interface if it wants to be notified of the progress and completion of the copy operat...
Mailnews and Mail code review requirements
h the logs can be conditional. the patch must have been run at least once on the try server. (i have done some mozmill orange fixing where the try server would not duplicate the orange failures of the trunk and so in order to get the enhanced logging, the changes need to go into the trunk.) the patch is authored by the module owner/a peer for the affected test. there must be an associated bug
tracking the orange bug to be fixed. mailnews individuals and roles mail individuals and roles ...
Adding items to the Folder Pane
sting folder pane view. the result is a javascript file that will add a "numbers" container to the end of thunderbird's "all folders" mode. that container will have 3 child-items, the numbers 1, 2, and 3. clicking on those items will display the number in the main viewing pane of thunderbird. first, some necessary background on how the folder pane constructs the data it displays. the folder pane
tracks modifications to a user's folders and accounts. each time the folder pane determines that it is necessary to invalidate all its data (because of too many changes, or more commonly because the folder pane's "mode" (aka view) has changed), a "rebuild" occurs. when this happens, the folder pane consults the map-generator for the current mode, and that generator returns the necessary data for the fo...
Using the Multiple Accounts API
". this the way accounts know which server and which identities they contain. creating new accounts it is possible to create and modify accounts through the account manager api. the account manager is responsible for the creation of all accounts, incoming servers, and identities. you should not use createinstance() to create any of the relevant objects because the account manager needs to keep
track of all of these objects as they are created. to create accounts using the api, you should do the following: create a fresh identity with createidentity(); assign values to the various identity properties as necessary. create a fresh incoming server with createincomingserver(). you will need to pass it the server type as a string, from the list above. assign values to the various server ...
Zombie compartments
bugs in firefox add-ons. compartments firefox’s javascript memory is segregated into zones and compartments. roughly speaking, all memory used by javascript code that is from a particular origin (i.e. website) goes into its own compartment. firefox’s own javascript code also gets one or more compartments and so do add-on scripts. multiple compartments can share a zone, where a zone keeps
track of things that can easily and securely be shared between related compartments such as string data and type information. viewing live compartments if you want to see a list of live compartments, type "about:memory" into the address bar and click on the measure button. in the results, you'll find a js-main-runtime-compartments tree (whcih you may need to expand further) that lists all system (fir...
Declaring types
ements, or with no predetermined size. this is permitted since c allows it, for the widest possible compatibility. declaring an array type with unspecified length to declare a new array type without specifying a length, you simply pass in the ctype specifying the element type when calling ctypes.arraytype(). for example, to create a type for an array of c standard i/o file pointers (perhaps for
tracking a number of active files on disk): const file = new ctypes.structtype("file").ptr; // create file as a file * type const filearray = new ctypes.arraytype(file); // create a filearray type in this example, file is an opaque pointer we can use to refer to c file records, as defined in stdio.h. filearray is a new type representing an array of unspecified length, in which each entry...
Drawing and Event Handling - Plugins
, is returned from npn_getvalue in the value parameter. in many cases, a plug-in may still have to create its own window (a transparent child window of the the browser window) to act as the owner window for pop-up menus and modal dialog boxes. you can give this transparent child window its own windowproc process. the plug-in can use this to deal with wm_command messages sent to it as a result of
tracking the pop-up menu or modal dialog box. unix/x11 the value parameter for npn_getvalue must point to an xlib window. on successful return this will contain the browser toplevel window. use this window to set the wm_transient_for property on dialog boxes. event handling for windowless plug-ins on all platforms, platform-specific events are passed to windowless plug-ins through the npp_handle...
Introduction to DOM Inspector - Firefox Developer Tools
for thunderbird and seamonkey mail and news, any messages you're viewing will be listed here. inspecting chrome documents the inspect chrome document menupopup can be accessed from the file menu , and it will contain the list of currently loaded chrome windows and subdocuments. a browser window and the dom inspector are likely be already open and displayed in this list. the dom inspector keeps
track of all the windows that are open, so to inspect the dom of a particular window in the dom inspector, simply access that window as you would normally and then choose its title from this dynamically updated menulist. inspecting arbitrary urls you may also inspect the dom of arbitrary urls by using the inspect a url menuitem in the file menu, or by just entering a url into the dom inspector's ad...
Debugger.Object - Firefox Developer Tools
row a typeerror exception. global a debugger.object instance referring to the global object in whose scope the referent was allocated. this does not unwrap cross-compartment wrappers: if the referent is a wrapper, the result refers to the wrapper’s global, not the wrapped object’s global. the result refers to the global directly, not via a wrapper. allocationsite if object allocation site
tracking was enabled when this debugger.object’s referent was allocated, return the javascript execution stack captured at the time of the allocation. otherwise, return null. function properties of the debugger.object prototype the functions described below may only be called with a this value referring to a debugger.object instance; they may not be used as methods of other kinds of objects. the d...
Debugger.Script - Firefox Developer Tools
// display name: h/< } var s = f(function () {}); // display name: s< if the instance refers to webassembly code, throw a typeerror. url if the instance refers to a jsscript, the filename or url from which this script’s code was loaded. for scripts created by eval or the function constructor, this may be a synthesized filename, starting with a valid url and followed by information
tracking how the code was introduced into the system; the entire string is not a valid url. for function.prototype’s script, this is null. if this debugger.script’s source property is non-null, then this is equal to source.url. if the instance refers to webassembly code, throw a typeerror. startline if the instance refers to a jsscript, the number of the line at which this script’s code sta...
Debugger.Source - Firefox Developer Tools
s to webassembly code and the debugger has the allowwasmbinarysource property set, a uint8array that contains the webassembly bytecode. url if the instance refers to javascript source, the filename or url from which this script’s code was loaded. for scripts created by eval or the function constructor, this may be a synthesized filename, starting with a valid url and followed by information
tracking how the code was introduced into the system; the entire string is not a valid url. for function.prototype’s script, this is null. source may be loaded from a url in the following ways: the url may appear as the src attribute of a <script> element in markup text. the url may be passed to the worker web worker constructor, or the web worker importscripts function. th...
Debugger-API - Firefox Developer Tools
debugger’s features: setting a breakpoint in a page, running a handler function when it is hit that evaluates an expression in the page’s context. showing how many objects different call paths allocate. gecko-specific features while the debugger core api deals only with concepts common to any javascript implementation, it also includes some gecko-specific features: [global
tracking][global] supports debugging all the code running in a gecko instance at once—the ‘chrome debugging’ model. [object wrapper][wrapper] functions help manipulate object references that cross privilege boundaries. source metadata generated from file: js/src/doc/debugger/debugger-api.md watermark: sha256:6ee2381145a0d2e53d2f798f3f682e82dd7ab0caa0ac4dd5e56601c2e49913a7 changeset: ...
The Firefox JavaScript Debugger - Firefox Developer Tools
you can use it to debug code running locally in firefox or running remotely, for example on an android device running firefox for android. see remote debugging to learn how to connect the debugger to a remote target. to find your way around the debugger, here's a quick tour of the ui. how to to find out what you can do with the debugger, refer to the following how-to guides. ...
Deprecated tools - Firefox Developer Tools
over the course of devtools development, we have added several experimental panels to try out new ideas. not all of these have had wide adoption, and due to the cost of maintenance, seldom used panels are eventually removed. we have created this list of deprecated or removed panels. this page documents the deprecated panels and the bugs that
track their removal. although these panels have been removed, you still have access to the old code, and there are alternative webextensions that you can try to get similar functionality. when we deprecate a panel, we begin by getting feedback from the community to determine the impact of removing that panel. once we have decided to remove the panel, we will provide a warning message, and finally, we will remove the panel from the codebase. you may see ...
Index - Firefox Developer Tools
112 taking screenshots screenshot, tools you can use the developer tools to take a screenshot of the entire page, or of a single element in the page. 113 the firefox javascript debugger debugger, debugging, dev tools, javascript, tools, l10n:priority the javascript debugger enables you to step through javascript code and examine or modify its state to help
track down bugs. 114 break on dom mutation dom mutation breakpoint, debugger, debugging, dev tools, tools, breakpoint a dom mutation breakpoint pauses the code when the dom node on which you have set the breakpoint is modified. 115 debug worker threads debugger, service workers, web workers, debug threads the debugger shows the source code for all running worke...
Network request details - Firefox Developer Tools
status: the http response code for the request. version: the http version used transferred: the amount of data transferred with the request the referrer policy, which governs which referrer information, sent in the referer header, should be included with requests. (see referrer-policy for a description of possible values) blocking: if the request is to a site that is associated with a known
tracker, an icon and a message are shown; otherwise, this field is not shown. response headers the response headers section shows details about the response. for each line in the response headers section, a question mark links to the documentation for that response header, if one is available. a raw toggle button in the section heading controls whether the headers are shown with formatting, or as p...
Network request list - Firefox Developer Tools
timeline the request list also displays a timeline for the different parts of each request. each timeline is given a horizontal position in its row relative to the other network requests, so you can see the total time taken to load the page. for more details on the color-coding used here, see the section on the timings page. start...
Flame Chart - Firefox Developer Tools
g, how long it ran for, and where it was called from. zooming and panning to work effectively with the flame chart, you'll need to be able to navigate it. there are two main controls you can use to navigate the flame chart: zoom: increase/decrease the selected portion of the complete profile that's displayed in the flame chart 1) mouse wheel up/down in the flame chart. 2)
trackpad 2 fingers up/down in the flame chart. pan: move the selected portion of the complete profile left and right 1) click and drag the selected portion in the recording overview pane. 2) click and drag anywhere in the flame chart. an example to see how the flame chart can reveal the behavior of your program, we'll look at a simple example. we'll use the same ...
Frame rate - Firefox Developer Tools
e event. however, consistency is especially important: if you can't deliver 60fps, it's better to deliver lower frame rates more consistently, and avoid sudden dips in the frame rate which cause the site to freeze. frame rate graph the frame rate graph is found in the recording overview part of the performance tool. it takes a timestamp when the browser finishes a frame, and uses this to keep
track of the frame rate over the course of the recording. the x-axis is time over the profile period, and there are three annotations: the maximum frame rate, the average frame rate, and the lowest frame rate. using the frame rate graph the great value of the frame rate graph is that, like the web console, it gives you a quick indication of where your site might be having problems, enabling you to u...
AudioBufferSourceNode.loop - Web APIs
olean which is true if looping is enabled; otherwise, the value is false. when looping is enabled, the sound begins playing at the time specified as the start point when start() is called. when the time specified by the loopend property is reached, playback continues at the time specified by loopstart example in this example, the audiocontext.decodeaudiodata function is used to decode an audio
track and put it into an audiobuffersourcenode. buttons are provided to play and stop the audio playback, and a slider control is used to change the playbackrate property value on the fly. when the audio is played, it loops. you can run the full example live (or view the source.) function getdata() { source = audioctx.createbuffersource(); request = new xmlhttprequest(); request.open('get', ...
AudioBufferSourceNode.loopEnd - Web APIs
ting-point number indicating the offset, in seconds, into the audio buffer at which each loop will loop return to the beginning of the loop (that is, the current play time gets reset to audiobuffersourcenode.loopstart). this property is only used if the loop property is true. the default value is 0. example in this example, the audiocontext.decodeaudiodata() function is used to decode an audio
track and put it into an audiobuffersourcenode. buttons are provided to play and stop the audio playback, and slider controls are used to change the playbackrate, loopstart and loopend properties on the fly. when the audio is played to the end, it loops, but you can control how long the loops last by altering loopstart and loopend. for example, if you set their values to 20 and 25, respectively, then ...
AudioBufferSourceNode.playbackRate - Web APIs
ed at 44.1 khz (44,100 samples per second). let's see what a few values of playbackrate do: a playbackrate of 1.0 plays the audio at full speed, or 44,100 hz. a playbackrate of 0.5 plays the audio at half speed, or 22,050 hz. a playbackrate of 2.0 doubles the audio's playback rate to 88,200 hz. example in this example, the audiocontext.decodeaudiodata() function is used to decode an audio
track, and put it into an audiobuffersourcenode. buttons are provided to play and stop the audio playback, and a slider control is used to change the playbackrate property value on the fly. you can run the example live (or view the source.) play the song and alter the playback rate for some fun results. <input class="playback-rate-control" type="range" min="0.25" max="3" step="0.05" value="1"> <spa...
AudioContext - Web APIs
a mediastreamaudiosourcenode associated with a mediastream representing an audio stream which may come from the local computer microphone or other sources. audiocontext.createmediastreamdestination() creates a mediastreamaudiodestinationnode associated with a mediastream representing an audio stream which may be stored in a local file or sent to another computer. audiocontext.createmediastream
tracksource() creates a mediastream
trackaudiosourcenode associated with a mediastream representing an media stream
track. audiocontext.getoutputtimestamp() returns a new audiotimestamp object containing two audio timestamp values relating to the current audio context. audiocontext.resume() resumes the progression of time in an audio context that has previously been suspended/paused. audiocontext.
AudioListener.dopplerFactor - Web APIs
further away from a music player such as a stereo. in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position via the positionpanner() function. to see a complete implementation, check out our panner-node example (view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a
track on a boom box and then walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. // set up listener and panner po...
AudioListener.forwardX - Web APIs
further away from a music player such as a stereo. in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position via the positionpanner() function. to see a complete implementation, check out our panner-node example (view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a
track on a boom box and then walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. // set up listener and panner po...
AudioListener.forwardY - Web APIs
further away from a music player such as a stereo. in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position via the positionpanner() function. to see a complete implementation, check out our panner-node example (view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a
track on a boom box and then walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. // set up listener and panner po...
AudioListener.forwardZ - Web APIs
further away from a music player such as a stereo. in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position via the positionpanner() function. to see a complete implementation, check out our panner-node example (view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a
track on a boom box and then walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. // set up listener and panner po...
AudioListener.positionX - Web APIs
further away from a music player such as a stereo. in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position via the positionpanner() function. to see a complete implementation, check out our panner-node example (view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a
track on a boom box and then walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. // set up listener and panner po...
AudioListener.positionY - Web APIs
further away from a music player such as a stereo. in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position via the positionpanner() function. to see a complete implementation, check out our panner-node example (view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a
track on a boom box and then walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. // set up listener and panner po...
AudioListener.positionZ - Web APIs
further away from a music player such as a stereo. in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position via the positionpanner() function. to see a complete implementation, check out our panner-node example (view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a
track on a boom box and then walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. // set up listener and panner po...
AudioListener.setOrientation() - Web APIs
further away from a music player such as a stereo. in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position via the positionpanner() function. to see a complete implementation, check out our panner-node example (view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a
track on a boom box and then walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. // set up listener and panner po...
AudioListener.setPosition() - Web APIs
further away from a music player such as a stereo. in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position via the positionpanner() function. to see a complete implementation, check out our panner-node example (view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a
track on a boom box and then walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. // set up listener and panner po...
AudioListener.speedOfSound - Web APIs
further away from a music player such as a stereo. in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position via the positionpanner() function. to see a complete implementation, check out our panner-node example (view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a
track on a boom box and then walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. // set up listener and panner po...
AudioListener.upX - Web APIs
further away from a music player such as a stereo. in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position via the positionpanner() function. to see a complete implementation, check out our panner-node example (view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a
track on a boom box and then walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. // set up listener and panner po...
AudioListener.upY - Web APIs
further away from a music player such as a stereo. in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position via the positionpanner() function. to see a complete implementation, check out our panner-node example (view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a
track on a boom box and then walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. // set up listener and panner po...
AudioListener.upZ - Web APIs
further away from a music player such as a stereo. in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position via the positionpanner() function. to see a complete implementation, check out our panner-node example (view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a
track on a boom box and then walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. // set up listener and panner po...
AudioListener - Web APIs
further away from a music player such as a stereo. in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position via the positionpanner() function. to see a complete implementation, check out our panner-node example (view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a
track on a boom box and then walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. // set up listener and panner po...
BaseAudioContext.createChannelMerger() - Web APIs
nels from multiple audio streams into a single audio stream. syntax baseaudiocontext.createchannelmerger(numberofinputs); parameters numberofinputs the number of channels in the input audio streams, which the output stream will contain; the default is 6 if this parameter is not specified. returns a channelmergernode. example the following example shows how you could separate a stereo
track (say, a piece of music), and process the left and right channel differently. to use them, you need to use the second and third parameters of the audionode.connect(audionode) method, which allow you to specify both the index of the channel to connect from and the index of the channel to connect to. var ac = new audiocontext(); ac.decodeaudiodata(somestereobuffer, function(data) { var source = ac...
BaseAudioContext.createChannelSplitter() - Web APIs
els of an audio stream and process them separately. syntax baseaudiocontext.createchannelsplitter(numberofoutputs); parameters numberofoutputs the number of channels in the input audio stream that you want to output separately; the default is 6 if this parameter is not specified. returns a channelsplitternode. example the following simple example shows how you could separate a stereo
track (say, a piece of music), and process the left and right channel differently. to use them, you need to use the second and third parameters of the audionode.connect(audionode) method, which allow you to specify the index of the channel to connect from and the index of the channel to connect to. var ac = new audiocontext(); ac.decodeaudiodata(somestereobuffer, function(data) { var source = ac.crea...
BaseAudioContext.createConvolver() - Web APIs
and apply that to the convolver. the example below uses a short sample of a concert hall crowd, so the reverb effect applied is really deep and echoey. for applied examples/information, check out our voice-change-o-matic demo (see app.js for relevant code). var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); var convolver = audioctx.createconvolver(); ... ...
BaseAudioContext.createDynamicsCompressor() - Web APIs
d musical applications where large numbers of individual sounds are played simultaneously, where you want to control the overall signal level and help avoid clipping (distorting) of the audio output. syntax baseaudioctx.createdynamicscompressor(); returns a dynamicscompressornode. example the below code demonstrates a simple usage of createdynamicscompressor() to add compression to an audio
track. for a more complete example, have a look at our basic compressor example (view the source code). // create a mediaelementaudiosourcenode // feed the htmlmediaelement into it var source = audioctx.createmediaelementsource(myaudio); // create a compressor node var compressor = audioctx.createdynamicscompressor(); compressor.threshold.setvalueattime(-50, audioctx.currenttime); compressor.knee.set...
BaseAudioContext.createPanner() - Web APIs
further away from a music player such as a stereo. in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position via the positionpanner() function. to see a complete implementation, check out our panner-node example (view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a
track on a boom box and then walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. // set up listener and panner po...
BaseAudioContext - Web APIs
diobuffer object, which can then be populated by data and played via an audiobuffersourcenode. baseaudiocontext.createbuffersource() creates an audiobuffersourcenode, which can be used to play and manipulate audio data contained within an audiobuffer object. audiobuffers are created using audiocontext.createbuffer or returned by audiocontext.decodeaudiodata when it successfully decodes an audio
track. baseaudiocontext.createconstantsource() creates a constantsourcenode object, which is an audio source that continuously outputs a monaural (one-channel) sound signal whose samples all have the same value. baseaudiocontext.createchannelmerger() creates a channelmergernode, which is used to combine channels from multiple audio streams into a single audio stream. baseaudiocontext.createchannel...
Body.arrayBuffer() - Web APIs
playing music in our fetch array buffer live, we have a play button. when pressed, the getdata() function is run. note that before playing full audio file will be downloaded. if you need to play ogg during downloading (stream it) - consider htmlaudioelement: new audio("music.ogg").play(); in getdata() we create a new request using the request() constructor, then use it to fetch an ogg music
track. we also use audiocontext.createbuffersource to create an audio buffer source. when the fetch is successful, we read an arraybuffer out of the response using arraybuffer(), decode the audio data using audiocontext.decodeaudiodata, set the decoded data as the audio buffer source's buffer (source.buffer), then connect the source up to the audiocontext.destination. once getdata() has finished runni...
CacheStorage.keys() - Web APIs
use this method to iterate over a list of all cache objects. you can access cachestorage through the global caches property. syntax caches.keys().then(function(keylist) { //do something with your keylist }); parameters none. return value a promise that resolves with an array of the cache names inside the cachestorage object. ...
Using images - Web APIs
en throw an exception). so you need to be sure to use the load event so you don't try this before the image has loaded: var img = new image(); // create new img element img.addeventlistener('load', function() { // execute drawimage statements here }, false); img.src = 'myimage.png'; // set source path if you're only using one external image this can be a good approach, but once you need to
track more than one we need to resort to something more clever. it's beyond the scope of this tutorial to look at image pre-loading tactics, but you should keep that in mind. embedding an image via data: url another possible way to include images is via the data: url. data urls allow you to completely define an image as a base64 encoded string of characters directly in your code. var img = new image...
ChannelMergerNode - Web APIs
used in the default count mode) channel interpretation "speakers" constructor channelmergernode() creates a new channelmergernode object instance. properties no specific property; inherits properties from its parent, audionode. methods no specific method; inherits methods from its parent, audionode. example the following example shows how you could separate a stereo
track (say, a piece of music), and process the left and right channel differently. to use them, you need to use the second and third parameters of the audionode.connect(audionode) method, which allow you to specify both the index of the channel to connect from and the index of the channel to connect to. var ac = new audiocontext(); ac.decodeaudiodata(somestereobuffer, function(data) { var source = ac...
ChannelSplitterNode - Web APIs
default count mode). channel interpretation "discrete" constructor channelsplitternode() creates a new channelsplitternode object instance. properties no specific property; inherits properties from its parent, audionode. methods no specific method; inherits methods from its parent, audionode. example the following simple example shows how you could separate a stereo
track (say, a piece of music), and process the left and right channel differently. to use them, you need to use the second and third parameters of the audionode.connect(audionode) method, which allow you to specify the index of the channel to connect from and the index of the channel to connect to. var ac = new audiocontext(); ac.decodeaudiodata(somestereobuffer, function(data) { var source = ac.crea...
Console.time() - Web APIs
you give each timer a unique name, and may have up to 10,000 timers running on a given page. when you call console.timeend() with the same name, the browser will output the time, in milliseconds, that elapsed since the timer was started. see timers in the console documentation for details and examples. note: this feature is available in web workers. syntax console.time(label); parameters label the name to give the new timer. this will identify the timer; use the same name when calling console.timeend() to stop the timer and get the time output to the console. ...
Console.timeEnd() - Web APIs
specifications specification status comment console apithe definition of 'console.timeend()' in that specification. living standard initial definition ...
Console.timeLog() - Web APIs
specifications specification status comment console apithe definition of 'console.timelog()' in that specification. living standard initial definition ...
ConvolverNode.buffer - Web APIs
ith this impulse response having the given normalization. the initial value of this attribute is null. syntax var audioctx = new audiocontext(); var convolver = audioctx.createconvolver(); convolver.buffer = myaudiobuffer; value an audiobuffer. example var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); var convolver = audioctx.createconvolver(); ... ...
ConvolverNode.normalize - Web APIs
f the impulse response. changes to this value do not take effect until the next time the buffer attribute is set. syntax var audioctx = new audiocontext(); var convolver = audioctx.createconvolver(); convolver.normalize = false; value a boolean. example var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); var convolver = audioctx.createconvolver(); ... ...
DirectoryEntrySync - Web APIs
do not use it anymore. about this document this document was last updated on march 2, 2012 and follows the w3c specifications (working draft) drafted on april 19, 2011. ...
DirectoryReaderSync - Web APIs
do not use it anymore. about this document this document was last updated on march 2, 2012 and follows the w3c specifications (working draft) drafted on april 19, 2011. this specification is pretty much abandoned, having failed to reach any substantial traction. basic concepts before you call the only method in this interface, readentries(), create the directoryentrysync object. ...
Document: animationiteration event - Web APIs
ationevent event handler property onanimationiteration the original target for this event is the element that had the animation applied. you can listen for this event on the document interface to handle it in the capture or bubbling phases. for full details on this event please see the page on htmlelement: animationiteration. ...
Document.cookie - Web APIs
ansmitted over secure protocol as https. before chrome 52, this flag could appear with cookies from http domains. ;samesite samesite prevents the browser from sending this cookie along with cross-site requests. possible values are lax, strict or none. the lax value value will send the cookie for all same-site requests and top-level navigation get requests. this is sufficient for user
tracking, but it will prevent many csrf attacks. this is the default value in modern browsers. the strict value will prevent the cookie from being sent by the browser to the target site in all cross-site browsing contexts, even when following a regular link. the none value explicitly states no restrictions will be applied. the cookie will be sent in all requests—both cross-site and same-sit...
Document.exitPointerLock() - Web APIs
the exitpointerlock() method asynchronously releases a pointer lock previously requested through element.requestpointerlock. to
track the success or failure of the request, it is necessary to listen for the pointerlockchange and pointerlockerror events. syntax document.exitpointerlock(); specifications specification status comment pointer lockthe definition of 'document' in that specification. candidate recommendation extend the document interface ...
Document: visibilitychange event - Web APIs
of its tab have become visible or have been hidden. bubbles yes cancelable no interface event event handler property onvisibilitychange usage notes the event doesn't include the document's updated visibility status, but you can get that information from the document's visibilitystate property. examples this example begins playing a music
track when the document becomes visible, and pauses the music when the document is no longer visible. document.addeventlistener("visibilitychange", function() { if (document.visibilitystate === 'visible') { backgroundmusic.play(); } else { backgroundmusic.pause(); } }); specifications specification status comment page visibility (second edition)the definiti...
DynamicsCompressorNode.attack - Web APIs
lue is 0.003 and it can be set between 0 and 1. syntax var audioctx = new audiocontext(); var compressor = audioctx.createdynamicscompressor(); compressor.attack.value = 0; value an audioparam. note: though the audioparam returned is read-only, the value it represents is not. example the below code demonstrates a simple usage of createdynamicscompressor() to add compression to an audio
track. for a more complete example, have a look at our basic compressor example (view the source code). // create a mediaelementaudiosourcenode // feed the htmlmediaelement into it var source = audioctx.createmediaelementsource(myaudio); // create a compressor node var compressor = audioctx.createdynamicscompressor(); compressor.threshold.setvalueattime(-50, audioctx.currenttime); compressor.knee.set...
DynamicsCompressorNode.knee - Web APIs
alue is 30 and it can be set between 0 and 40. syntax var audioctx = new audiocontext(); var compressor = audioctx.createdynamicscompressor(); compressor.knee.value = 40; value an audioparam. note: though the audioparam returned is read-only, the value it represents is not. example the below code demonstrates a simple usage of createdynamicscompressor() to add compression to an audio
track. for a more complete example, have a look at our basic compressor example (view the source code). // create a mediaelementaudiosourcenode // feed the htmlmediaelement into it var source = audioctx.createmediaelementsource(myaudio); // create a compressor node var compressor = audioctx.createdynamicscompressor(); compressor.threshold.setvalueattime(-50, audioctx.currenttime); compressor.knee.set...
DynamicsCompressorNode.ratio - Web APIs
lue is 12 and it can be set between 1 and 20. syntax var audioctx = new audiocontext(); var compressor = audioctx.createdynamicscompressor(); compressor.ratio.value = 12; value an audioparam. note: though the audioparam returned is read-only, the value it represents is not. example the below code demonstrates a simple usage of createdynamicscompressor() to add compression to an audio
track. for a more complete example, have a look at our basic compressor example (view the source code). // create a mediaelementaudiosourcenode // feed the htmlmediaelement into it var source = audioctx.createmediaelementsource(myaudio); // create a compressor node var compressor = audioctx.createdynamicscompressor(); compressor.threshold.setvalueattime(-50, audioctx.currenttime); compressor.knee.set...
DynamicsCompressorNode.release - Web APIs
is 0.25 and it can be set between 0 and 1. syntax var audioctx = new audiocontext(); var compressor = audioctx.createdynamicscompressor(); compressor.release.value = 0.25; value an audioparam. note: though the audioparam returned is read-only, the value it represents is not. example the below code demonstrates a simple usage of createdynamicscompressor() to add compression to an audio
track. for a more complete example, have a look at our basic compressor example (view the source code). // create a mediaelementaudiosourcenode // feed the htmlmediaelement into it var source = audioctx.createmediaelementsource(myaudio); // create a compressor node var compressor = audioctx.createdynamicscompressor(); compressor.threshold.setvalueattime(-50, audioctx.currenttime); compressor.knee.set...
DynamicsCompressorNode.threshold - Web APIs
24 and it can be set between -100 and 0. syntax var audioctx = new audiocontext(); var compressor = audioctx.createdynamicscompressor(); compressor.threshold.value = -50; value an audioparam. note: though the audioparam returned is read-only, the value it represents is not. example the below code demonstrates a simple usage of createdynamicscompressor() to add compression to an audio
track. for a more complete example, have a look at our basic compressor example (view the source code). // create a mediaelementaudiosourcenode // feed the htmlmediaelement into it var source = audioctx.createmediaelementsource(myaudio); // create a compressor node var compressor = audioctx.createdynamicscompressor(); compressor.threshold.setvalueattime(-50, audioctx.currenttime); compressor.knee.set...
DynamicsCompressorNode - Web APIs
time, in seconds, required to reduce the gain by 10 db. dynamicscompressornode.release read only is a k-rate audioparam representing the amount of time, in seconds, required to increase the gain by 10 db. methods no specific methods; inherits methods from its parent, audionode. example the below code demonstrates a simple usage of createdynamicscompressor() to add compression to an audio
track. for a more complete example, have a look at our basic compressor example (view the source code). // create a mediaelementaudiosourcenode // feed the htmlmediaelement into it var source = audioctx.createmediaelementsource(myaudio); // create a compressor node var compressor = audioctx.createdynamicscompressor(); compressor.threshold.setvalueattime(-50, audioctx.currenttime); compressor.knee.set...
EffectTiming.iterationStart - Web APIs
imation halfway through its first iteration or loop. meanwhile, a value of 1.2 means the animation will begin playback 20% of the way through its second iteration, and so forth. it's currently undefined what happens if you specify a value of iterationstart which is greater than the value of animationeffecttimingproperties.iterations. see issue 170 in the web animations api specification's issue
tracker for details and status of any changes to the specification in this regard. specifications specification status comment web animationsthe definition of 'iterationstart' in that specification. working draft editor's draft. ...
Element: mouseover event - Web APIs
bubbles yes cancelable yes interface mouseevent event handler property onmouseover examples the following example illustrates the difference between mouseover and mouseenter events. ...
Element: mouseup event - Web APIs
mouseup events are the counterpoint to mousedown events. bubbles yes cancelable yes interface mouseevent event handler property onmouseup examples the following example uses the mousedown, mousemove, and mouseup events to allow the user to draw on an html5 canvas. its functionality is simple: the thickness of the line is set to 1, and the color is always black. ...
Element: mousewheel event - Web APIs
the scroll amount of system settings is page scroll, i.e., the value is the same as ie on windows. on linux, the value is 120 or -120 per native wheel event. this makes the same behavior as ie and chrome for windows. on mac, the value is complicated. the value is changed if the device that causes the native wheel event supports continuous scroll. if the device supports continuous scroll (e.g.,
trackpad of macbook or mouse wheel which can be turned smoothly), the value is computed from accelerated scroll amount. in this case, the value is the same as safari. if the device does not support continuous scroll (typically, old mouse wheel which cannot be turned smoothly), the value is computed from non-accelerated scroll amount (120 per notch). in this case, the value is different from safari. t...
Element.msZoomTo() - Web APIs
do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. the mszoomto method scrolls and/or zooms an element to its specified coordinate with animation. zoomed elements can expose their zoom level through mscontentzoom (ie. scrolltop/left). the zoom level can be reset with mszoomto. this proprietary method is specific to internet explorer and microsoft edge. ...
Element.requestPointerLock() - Web APIs
the element.requestpointerlock() method lets you asynchronously ask for the pointer to be locked on the given element. to
track the success or failure of the request, it is necessary to listen for the pointerlockchange and pointerlockerror events at the document level. syntax instanceofelement.requestpointerlock(); specifications specification status comment pointer lockthe definition of 'requestpointerlock()' in that specification. candidate recommendation ...
Element - Web APIs
a the onmouseout property. mouseover fired when a pointing device is moved onto the element to which the listener is attached or onto one of its children. also available via the onmouseover property. mouseup fired when a pointing device button is released on an element. also available via the onmouseup property. webkitmouseforcechanged fired each time the amount of pressure changes on the
trackpadtouchscreen. webkitmouseforcedown fired after the mousedown event as soon as sufficient pressure has been applied to qualify as a "force click". webkitmouseforcewillbegin fired before the mousedown event. webkitmouseforceup fired after the webkitmouseforcedown event as soon as the pressure has been reduced sufficiently to end the "force click". touch events touchcancel fired when on...
MediaImage - Web APIs
properties src the url from which user agent can fetch the image's data. sizes specifies the resource in multiple sizes so that user agent does not have to scale a single image. type the mime type hint for the user agant. ...
MediaRecorder.ignoreMutedMedia - Web APIs
if this attribute is false, mediarecorder will record silence for audio and black frames for video. the default is false. syntax var boolean = mediarecorder.ignoremutedmedia mediarecorder.ignoremutedmedia = boolean value a boolean. browser compatibility the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
MediaRecorder.onerror - Web APIs
rwise manipulate the mediarecorder while in the wrong state. this exception can also occur when a request is made on a source that has been deleted or removed. securityerror the mediastream is configured to disallow recording. this may be the case, for example, with sources obtained using getusermedia() when the user denies permission to use an input device. this also happens when a mediastream
track within the stream is marked as isolated due to the peeridentity constraint on the source stream. notsupportederror an attempt was made to instantiate a mediarecorder using a mime type that isn't supported on the user's device; one or more of the requested container, codecs, or profiles as well as other information may be invalid. unknownerror an non-security related error occurred that cannot...
MediaRecorderErrorEvent.error - Web APIs
r a mediarecorder couldn't be created because the specified options weren't valid. the message atttribute should provide additional information, if it exists. securityerror the mediastream is configured to disallow recording. this may be the case, for example, with sources obtained using getusermedia() when the user denies permission to use an input device. this also happens when a mediastream
track within the stream is marked as isolated due to the peeridentity constraint on the source stream. example this function creates and returns a mediarecorder for a given mediastream, configured to buffer data into an array and to watch for errors. function recordstream(stream) { let recorder = null; let bufferlist = []; try { recorder = new mediarecorder(stream); } catch(err) { ...
MediaSession - Web APIs
album: "podcast name", artwork: [{src: "podcast.jpg"}] }); navigator.mediasession.setactionhandler('play', function() {}); navigator.mediasession.setactionhandler('pause', function() {}); navigator.mediasession.setactionhandler('seekbackward', function() {}); navigator.mediasession.setactionhandler('seekforward', function() {}); navigator.mediasession.setactionhandler('previous
track', function() {}); navigator.mediasession.setactionhandler('next
track', function() {}); } the following example sets up event handlers for pausing and playing: var audio = document.queryselector("#player"); audio.src = "song.mp3"; navigator.mediasession.setactionhandler('play', play); navigator.mediasession.setactionhandler('pause', pause); function play() { audio.play(); navigator.media...
MediaSessionActionDetails.action - Web APIs
action property is the only required property mediasessionactiondetails dictionary, specifying the type of media session action which the action handler callback is being executed for. syntax let mediasessionactiondetails = { action: actiontype }; let actiontype = mediasessionactiondetails.action; value a domstring specifying which of the action types the callback is being invoked for: next
track advances playback to the next
track. pause pauses playback of the media. play begins (or resumes) playback of the media. previous
track moves back to the previous
track. seekbackward seeks backward through the media from the current position. seekforward seeks forward from the current position through the media. seekto moves the playback position to the specified time within the media...
MediaSessionActionDetails - Web APIs
her action types. media action types a media session action's type is specified using a string from the mediasessionaction enumerated type. values each of the actions is a common media session control request. implement support for each of these in order to allow that type of action to be performed. the following strings identify the currently available types of media session action: next
track advances playback to the next
track. pause pauses playback of the media. play begins (or resumes) playback of the media. previous
track moves back to the previous
track. seekbackward seeks backward through the media from the current position. the mediasessionactiondetails property seekoffset specifies the amount of time to seek backward. seekforward seeks forward from the current positi...
MediaSource.activeSourceBuffers - Web APIs
the activesourcebuffers read-only property of the mediasource interface returns a sourcebufferlist object containing a subset of the sourcebuffer objects contained within sourcebuffers — the list of objects providing the selected video
track, enabled audio
tracks, and shown/hidden text
tracks. syntax var myactivesourcebuffers = mediasource.activesourcebuffers; value a sourcebufferlist containing the sourcebuffer objects for each of the active
tracks. example the following snippet is based on a simple example written by nick desaulniers (view the full demo live, or download the source for further investigation.) function sourceopen (_) { //console.log(this.readystate); // open var mediasource = this; var sourcebuffer = mediasource.addsourcebuffer(mimecodec); fetchab(asseturl, f...
MediaSource - Web APIs
e buffers. properties mediasource.sourcebuffers read only returns a sourcebufferlist object containing the list of sourcebuffer objects associated with this mediasource. mediasource.activesourcebuffers read only returns a sourcebufferlist object containing a subset of the sourcebuffer objects contained within mediasource.sourcebuffers — the list of objects providing the selected video
track, enabled audio
tracks, and shown/hidden text
tracks. mediasource.readystate read only returns an enum representing the state of the current mediasource, whether it is not currently attached to a media element (closed), attached and ready to receive sourcebuffer objects (open), or attached but the stream has been ended via mediasource.endofstream() (ended.) mediasource.duration gets and sets...
MediaStream() - Web APIs
the mediastream() constructor returns a newly-created mediastream, which serves as a collection of media
tracks, each represented by a mediastream
track object. if any parameters are given, the specified
tracks are added to the new stream. otherwise, the stream has no
tracks. syntax newstream = new mediastream(); newstream = new mediastream(stream); newstream = new mediastream(
tracks[]); parameters stream a different mediastream object whose
tracks are added to the newly-created stream automatically. the
tracks are not removed from the original stream, so they're shared by the two streams.
tracks an array of mediastream
track objects, one for each
track to add to the stream. return value a newly-created mediastream object, either empty, or containing the
tracks provided, if any. sp...
MediaStream.clone() - Web APIs
the clone() method of the mediastream interface creates a duplicate of the mediastream. this new mediastream object has a new unique id and contains clones of every mediastream
track contained by the mediastream on which clone() was called. syntax var stream = mediastream.clone(); parameters none. return value a new mediastream instance which has a new unique id and contains clones of every mediastream
track contained by the mediastream on which clone() was called. specifications specification status comment media capture and streamsthe definition of 'mediastream.clone()' in that specification. candidate recommendation initial definition. ...
MediaStream.ended - Web APIs
the ended read-only property of the mediastream interface returns a boolean value which is true if the stream has been completely read, or false if the end of the stream has not been reached. this value once the ended event has been fired. this property has been removed from the specification; you should instead rely on the ended event or check the value of mediastream
track.readystate to see if its value is "ended" for the
track or
tracks you want to ensure have finished playing. syntax var hasended = mediastream.ended; value a boolean value that returns true if the end of the stream has been reached. specifications no longer part of any specification. this property was part of earlier drafts of the media capture and streams specification. ...
MediaStreamAudioDestinationNode.stream - Web APIs
you can use this property to get a stream out of the audio graph and feed it into another construct, such as a media recorder. syntax var audioctx = new audiocontext(); var destination = audioctx.createmediastreamdestination(); var mystream = destination.stream; value a mediastream. ...
MediaStreamAudioSourceOptions.mediaStream - Web APIs
astream property must specify the mediastream from which to retrieve audio data when instantiating a mediastreamaudiosourcenode using the mediastreamaudiosourcenode() constructor. syntax mediastreamaudiosourceoptions = { mediastream: audiosourcestream; } mediastreamaudiosourceoptions.mediastream = audiosourcestream; value a mediastream representing the stream from which to use a mediastream
track as the source of audio for the node. example specifications specification status comment web audio apithe definition of 'mediastreamaudiosourceoptions.mediastream' in that specification. working draft ...
Using the MediaStream Recording API - Web APIs
ng when the stop button is pressed, and finalize the blob ready for use somewhere else in our application. stop.onclick = function() { mediarecorder.stop(); console.log(mediarecorder.state); console.log("recorder stopped"); record.style.background = ""; record.style.color = ""; } note that the recording may also stop naturally if the media stream ends (e.g. if you were grabbing a song
track and the
track ended, or the user stopped sharing their microphone). grabbing and using the blob when recording has stopped, the state property returns a value of "inactive", and a stop event is fired. we register an event handler for this using mediarecorder.onstop, and finalize our blob there from all the chunks we have received: mediarecorder.onstop = function(e) { console.log("recorder st...
msRealTime - Web APIs
do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. msrealtime is a read/write property which specifies whether or not to enable low-latency playback on the media element. this proprietary property is specific to internet explorer and microsoft edge. syntax ptr = object.msrealtime; value boolean value set to true indicates that low-latency playback will be enabled on the media element. ...
msSetMediaProtectionManager - Web APIs
do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. the mssetmediaprotectionmanager method specifies the media protection manager for a given media pipeline. this proprietary method is specific to internet explorer and microsoft edge. syntax htmlmediaelement.mssetmediaprotectionmanager(mediaprotectionmanager); parameters the windows.media.protection namespace provides classes to manage digital rights management (drm) media contents. ...
MutationObserver.observe() - Web APIs
r words, until you've been notified that nodes are being split off from your monitored subtree, you'll get notifications of changes to that split-off subtree and its nodes. this prevents you from missing changes that occur after the connection is severed and before you have a chance to specifically begin monitoring the moved node or subtree for changes. theoretically, this means that if you keep
track of the mutationrecord objects describing the changes that occur, you should be able to "undo" the changes, rewinding the dom back to its initial state. example in this example, we demonstrate how to call the method observe() on an instance of mutationobserver, once it has been set up, passing it a target element and a mutationobserverinit options object. // identify an element to observe const...
Navigator.getUserMedia() - Web APIs
the deprecated navigator.getusermedia() method prompts the user for permission to use up to one video input device (such as a camera or shared screen) and up to one audio input device (such as a microphone) as the source for a mediastream. if permission is granted, a mediastream whose video and/or audio
tracks come from those devices is delivered to the specified success callback. if permission is denied, no compatible input devices exist, or any other error condition occurs, the error callback is executed with a mediastreamerror object describing what went wrong. if the user instead doesn't make a choice at all, neither callback is executed. this is a legacy method. please use the newer navigator.mediadevices.getusermedia() instead. while technically not deprecated, this old callback ve...
Navigator.msLaunchUri() - Web APIs
do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. the mslaunchuri() method is a microsoft extension to the navigator interface, which starts a service or app, such as an email client, that handles a given protocol. the uniform resource identifier (uri) contains the protocol for the default service or app, such as mailto://test@contoso.com. this proprietary method is specific to internet explorer, and microsoft edge versions 18 and lower. ...
Navigator - Web APIs
returns the credentialscontainer interface which exposes methods to request credentials and notify the user agent when interesting events occur such as successful sign in or sign out. navigator.devicememory read only returns the amount of device memory in gigabytes. this value is an approximation given by rounding to the nearest power of 2 and dividing that number by 1024. navigator.donot
track reports the value of the user's do-not-
track preference. when this value is "yes", your web site or application should not
track the user. navigator.mediadevices returns a reference to a mediadevices object which can then be used to get information about available media devices (mediadevices.enumeratedevices()), find out what constrainable properties are supported for media on the user's c...
Online and offline events - Web APIs
this example -nickolay <div id="status"></div> <div id="log"></div> <p>this is a test</p> here's the live result notes if the api isn't implemented in the browser, you can use other signals to detect if you are offline including using service workers and responses from xmlhttprequest. references 'online/offline events' section from the whatwg web applications 1.0 specification the bug
tracking online/offline events implementation in firefox and a follow-up a simple test case an explanation of online/offline events ...
NodeIterator.previousNode() - Web APIs
living standard as detach() is now a no-op method, this method cannot throw anymore. document object model (dom) level 2 traversal and range specificationthe definition of 'nodeiterator.previousnode' in that specificat...
Using the Notifications API - Web APIs
vents that are triggered on the notification instance: click triggered when the user clicks on the notification. close triggered once the notification is closed. error triggered if something goes wrong with the notification; this is usually because the notification couldn't be displayed for some reason. show triggered when the notification is displayed to the user. these events can be
tracked using the onclick, onclose, onerror, and onshow handlers. because notification also inherits from eventtarget, it's possible to use the addeventlistener() method on it. replacing existing notifications it is usually undesirable for a user to receive a lot of notifications in a short space of time — for example, what if a messenger application notified a user for each incoming message, and t...
OverconstrainedError - Web APIs
constructor overconstrainederror.overconstrainederror() creates a new overconstrainederror object. properties overconstrainederror.constraint read only returns the constraint that was supplied in the constructor, meaning the constraint that was not satisfied. ...
Page Visibility API - Web APIs
sends a visibilitychange event to let listeners know the state of the page has changed. you can detect the event and perform some actions or behave differently. for example, if your web app is playing a video, it can pause the video when the user puts the tab into the background, and resume playback when the user returns to the tab. the user doesn't lose their place in the video, the video's sound
track doesn't interfere with audio in the new foreground tab, and the user doesn't miss any of the video in the meantime. visibility states of an <iframe> are the same as the parent document. hiding an <iframe> using css properties (such as display: none;) doesn't trigger visibility events or change the state of the document contained within the frame. use cases let's consider a few use cases for th...
PannerNode.distanceModel - Web APIs
further away from a music player such as a stereo. in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position via the positionpanner() function. to see a complete implementation, check out our panner-node example (view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a
track on a boom box and then walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. // set up listener and panner po...
PannerNode.maxDistance - Web APIs
further away from a music player such as a stereo. in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position via the positionpanner() function. to see a complete implementation, check out our panner-node example (view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a
track on a boom box and then walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. // set up listener and panner po...
PannerNode.panningModel - Web APIs
further away from a music player such as a stereo. in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position via the positionpanner() function. to see a complete implementation, check out our panner-node example (view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a
track on a boom box and then walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. // set up listener and panner po...
PannerNode.setOrientation() - Web APIs
further away from a music player such as a stereo. in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position via the positionpanner() function. to see a complete implementation, check out our panner-node example (view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a
track on a boom box and then walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. // set up listener and panner po...
PannerNode.setPosition() - Web APIs
further away from a music player such as a stereo. in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position via the positionpanner() function. to see a complete implementation, check out our panner-node example (view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a
track on a boom box and then walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. // set up listener and panner po...
PannerNode.setVelocity() - Web APIs
further away from a music player such as a stereo. in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position via the positionpanner() function. to see a complete implementation, check out our panner-node example (view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a
track on a boom box and then walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. // set up listener and panner po...
PannerNode - Web APIs
further away from a music player such as a stereo. in the example you can see this being controlled by the functions moveright(), moveleft(), etc., which set new values for the panner position via the positionpanner() function. to see a complete implementation, check out our panner-node example (view the source code) — this demo transports you to the 2.5d "room of metal", where you can play a
track on a boom box and then walk around the boom box to see how the sound changes! note how we have used some feature detection to either give the browser the newer property values (like audiolistener.forwardx) for setting position, etc. if it supports those, or older methods (like audiolistener.setorientation()) if it still supports those but not the new properties. // set up listener and panner po...
PerformanceEventTiming - Web APIs
e processing event) const inputdelay = entry.processingstart - entry.starttime; // synchronous event processing time (between start and end dispatch). const inputsyncprocessingtime = entry.processingend - entry.processingstart; }); }); // register observer for event. observer.observe({entrytypes: ["event"]}); we can also directly query the first input delay. // keep
track of whether (and when) the page was first hidden, see: // https://github.com/w3c/page-visibility/issues/29 // note: ideally this check would be performed in the document <head> // to avoid cases where the visibility state changes before this code runs. let firsthiddentime = document.visibilitystate === 'hidden' ? 0 : infinity; document.addeventlistener('visibilitychange', (event) => { firsthidde...
Pinch zoom gestures - Web APIs
his handler is also used for pointercancel, pointerleave and pointerout events. function pointerup_handler(ev) { log(ev.type, ev); // remove this pointer from the cache and reset the target's // background and border remove_event(ev); ev.target.style.background = "white"; ev.target.style.border = "1px solid black"; // if the number of pointers down is less than two then reset diff
tracker if (evcache.length < 2) { prevdiff = -1; } } application ui the application uses a <div> element for the touch area and provides buttons to enable logging and to clear the log. to prevent the browser's default touch behavior from overriding this application's pointer handling, the touch-action property is applied to the <body> element. <body onload="init();" style="touch-action:none...
RTCDTMFSender.insertDTMF() - Web APIs
tween 40 ms and 6000 ms (6 seconds), inclusive. the default is 100 ms. intertonegap optional the length of time, in milliseconds, to wait between tones. the browser will enforce a minimum value of 30 ms (that is, if you specify a lower value, 30 ms will be used instead); the default is 70 ms. return value undefined exceptions invalidstateerror the dtmf tones couldn't be sent because the
track has been stopped, or is in a read-only or inactive state. invalidcharactererror one or more of the characters in tones is not valid dtmf. example tbd specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcdtmfsender.insertdtmf()' in that specification. candidate recommendation ...
RTCDTMFSender - Web APIs
the primary purpose for webrtc's dtmf support is to allow webrtc-based communication clients to be connected to a public-switched telephone network (pstn) or other legacy telephone service, including extant voice over ip (voip) services. ...
RTCDataChannel.label - Web APIs
the read-only rtcdatachannel property label returns a domstring containing a name describing the data channel. these labels are not required to be unique. you may use the label as you wish; you could use it to identify all the channels that are being used for the same purpose, by giving them all the same name. or you could give each channel a unique label for
tracking purposes. it's entirely up to the design decisions made when building your site or app. a unique id can be found in the id property. a data channel's label is set when the channel is created by calling rtcpeerconnection.createdatachannel(). it cannot be changed after that. syntax var name = adatachannel.label; value a string identifier assigned by the web site or app when the data channel was created, as specified whe...
RTCDtlsTransport - Web APIs
mber of audio and video channels will always have exactly one dtls transport for audio and one for video communications. because transports are established early in the negotiation process, it's likely that it won't be known until after they're created whether or not the remote peer supports bundling or not. for this reason, you'll sometimes see separate transports created at first, one for each
track, then see them get bundled up once it's known that bundling is possible. if your code accesses rtcrtpsenders and/or rtcrtpreceivers directly, you may encounter situations where they're initially separate, then half or more of them get closed and the senders and receivers updated to refer to the appropriate remaining rtcdtlstransport objects. data channels rtcdatachannels use sctp to communicat...
RTCInboundRtpStreamStats.firCount - Web APIs
request (fir) packets have been sent by the receiver to the sender. the receiver sends a fir packet when the stream falls behind and needs to skip frames in order to catch up. syntax var fircount = rtcinboundrtpstreamstats.fircount; value an integer value indicating how many fir packets have been received by the sender during the current connection. this statistic is available only for video
tracks. the receiver sends a fir packet to the sender any time it falls bahind or loses packets and cannot decode the incoming stream any longer because of the lost data. this tells the sender to send a full frame instead of a delta frame, so that the receiver can catch up. the higher fircount is, the more often frames were dropped, which may be an indication that the media's bit rate is too high for...
RTCInboundRtpStreamStats.qpSum - Web APIs
the qpsum property of the rtcinboundrtpstreamstats dictionary is a value generated by adding the quantization parameter (qp) values for every frame sent or received to date on the video
track corresponding to this rtcinboundrtpstreamstats object. in general, the higher this number is, the more heavily compressed the video data is. syntax var qpsum = rtcinboundrtpstreamstats.qpsum; value an unsigned 64-bit integer value which indicates the sum of the quantization parameter (qp) value for every frame sent or received so far on the
track described by the rtcinboundrtpstreamstats object. since the value of qp is typically larger to indicate higher compression factors, the larger this sum is, the more heavily compressed the stream generally has been. note: this value is only available for vid...
RTCInboundRtpStreamStats - Web APIs
tats object that provides statistics for the remote peer for this same ssrc. this id is stable across multiple calls to getstats(). slicount an integer indicating the number of times the receiver sent a slice loss indication (sli) frame to the sender to tell it that one or more consecutive (in terms of scan order) video macroblocks have been lost or corrupted. available only for video streams.
trackid a string which identifies the statistics object representing the receiving
track; this object is one of two types: rtcreceiveraudio
trackattachmentstats or rtcreceivervideo
trackattachmentstats. this id is stable across multiple calls to getstats(). examples specifications specification status comment webrtc 1.0: real-time communication between browsersthe defin...
RTCOutboundRtpStreamStats.firCount - Web APIs
it has fallen behind and needs to skip frames in order to catch up; the sender should respond by sending a full frame instead of a delta frame. available only on video media. syntax var fircount = rtcoutboundrtpstreamstats.fircount; value an integer value indicating how many fir packets have been received by the sender during the current connection. this statistic is available only for video
tracks. the receiver sends a fir packet to the sender any time it falls bahind or loses packets and cannot decode the incoming stream any longer because of the lost data. this tells the sender to send a full frame instead of a delta frame, so that the receiver can catch up. the higher fircount is, the more often frames were dropped, which may be an indication that the media's bit rate is too high for...
RTCOutboundRtpStreamStats.qpSum - Web APIs
the qpsum property of the rtcoutboundrtpstreamstats dictionary is a value generated by adding the quantization parameter (qp) values for every frame this sender has produced to date on the video
track corresponding to this rtcoutboundrtpstreamstats object. in general, the higher this number is, the more heavily compressed the video data is. syntax var qpsum = rtcoutboundrtpstreamstats.qpsum; value an unsigned 64-bit integer value which indicates the sum of the quantization parameter (qp) value for every frame sent so far on the
track described by the rtcoutboundrtpstreamstats object. since the value of qp is typically larger to indicate higher compression factors, the larger this sum is, the more heavily compressed the stream generally has been. note: this value is only available for vid...
RTCOutboundRtpStreamStats - Web APIs
get a cumulative sum of the target frame sizes (the targeted maximum size of the frame in bytes when the codec is asked to compress it) for all of the frames encoded so far. this will likely differ from the total of the actual frame sizes. totalencodetime a floating-point value indicating the total number of seconds that have been spent encoding the frames encoded so far by this rtcrtpsender.
trackid the id of the rtcsenderaudio
trackattachmentstats or rtcsendervideo
trackattachmentstats object containing the current
track attachment to the rtcrtpsender responsible for this stream. examples specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcoutboundrtpstreamstats' in that specification. ca...
RTCPeerConnection: connectionstatechange event - Web APIs
the new connection state can be found in connectionstate, and is one of the strings in the rtcpeerconnectionstate enumerated type. bubbles no cancelable no interface event event handler onconnectionstatechange examples for an rtcpeerconnection, pc, this example sets up a handler for connectionstatechange messages to handle changes to the connectivity of the webrtc session. it simply calls an app-defined function called setonlinestatus() to update a status display. ...
RTCPeerConnection.createOffer() - Web APIs
the createoffer() method of the rtcpeerconnection interface initiates the creation of an sdp offer for the purpose of starting a new webrtc connection to a remote peer. the sdp offer includes information about any mediastream
tracks already attached to the webrtc session, codec, and options supported by the browser, and any candidates already gathered by the ice agent, for the purpose of being sent over the signaling channel to a potential peer to request a connection or to update the configuration of an existing connection. the return value is a promise which, when the offer has been created, is resolved with a rtcsessiondescription object containing the newly-created offer. syntax apromise = mypeerconnection.createoffer([options]); mypeerconnection.createoffer(successcallback, failurecall...
RTCPeerConnection.getStreamById() - Web APIs
property has been replaced with the rtcpeerconnection.getlocalstreams and rtcpeerconnection.getremotestreams properties. if you have code that uses stream, you will need to update, since browsers have begun to remove support for stream. syntax var mediastream = pc.getstream(id); parameters id is a domstring corresponding to the stream to return. example var stream = pc.getstreambyid(my
trackid); if (stream) { console.log("found stream: " + stream.id); } polyfill running the following code before any other code will create rtcpeerconnection.prototype.getstreambyid() if it's not natively available. // from: https://bugs.chromium.org/p/chromium/issues/detail?id=698163&desc=5#c10 rtcpeerconnection.prototype.getstreambyid = function(id) { try { var localstreams = this.getlocals...
RTCPeerConnection.onaddstream - Web APIs
dstream event, of type mediastreamevent, is received by this rtcpeerconnection. such an event is sent when a mediastream is added to this connection by the remote peer. the event is sent immediately after the call setremotedescription() and doesn't wait for the result of the sdp negotiation. important: this property has been removed from the specification; you should now use rtcpeerconnection.on
track to watch for
track events instead. it is included here in order to help you adapt existing code and understand existing samples, which may not be up-to-date yet. syntax rtcpeerconnection.onaddstream = eventhandler; value a function which handles addstream events. these events, of type mediastreamevent, are sent when streams are added to the connection by the remote peer. the first time an e...
RTCPeerConnection.onnegotiationneeded - Web APIs
hich specifies a function which is called to handle the negotiationneeded event when it occurs on an rtcpeerconnection instance. this event is fired when a change has occurred which requires session negotiation. this negotiation should be carried out as the offerer, because some session changes cannot be negotiated as the answerer. most commonly, the negotiationneeded event is fired after a send
track is added to the rtcpeerconnection. if the session is modified in a manner that requires negotiation while a negotiation is already in progress, no negotiationneeded event will fire until negotiation completes, and only then if negotiation is still needed. syntax rtcpeerconnection.onnegotiationneeded = eventhandler; value this should be set to a function you provide which is passed a single p...
RTCPeerConnection: removestream event - Web APIs
ce's onremovestream property to set a handler for this event. this is the counterpart to the addstream event, which is also obsolete. bubbles no cancelable no interface mediastreamevent event handler property rtcpeerconnection.onremovestream important: this event has been removed from the webrtc specification in favor of the existing remove
track event on the remote mediastream and the corresponding mediastream.onremove
track event handler property of the remote mediastream. the rtcpeerconnection api is now
track-based, so having zero
tracks in the remote stream is equivalent to the remote stream being removed, which caused a removestream event. ...
RTCRtpContributingSource - Web APIs
cated by timestamp. this value is a source-generated time value which can be used to help with sequencing and synchronization. source optional a 32-bit unsigned integer value specifying the csrc identifier of the contributing source. timestamp optional a domhighrestimestamp indicating the most recent time at which a frame originating from this source was delivered to the receiver's mediastream
track specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcrtpcontributingsource' in that specification. candidate recommendation initial definition. ...
RTCRtpEncodingParameters.maxBitrate - Web APIs
the rtcrtpencodingparameters dictionary's maxbitrate property specifies the maximum number of bits per second to allow a
track encoded with this encoding to use. syntax rtpencodingparameters.maxbitrate = maxbitspersecond; rtpencodingparameters = { maxbitrate: maxbitspersecond }; maxbitspersecond = rtpencodingparameters.maxbitrate; value an unsigned long integer value specifying the maximum bandwidth this encoding is permitted to use for a
track of media it encodes in terms of bits per second. other parameters may further reduce the bandwidth used by the
track; for example, maxframerate will, if set low enough, constrain the bandwidth as well. in addition, there's no guarantee that the network interface can support the specified bandwidth, in which case the actual bandwidth will be lo...
RTCRtpEncodingParameters.scaleResolutionDownBy - Web APIs
syntax rtpencodingparameters.scaleresolutiondownby = scalingfactor; rtpencodingparameters = { scaleresolutiondownby: scalingfactor }; value a double-precison floating-point number specifying the amount by which to reduce the size of the video during encoding. the default value, 1.0, means that the video will be encoded at its original size. ...
RTCRtpEncodingParameters - Web APIs
ly relevant for audio encodings. the user agent will try to match this as well as it can, but there is no guarantee. rid a domstring which, if set, specifies an rtp stream id (rid) to be sent using the rid header extension. this parameter cannot be modified using setparameters(). its value can only be set when the transceiver is first created. scaleresolutiondownby only used for senders whose
track's kind is video, this is a double-precision floating-point value specifying a factor by which to scale down the video during encoding. the default value, 1.0, means that the sent video's size will be the same as the original. a value of 2.0 scales the video frames down by a factor of 2 in each dimension, resulting in a video 1/4 the size of the original. the value must not be less than 1.0 (you c...
RTCRtpReceiver.getParameters() - Web APIs
syntax let rtpreceiveparameters = rtpreceiver.getparameters(); parameters none. return value an rtcrtpreceiveparameters object indicating the current configuration of the receiver. examples this example obtains the canonical name (cname) being used for rtcp on an rtcrtpreceiver. ...
RTCRtpReceiver.transport - Web APIs
the read-only transport property of an rtcrtpreceiver object provides the rtcdtlstransport object used to interact with the underlying transport over which the receiver is exchanging real-time transport control protocol (rtcp) packets. this transport is responsible for receiving the data for the media on the receiver's
track. syntax let transport = rtcrtpreceiver.transport; value an rtcdtlstransport object representing the underlying transport being used by the receiver to exchange packets with the remote peer, or null if the receiver isn't yet connected to a transport. description when the rtcrtpreceiver is first created, the value of transport is null. this is replaced with an rtcdtlstransport once the receiver's transport has been established. note that when bundling is in effect—...
RTCRtpSendParameters - Web APIs
degradationpreference specifies the preferred way the webrtc layer should handle optimizing bandwidth against quality in constrained-bandwidth situations; the value comes from the rtcdegradationpreference enumerated string type, and the default is balanced. encodings an array of rtcrtpencodingparameters objects, each specifying the parameters for a single codec that could be used to encode the
track's media. priority a string from the rtcprioritytype enumerated type which indicates the encoding's priority. the default value is low. transactionid a string containing a unique id for the last set of parameters applied; this value is used to ensure that setparameters() can only be called to alter changes made by a specific previous call to getparameters(). specifications specifi...
RTCRtpSender.getParameters() - Web APIs
syntax var rtpsendparameters = rtpsender.getparameters() parameters none. return value an rtcrtpsendparameters object indicating the current configuration of the sender. ...
RTCRtpSender.transport - Web APIs
the read-only transport property of an rtcrtpsender object provides the rtcdtlstransport object used to interact with the underlying transport over which the sender is exchanging real-time transport control protocol (rtcp) packets. this transport is responsible for receiving the data for the media on the sender's
track. syntax let transport = rtcrtpsender.transport; value an rtcdtlstransport object representing the underlying transport being used by the sender to exchange packets with the remote peer, or null if the sender isn't yet connected to a transport. description when the rtcrtpsender is first created, the value of transport is null. this is replaced with an rtcdtlstransport once the sender's transport has been established. note that when bundling is in effect—that is, when th...
RTCRtpStreamStats.firCount - Web APIs
intra request (fir) packets have been sent by the receiver to the sender. this is a measure of how often the stream falls behind and has to skip frames in order to catch up. syntax var fircount = rtcrtpstreamstats.fircount; value an integer value indicating how many fir packets have been received by the sender during the current connection. this value is available only on receivers for video
tracks. the receiver sends a fir packet to the sender any time it falls bahind or loses packets and cannot decode the incoming stream any longer because of the lost data. this tells the sender to send a full frame instead of a delta frame, so that the receiver can catch up. the higher fircount is, the more often frames were dropped, which may be an indication that the media's bit rate is too high for...
RTCRtpStreamStats.kind - Web APIs
the described rtp stream contains audio or video media. its value is always either "audio" or "video". this property was previously called mediatype. the name was changed in the specification in february, 2018. see browser compatibility below to determine how this affects the browsers you're targeting. syntax mediakind = rtcrtpstreamstats.kind; value a domstring whose value is "audio" if the
track whose statistics are given by the rtcrtpstreamstats object contains audio, or "video" if the
track contains video media. this string will always be the same as the one provided by the associated mediastream
track object's kind property. it will also match the statistics object's rtccodecstats.codec property's media type. specifications specification status comment identi...
RTCRtpStreamStats.qpSum - Web APIs
the qpsum property of the rtcrtpstreamstats dictionary is a value generated by adding the quantization parameter (qp) values for every frame sent or received to date on the video
track corresponding to this rtcrtpstreamstats object. in general, the higher this number is, the more heavily compressed the video data is. syntax var qpsum = rtcrtpstreamstats.qpsum; value an unsigned 64-bit integer value which indicates the sum of the quantization parameter (qp) value for every frame sent or received so far on the
track described by the rtcrtpstreamstats object. since the value of qp is typically larger to indicate higher compression factors, the larger this sum is, the more heavily compressed the stream generally has been. note: this value is only available for video media. usage notes qua...
RTCRtpTransceiver.stop() - Web APIs
ntax rtcrtptransceiver.stop() paramters none. return value undefined exceptions invalidstateerror the rtcpeerconnection of which the transceiver is a member is closed. usage notes when you call stop() on a transceiver, the sender immediately stops sending media and each of its rtp streams are closed using the rtcp "bye" message. the receiver then stops receiving media; the receiver's
track is stopped, and the transceiver's direction is changed to stopped, and renegotiation is triggered by sending a negotiationneeded event to the rtcpeerconnection. the negotiation process causes currentnegotiation to be set to stopped, finally indicating that the transceiver has been fully stopped. note: stopping the transceiver causes a negotiationneeded event to be sent to the transceiver's rtc...
RTCRtpTransceiverInit - Web APIs
tionality. this value is used to initialize the new rtcrtptransceiver object's rtcrtptransceiver.direction property. sendencodings optional a list of encodings to allow when sending rtp media from the rtcrtpsender. each entry is of type rtcrtpencodingparameters. streams optional a list of mediastream objects to add to the transceiver'srtcrtpreceiver; when the remote peer's rtcpeerconnection's
track event occurs, these are the streams that will be specified by that event. specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcrtptransceiverinit' in that specification. candidate recommendation ...
RTCStatsReport - Web APIs
pective of the remote peer. sender an object containing statistics about the rtcrtpsender for a stream on the rtcpeerconnection. if kind is "audio", this object is of type rtcaudiosenderstats; if kind is "video", this is an rtcvideosenderstats object. stream an object of type rtcmediastreamstats, providing statistics and information about a mediastream which is part of the rtcpeerconnection.
track the object is one of the types based on rtcmediahandlerstats: for audio
tracks, the type is rtcsenderaudio
trackattachmentstats and for video
tracks, the type is rtcsendervideo
trackattachmentstats. the data within provides statistics related to a particular mediastream
track's attachment to an rtcrtpsender; also included are the media level metrics that go along with the
track. transport an obje...
RTCStatsType - Web APIs
pective of the remote peer. sender an object containing statistics about the rtcrtpsender for a stream on the rtcpeerconnection. if kind is "audio", this object is of type rtcaudiosenderstats; if kind is "video", this is an rtcvideosenderstats object. stream an object of type rtcmediastreamstats, providing statistics and information about a mediastream which is part of the rtcpeerconnection.
track the object is one of the types based on rtcmediahandlerstats: for audio
tracks, the type is rtcsenderaudio
trackattachmentstats and for video
tracks, the type is rtcsendervideo
trackattachmentstats. the data within provides statistics related to a particular mediastream
track's attachment to an rtcrtpsender; also included are the media level metrics that go along with the
track. transport an obje...
RequestDestination - Web APIs
content. "font" the target is a font. "image" the target is an image. "manifest" the target is a manifest. "object" the target is an object. "paintworklet" the target is a paint worklet. "report" the target is a report. "script" the target is a script. "serviceworker" the target is a service worker. "sharedworker" the target is a shared worker. "style" the target is a style "
track" the target is an html <
track>. "video" the target is video data. "worker" the target is a worker. "xslt" the target is an xlst transform. specifications specification status comment fetchthe definition of 'requestdestination' in that specification. living standard initial definition ...
SVGAElement - Web APIs
tmlanchorelement.href. svgaelement.hreflang is a domstring that reflects the hreflang attribute, indicating the language of the linked resource. svgaelement.ping is a domstring that reflects the ping attribute, containing a space-separated list of urls to which, when the hyperlink is followed, post requests with the body ping will be sent by the browser (in the background). typically used for
tracking. svgaelement.referrerpolicy see htmlanchorelement.referrerpolicy. svgaelement.rel see htmlanchorelement.rel. svgaelement.rellist see htmlanchorelement.rellist. svgaelement.target read only it corresponds to the target attribute of the given element. svgaelement.text is a domstring being a synonym for the node.textcontent property. svgaelement.type is a domstring that reflects the ...
TimeRanges - Web APIs
a timeranges object includes one or more ranges of time, each specified by a starting and ending time offset. you reference each time range by using the start() and end() methods, passing the index number of the time range you want to retrieve. the term "normalized timeranges object" indicates that ranges in such an object are ordered, don't overlap, aren't empty, and don't touch (adjacent ranges are folded into one bigger range). ...
msManipulationViewsEnabled - Web APIs
do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. the msmanipulationviewsenabled read-only property returns true if manipulation features are support available, such as touch panning and zooming using css rules. this proprietary property is specific to internet explorer and microsoft edge. value returns true if manipulation features are support available, such as touch panning and zooming using css rules. ...
TouchEvent - Web APIs
the event can describe one or more points of contact with the screen and includes support for detecting movement, addition and removal of contact points, and so forth. touches are represented by the touch object; each touch is described by a position, size and shape, amount of pressure, and target element. lists of touches are represented by touchlist objects. ...
TouchList - Web APIs
properties touchlist.length read only the number of touch objects in the touchlist. methods touchlist.identifiedtouch() returns the first touch item in the list whose identifier matches a specified value. touchlist.item() returns the touch object at the specified index in the list. ...
Using Touch Events - Web APIs
touch surface. touchcancel - fired when a touch point has been disrupted in an implementation-specific manner (for example, too many touch points are created). the touch interface represents a single contact point on a touch-sensitive device. the contact point is typically referred to as a touch point or just a touch. a touch is usually generated by a finger or stylus on a touchscreen, pen or
trackpad. a touch point's properties include a unique identifier, the touch point's target element as well as the x and y coordinates of the touch point's position relative to the viewport, page, and screen. the touchlist interface represents a list of contact points with a touch surface, one touch point per contact. thus, if the user activated the touch surface with one finger, the list would contain...
WebGL model view projection - Web APIs
represent the camera placement. world space → view matrix → view space finally a projection (in our case the perspective projection matrix) needs to be added in order to map the world coordinates into clip space coordinates. view space → projection matrix → clip space exercise move the camera around the scene. add some rotation matrices to the view matrix to look around. finally,
track the mouse's position. use 2 rotation matrices to have the camera look up and down based on where the user's mouse is on the screen. ...
Lifetime of a WebRTC session - Web APIs
signaling process there's a sequence of things that have to happen in order to make it possible to begin a webrtc session: each peer creates an rtcpeerconnection object representing their end of the webrtc session. each peer establishes a handler for icecandidate events, which handles sending those candidates to the other peer over the signaling channel. each peer establishes a handler for
track event, which is received when the remote peer adds a
track to the stream. this code should connect the
tracks to its consumer, such as a <video> element. the caller creates and shares with the receiving peer a unique identifier or token of some kind so that the call between them can be identified by the code on the signaling server. the exact contents and form of this identifier is up to you. e...
Taking still photos with WebRTC - Web APIs
o so. using specific devices you can, if needed, restrict the set of permitted video sources to a specific device or set of devices. to do so, call navigator.mediadevices.enumeratedevices(). when the promise is fulfilled with an array of mediadeviceinfo objects describing the available devices, find the ones that you want to allow and specify the corresponding deviceid or deviceids in the media
trackconstraints object passed into getusermedia(). ...
Using WebRTC data channels - Web APIs
tc data channels. this proposal is still in ietf draft form, but once implemented, it will make it possible to send messages with essentially no size limitations, since the sctp layer will automatically interleave the underlying sub-messages to ensure that every channel's data has the opportunity to get through. firefox support for ndata is in the process of being implemented; see bug 1381145 to
track it becoming available for general use. the chrome team is
tracking their implementation of ndata support in chrome bug 5696. much of the information in this section is based in part on the blog post demystifyijng webrtc's data channel message size limitations, written by lennart grahl. he goes into a bit more detail there, but as browsers have been updated since then some of it may be out-of-da...
Writing WebSocket servers - Web APIs
ttp request. so if the key was "dghlihnhbxbszsbub25jzq==", the sec-websocket-accept header's value is "s3pplmbitxaq9kygzzhzrbk+xoo=". once the server sends these headers, the handshake is complete and you can start swapping data! note: the server can send other headers like set-cookie, or ask for authentication or redirects via other status codes, before sending the reply handshake. keeping
track of clients this doesn't directly relate to the websocket protocol, but it's worth mentioning here: your server must keep
track of clients' sockets so you don't keep handshaking again with clients who have already completed the handshake. the same client ip address can try to connect multiple times. however, the server can deny them if they attempt too many connections in order to save itself fro...
WebXR application life cycle - Web APIs
in this guide, we'll get a birds-eye view of what's involved in creating and driving a webxr application, without diving down to the code level in detail. this serves as preparation for the next few articles in these webxr guides, which cover starting up and shutting down a webxr session, geometry, simulating cameras, spatial
tracking, and more. life cycle outline most applications using webxr will follow a similar overall design pattern: check to see if the user's device and browser are both capable of presenting the xr experience you want to provide. make sure the webxr api is available; if navigator.xr is undefined, you can assume the user's browser and/or device doesn't support webxr. if it's not supported, disable any user interface used to activate xr features and abort any ...
Movement, orientation, and motion: A WebXR example - Web APIs
ons use the local reference space, while inline sessions use the viewer reference space. the glmatrix library's fromtranslation() function for 4x4 matrices is used to convert the viewer's start position as given in the viewerstartposition constant into a transform matrix. the viewer's starting orientation, viewerstartorientation, is copied into the cubeorientation property, which will be used to
track the rotation of the cube over time. sessionstarted() finishes up by calling the session's requestreferencespace() method to get a reference space object describing the space in which the object is being created. when the promise returned resolves to a xrreferencespace object, we call its getoffsetreferencespace function to obtain a reference space object to represent the object's coordinate syst...
WebXR permissions and security - Web APIs
h being aware of. these mostly revolve around the fully-immersive immersive-vr session mode, but there are things to be aware of when setting up an ar session, as well. immersive presentation of vr first, any requests to activate the immersive-vr mode are rejected if the domain issuing the request does not have permission to enable an immersive session. this permission comes from the xr-spatial-
tracking feature policy. once that check is passed, the request to enter immersive-vr mode is allowed if all of the following are true: the requestsession() call was issued by code executing within the handler for a user event, or the from the startup code for a user-launched web application. the document is considered trustworthy, in that it is responsible and is both currently active and has foc...
Web Animations API Concepts - Web APIs
specifications to piggyback on, allowing them to to remain consistent and play well together. it also provides a point of reference all browsers can adhere to with the currently available specs. the two models: timing and animation the web animations api runs on top of two models, one that handles time—timing—and one that handles visual change over time—animation. the timing model keeps
track of how far along a set timeline we've come. the animation model determines what the animated object should look like at any given time. timing the timing model is the backbone of working with the waapi. each document has a master timeline, document.timeline, which stretches from the moment the page is loaded to infinity — or until the window is closed. spread along that timeline according to ...
Web Audio API best practices - Web APIs
web audio api and it can be a little confusing as to which one you should use. when working with files, you are looking at either the grabbing the file from an htmlmediaelement (i.e. an <audio> or <video> element), or you're looking to fetch the file and decode it into a buffer. both are legitimate ways of working, however, it's more common to use the former when you are working with full-length
tracks, and the latter when working with shorter, more sample-like
tracks. media elements have streaming support out of the box. the audio will start playing when the browser determines it can load the rest of the file before playing finishes. you can see an example of how to use this with the web audio api in the using the web audio api tutorial. you will, however, have more control if you use a buf...
Web audio spatialization basics - Web APIs
the pannernode properties do (there are quite a few of them). the values can be hard to manipulate sometimes and depending on your use case it can take some time to get them right. note: there are slight differences in the way the audio spatialization sounds across different browsers. the panner node does some very involved maths under the hood; there are a number of tests here so you can keep
track of the status of the inner workings of this node across different platforms. again, you can check out the final demo here, and the final source code is here. there is also a codepen demo too. if you are working with 3d games and/or webxr it's a good idea to harness a 3d library to create such functionality, rather than trying to do this all yourself from first principles. we rolled our own in ...
Window: animationiteration event - Web APIs
imationevent event handler property onanimationiteration the original target for this event is the element that had the animation applied. you can listen for this event on the window interface to handle it in the capture or bubbling phases. for full details on this event please see the page on htmlelement: animationiteration. ...
Window.content - Web APIs
do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. note: since firefox 57 (initially nightly-only), both the content and _content variants are only available to chrome (privileged) code, and not available to the web anymore. returns a window object for the primary content window. ...
Window.ondragdrop - Web APIs
do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. removed in firefox 50, and never implemented in any other browser. use the modern standard html5 drag and drop feature instead. summary an event handler for drag and drop events sent to the window. syntax window.ondragdrop = funcref; window.addeventlistener("dragdrop", funcref, usecapturing); funcref the event handler function to be registered. ...
Window.sessionStorage - Web APIs
ata for the specified origin. example the following snippet accesses the current origin's session storage object and adds data to it with storage.setitem(). sessionstorage.setitem('mycat', 'tom'); the following example autosaves the contents of a text field, and if the browser is refreshed, restores the text field content so that no writing is lost. ...
WindowOrWorkerGlobalScope.setInterval() - Web APIs
tion. this lets you easily bypass problems where it's unclear what this will be, depending on the context from which your function was called. also, es2015 supports arrow functions, with lexical this allowing us to write setinterval( () => this.mymethod) if we're inside myarray method. minidaemon - a framework for managing timers in pages requiring many timers, it can often be difficult to keep
track of all of the running timer events. one approach to solving this problem is to store information about the state of a timer in an object. following is a minimal example of such an abstraction. the constructor architecture explicitly avoids the use of closures. it also offers an alternative way to pass the this object to the callback function (see the "this" problem for details). the following cod...
XMLHttpRequest.multipart - Web APIs
do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. obsolete since gecko 22 this gecko-only feature was removed in firefox/gecko 22. please use server-sent events, web sockets, or responsetext from progress events instead. this boolean indicates if the response is expected to be a stream of possibly multiple xml documents. if set to true, the content type of the initial response must be multipart/x-mixed-replace or an error will occur. ...
XMLHttpRequest.openRequest() - Web APIs
do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. this mozilla-specific method is available only from within privileged code, and is only called from a c++ context in order to initialize an xmlhttprequest. ...
XMLHttpRequest.upload - Web APIs
the following events can be triggered on an upload object and used to monitor the upload: event event listener description loadstart onloadstart the upload has begun. progress onprogress periodically delivered to indicate the amount of progress made so far. ...
XRFrameRequestCallback - Web APIs
on.requestanimationframe (part of webxr api) to obtain the current time and the current xrframe. syntax function xrframerequestcallback(time, xrframe){ // process xrframe here } xrsession.requestanimationframe(xrframerequestcallback) parameters domhighrestimestamp a timestamp corresponding to the returned xrframe. xrframe an xrframe representing a snapshot of the state of all of the
tracked objects for the xrsession. return value none. specifications specification status comment webxr device apithe definition of 'xrframerequestcallback' in that specification. working draft initial definition. ...
XRInputSourceEvent - Web APIs
more specifically, they represent a change in the state of an xrinputsource. to learn more about handling inputs in a webxr project, see the article inputs and input sources. constructor xrinputsourceevent() creates and returns a new xrinputsourceevent object whose properties match those provided in the eventinitdict dictionary provided. ...
XRInputSourcesChangeEvent - Web APIs
following example shows how to set up an event handler which uses inputsourceschange events to detect newly-available pointing devices and to load their models in preparation to display them in the next animation frame. xrsession.addeventlistener("inputsourceschange", oninputsourceschange); function oninputsourceschange(event) { for (let input of event.added) { if (input.targetraymode == "
tracked-pointer") { loadcontrollermesh(input); } } } you can also add a handler for inputsourceschange events by setting the oninputsourceschange event handler: xrsession.oninputsourceschange = oninputsourceschange; specifications specification status comment webxr device apithe definition of 'xrinputsourceschangeevent' in that specification. working draf...
XRPermissionDescriptor.mode - Web APIs
ntegrated into the surrounding environment. the environmentblendmode is expected to be opaque if possible, but might be additive if the hardware requires it. inline the output is presented inline within the context of an element in a standard html document, rather than occupying the full visual space. inline sessions can be presented in either mono or stereo mode, and may or may not have viewer
tracking available. inline sessions don't require special hardware and should be avalable on any user agent offering webxr api support. usage notes examples the example below checks to ensure that permission has been granted to allow the user to use webxr for an immersive virtual reality experience. no specific features are specified during this query; see requiredfeatures and optionalfeatures for ...
XRPose - Web APIs
h explanations of what's going on. properties xrpose.transform read only a xrrigidtransform which provides the position and orientation of the pose relative to the base xrspace. xrpose.emulatedposition read only a boolean value which is false if the position and orientation given by transform is obtained directly from a full six degree of freedom (6dof) xr device (that is, a device which
tracks not only the pitch, yaw, and roll of the head but also the forward, backward, and side-to-side motion of the viewer). if any component of the transform is computed or created artificially (such as by using mouse or keyboard controls to move through space), this value is instead true, indicating that the transform is in part emulated in software. example <<<--- todo: needs example --->>> spec...
XRSessionMode - Web APIs
ntegrated into the surrounding environment. the environmentblendmode is expected to be opaque if possible, but might be additive if the hardware requires it. inline the output is presented inline within the context of an element in a standard html document, rather than occupying the full visual space. inline sessions can be presented in either mono or stereo mode, and may or may not have viewer
tracking available. inline sessions don't require special hardware and should be avalable on any user agent offering webxr api support. usage notes the xrsessionmode type indicates the values that can be specified when calling xr.issessionsupported() to determine whether or not the specified session type is supported and available to be used, and by requestsession() to attempt to open a new webxr se...
XRSystem: devicechange event - Web APIs
eric event with no added properties. note: not to be confused with the mediadevices devicechange event. bubbles no cancelable no interface event event handler xrsystem.ondevicechange usage notes devicechange events are not delivered if the document which owns the xrsystem object has been granted permission to do so through the xr-spatial-
tracking feature policy. you can use this event to, for example, monitor for the availability of a webxr-compatible device so that you can enable a ui element which the user can use to activate immersive mode. this is shown in the example below. example the example shown here handles the devicechange event by toggling the availability of the "enter xr" button based on whether or not any immersive de...
XRSystem: isSessionSupported() - Web APIs
a promise that resolves to true if the specified session mode is supported; otherwise the promise resolves to false. exceptions rather than throwing true exceptions, issessionsupported() rejects the returned promise, passing to the rejection handler a domexception whose name is one of the following strings. securityerror the document's origin does not have permission to use the xr-spatial-
tracking feature policy. examples in this example, we see issessionsupported() used to detect whether or not the device supports vr mode by checking to see if an immersive-vr session is supported. if it is, we set up a button to read "enter xr", to call a method onbuttonclicked(), and enable the button. if no session is already underway, we request the vr session and, if successful, set up the sess...
XRSystem: requestSession() - Web APIs
ntegrated into the surrounding environment. the environmentblendmode is expected to be opaque if possible, but might be additive if the hardware requires it. inline the output is presented inline within the context of an element in a standard html document, rather than occupying the full visual space. inline sessions can be presented in either mono or stereo mode, and may or may not have viewer
tracking available. inline sessions don't require special hardware and should be avalable on any user agent offering webxr api support. sessioninit optional a xrsessioninit object providing options to configure the new xrsession. see specifying session options for details on how to configure a webxr session. return value a promise that resolves with an xrsession object if the device and user agen...
XRView.eye - Web APIs
updateinjury() returns true if the eye is still injured or false if the eye has been restored to health by the function,. if the result is false, indicating that the eye is now healthy, we render the scene for that eye. otherwise, we don't. specifications specification status comment ...
Keyboard - Accessibility
to be fully accessible, a web page must be operable by someone using only a keyboard to access and control it. this includes users of screen readers, but can also include users who have trouble operating a pointing device such as a mouse or
trackball, or whose mouse is not working at the moment, or who simply prefer to use a keyboard for input whenever possible. focusable elements should have interactive semantics if an element can be focused using the keyboard, then it should be interactive; that is, the user should be able to do something to it and produce a change of some kind (for example, activating a link or changing an option). note: one important exception to this rule is if the element has role="document" applied to it, inside an interactive context (such as role="applicati...
::-moz-range-progress - CSS: Cascading Style Sheets
this portion corresponds to values lower than the value currently selected by the thumb (i.e., virtual knob). note: using ::-moz-range-progress with anything but an <input type="range"> doesn't match anything and has no effect. ...
@viewport - CSS: Cascading Style Sheets
the @viewport css at-rule lets you configure the viewport through which the document is viewed. it's primarily used for mobile devices, but is also used by desktop browsers that support features like "snap to edge" (such as microsoft edge). lengths specified as percentages are calculated relative to the initial viewport, which is the viewport before any user agent or authored styles have had an opportunity to adjust the viewport. this is typically based on the size of the window on desktop browsers that aren't in full screen mode. ...
Coordinate systems - CSS: Cascading Style Sheets
0</span> </p> <p> screen-relative: <span id="screenx">0</span>, <span id="screeny">0</span> </p> </div> </div> </div> css the css is pretty much just for appearances here. the class "outer" is used for the containing box, which is intentionally too wide to show in the mdn window, to allow you to scroll it horizontally. the "inner" box is the one that we
track events in and in which we show the mouse coordinates. .outer { width: 1000px; height: 200px; background-color: red; } .inner { position: relative; width: 500px; height: 150px; top: 25px; left: 100px; background-color: blue; color: white; cursor: crosshair; user-select: none; -moz-user-select: none; -ms-user-select: none; -webkit-user-select: none; } .log { posit...
Using feature queries - CSS: Cascading Style Sheets
lay property. once a floated item becomes a grid item, the float is removed — something you can read more about in supporting older browsers. therefore the grid version should just overwrite the floated one. we have a problem however, caused by the width property we used on our floated items to make them display as three columns. this is now interpreted by grid as being the width of the column
track, not the width of the container as it is for the float. what we need is a way to remove the width if display: grid is supported. this is exactly the situation feature queries solve. we can set the width back to auto if grid is supported. in the above scenario, it doesn't matter that ie11 doesn't support feature queries or css grid — it would get the floated version anyway, which is then o...
Relationship of flexbox to other layout methods - CSS: Cascading Style Sheets
n space is distributed flexbox does not look at the placement of items in other rows and tries to line things up with each other. if we create a very similar layout using grid, we can control the layout in both rows and columns. these examples point to another key difference between these layout methods. in grid layout you do the majority of sizing specification on the container, setting up
tracks and then placing items into them. in flexbox, while you create a flex container and set the direction at that level, any control over item sizing needs to happen on the items themselves. in some cases you could happily use either layout method, but as you become confident with both you will find each one suiting different layout needs, and you will end up with both methods in your css. there is...
CSS Grid Layout and Progressive Enhancement - CSS: Cascading Style Sheets
onstrates the typical problem that we have with floated layouts: if additional content is added to any one card, the layout breaks. as a concession for older browsers, i have set a min-height on the items, and hope that my content editors won’t add too much content and make a mess of the layout! i then enhance the layout using grid. i can turn my <ul> into a grid container with three column
tracks. however, the width i have assigned to the list items themselves still applies, and it now makes those items a third of the width of the
track: if i reset the width to auto, then this will stop the float behavior happening for older browsers. i need to be able to define the width for older browsers, and remove the width for grid supporting browsers. thanks to css feature queries i can do this...
CSS Scrollbars - CSS: Cascading Style Sheets
.scroller { width: 300px; height: 100px; overflow-y: scroll; scrollbar-color: rebeccapurple green; scrollbar-width: thin; } html <div class="scroller"> veggies es bonus vobis, proinde vos postulo essum magis kohlrabi welsh onion daikon amaranth tatsoi tomatillo melon azuki bean garlic. gumbo beet greens corn soko endive gumbo gourd. ...
Grid wrapper - CSS: Cascading Style Sheets
nt within a central wrapper, while also allowing items to break out and align to the edge of the containing element or page when desired. requirements items placed on the grid should be able to align to a horizontally-centered max-width wrapper and/or the outer edges of the grid. recipe download this example choices made this recipe uses the css grid minmax() function to define the grid
track sizes in the grid-template-columns property. for the central columns with a maximum width we can set a minimum value of 0 or greater and a maximum value that specifies the maximum size the column
tracks will grow to. using a numeric unit (pixels, ems, rems) will create a fixed maximum size for the central wrapper, whereas using percentage values or viewport units will mean this wrapper grows or s...
Sticky footers - CSS: Cascading Style Sheets
container. choices made in the above example we achieve the sticky footer using css grid layout. the .wrapper has a minimum height of 100% which means it is as tall as the container it is in. we then create a single column grid layout with three rows, one row for each part of our layout. grid auto-placement will place our items in source order and so the header goes into the first auto sized
track, the main content into the 1fr
track and the footer into the final auto sized
track. the 1fr
track will take up all available space and so grows to fill the gap. alternate method if you need compatibility with browsers that do not support grid layout you can also use flexbox to create a sticky footer. the flexbox example starts out in the same way, but we use display:flex rather than display...
appearance (-moz-appearance, -webkit-appearance) - CSS: Cascading Style Sheets
al div { color: black; -moz-appearance: scrollbarthumb-horizontal; -webkit-appearance: scrollbarthumb-horizontal; } <div>lorem</div> firefox scrollbarthumb-vertical div { color: black; -moz-appearance: scrollbarthumb-vertical; -webkit-appearance: scrollbarthumb-vertical; } <div>lorem</div> firefox scrollbar
track-horizontal div { color: black; -moz-appearance: scrollbar
track-horizontal; -webkit-appearance: scrollbar
track-horizontal; } <div>lorem</div> firefox scrollbar
track-vertical div { color: black; -moz-appearance: scrollbar
track-vertical; -webkit-appearance: scrollbarbar
track-vertical; } <div>lorem</div> firefox ...
grid-auto-flow - CSS: Cascading Style Sheets
rn, adding new columns as necessary. dense "dense" packing algorithm attempts to fill in holes earlier in the grid, if smaller items come up later. this may cause items to appear out-of-order, when doing so would fill in holes left by larger items. if it is omitted, a "sparse" algorithm is used, where the placement algorithm only ever moves "forward" in the grid when placing items, never back
tracking to fill holes. this ensures that all of the auto-placed items appear "in order", even if this leaves holes that could have been filled by later items. formal definition initial valuerowapplies togrid containersinheritednocomputed valueas specifiedanimation typediscrete formal syntax [ row | column ] | dense examples setting grid auto-placement html <div id="grid"> <div id="item1">...
CSS: Cascading Style Sheets
the different ways layout specifications can be used, and the choices you can make as a developer. tools for css development you can use the w3c css validation service to check if your css is valid. this is an invaluable debugging tool. firefox developer tools lets you view and edit a page's live css via the inspector and style editor tools. the web developer extension for firefox lets you
track and edit live css on watched sites. the web community has created various other miscellaneous css tools for you to use. meta bugs firefox: bug 1323667 ...
Event reference
s closed. fullscreen addons specific browser fullscreen mode has been toggled. sizemodechange addons specific window has entered/left fullscreen mode, or has been minimized/unminimized. mozentereddomfullscreen addons specific dom fullscreen mode has been entered. sswindowclosing addons specific the session store will stop
tracking this window. sstabclosing addons specific the session store will stop
tracking this tab. sstabrestoring addons specific a tab is about to be restored. sstabrestored addons specific a tab has been restored. sswindowstateready addons specific a window state has switched to "ready". sswindowstatebusy addon...
Cross-browser audio basics - Developer guides
autoplay attribute has caused playback to begin. this is when the state of the media switches from paused to playing. pause the pause event is triggered after the pause() method is returned. this is when the states switch from playing to paused. ended the ended event is initiated when the end of the media is reached. myaudio.addeventlistener("ended", function() { //do something once audio
track has finished playing }); volumechange the volumechange event signifies that the volume has changed; that includes being muted. an audio player with feedback consider this snippet of html: <audio id="my-audio"> <source src="https://udn.realityripple.com/samples/6c/d385042de2.mp3" type="audio/mpeg"> <source src="https://udn.realityripple.com/samples/28/191a7bd2a5.ogg" type="audio/ogg"> <...
Setting up adaptive streaming media sources - Developer guides
its earliest presentation time and other meta-data and can often make up a large portion of the mpd file. ondemand profile this profile will allow switching between streams 'on demand' - that is to say that you only need provide a set of contiguous files and specify the bandwidth for each one and the appropriate file will be chosen automatically. here's a simple example that provides an audio
track representation and four separate video representations. <?xml version="1.0" encoding="utf-8"?> <mpd xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns="urn:mpeg:dash:schema:mpd:2011" xsi:schemalocation="urn:mpeg:dash:schema:mpd:2011 dash-mpd.xsd" type="static" mediapresentationduration="pt654s" minbuffertime="pt2s" profiles="urn:mpeg:dash:profile:isoff-on-demand:2011"> <b...
Web Audio playbackRate explained - Developer guides
fox 20+ ✔ ie 9+ ✔ safari 6+ ✔ opera 15+ ✔ mobile chrome (android) ✖ mobile firefox 24+ ✔ ie mobile ✖ mobile safari 6+ (ios) ✔ opera mobile ✖ notes most browsers stop playing audio outside playbackrate bounds of 0.5 and 4, leaving the video playing silently. for most applications, it's recommended that you limit the range to between 0.5 and 4. the pitch of the audio
track does not change when playbackrate is altered. negative values will not cause the media to play in reverse. ie9+ switches to the default playback rate when an ended event is fired. firefox generates a ratechange event when the media source is substituted. on ios 7 you can only affect the playbackrate when the media is paused (not while it's playing). see also hyperaudio's playback rate ...
Audio and video manipulation - Developer guides
laybackrate aside, to manipulate audio you'll typically use the web audio api. selecting an audio source the web audio api can receive audio from a variety of sources, then process it and send it back out to an audiodestinationnode representing the output device to which the sound is sent after processing. if the audio source is... use this web audio node type an audio
track from an html <audio> or <video> element mediaelementaudiosourcenode a plain raw audio data buffer in memory audiobuffersourcenode an oscillator generating a sine wave or other computed waveform oscillatornode an audio
track from webrtc (such as the microphone input you can get using getusermedia(). mediastreamaudiosourcenode audio filters the web aud...
Event developer guide - Developer guides
t handlers.media eventsvarious events are sent when handling media that are embedded in html documents using the <audio> and <video> elements; this section lists them and provides some helpful information about using them.mouse gesture eventsgecko 1.9.1 added support for several mozilla-specific dom events used to handle mouse gestures. these are special movements that can be made with a mouse or
trackpad and can be interpreted to perform specific tasks.mutation eventsmutation events provide a mechanism for a web page or an extension to get notified about changes made to the dom. use mutation observers instead if possible. orientation and motion data explainedwhen using orientation and motion events, it's important to understand what the values you're given by the browser mean. this article...
HTML5 - Developer guides
attribute. there also is filereader. multimedia using html5 audio and video the <audio> and <video> elements embed and allow the manipulation of new multimedia content. webrtc this technology, where rtc stands for real-time communication, allows connecting to other people and controlling videoconferencing directly in the browser, without the need for a plugin or an external application.
track and webvtt the <
track> element allows subtitles and chapters. webvtt is a text
track format. 2d/3d graphics and effects canvas tutorial learn about the new <canvas> element and how to draw graphs and other objects in firefox. html5 text api for <canvas> elements the html5 text api is now supported by <canvas> elements. webgl webgl brings 3d graphics to the web by introducing an api tha...
User input and controls - Developer guides
note: you can find more information in the mdn drag & drop documentation. contenteditable in open web apps any dom element can be made directly editable using the contenteditable attribute. <div contenteditable="true">
this text can be edited by the user. </div> note: compatibility information, examples and other resources can be found in the content editable guide. examples
tracking multiple touch points at a time this example
tracks multiple touch points at a time, allowing the user to draw in a <canvas> with more than one finger at a time. it will only work on a browser that supports touch events. simple pointer lock demo we've written a simple pointer lock demo to show you how to use it to set up a simple control system. the demo uses javascript to draw a ball insid...
Writing forward-compatible websites - Developer guides
to target workarounds for bug y. for the purpose of this piece of advice, "current" means the most recent version of a browser you have tested, as in the case of the ua sniffing advice above. avoid depending on cutting-edge nonstandard features even if the feature is prefixed, using it could be dangerous: as the specification evolves the browser's prefixed implementation can likewise change to
track the specification. and once the feature is standardized, the prefixed version is likely to be removed. prefixed, non-standard features are provided by browser developers for you to experiment with and offer feedback on, and aren't meant to be deployed. if you choose to use them, be prepared to need to frequently update your site to keep up with changes. when using cutting-edge features (even st...
<a>: The Anchor element - HTML: Hypertext Markup Language
rls while web browsers may not support other url schemes, web sites can with registerprotocolhandler() hreflang hints at the human language of the linked url. no built-in functionality. allowed values are the same as the global lang attribute. ping a space-separated list of urls. when the link is followed, the browser will send post requests with the body ping to the urls. typically for
tracking. referrerpolicy how much of the referrer to send when following the link. see referrer-policy for possible values and their effects. rel the relationship of the linked url as space-separated link types. target where to display the linked url, as the name for a browsing context (a tab, window, or <iframe>). the following keywords have special meanings for where to load the url: _self...
<area> - HTML: Hypertext Markup Language
o, the <area> element does not represent a hyperlink. hreflang indicates the language of the linked resource. allowed values are determined by bcp47. use this attribute only if the href attribute is present. ping contains a space-separated list of urls to which, when the hyperlink is followed, post requests with the body ping will be sent by the browser (in the background). typically used for
tracking. referrerpolicy a string indicating which referrer to use when fetching the resource: "no-referrer" meaning that the referer: header will not be sent. "no-referrer-when-downgrade" meaning that no referer: header will be sent when navigating to an origin without tls (https). this is a user agent’s default behavior, if no policy is otherwise specified. "origin" meaning that the ref...
<del>: The Deleted Text element - HTML: Hypertext Markup Language
the <ins> element can be used for the opposite purpose: to indicate text that has been added to the document. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. this element is often (but need not be) rendered by applying a strike-through style to the text. ...
<input type="checkbox"> - HTML: Hypertext Markup Language
h are also checkboxes). if all of the sub-options are checked, the owning checkbox is also checked, and if they're all unchecked, the owning checkbox is unchecked. if any one or more of the sub-options have a different state than the others, the owning checkbox is in the indeterminate state. this can be seen in the below example (thanks to css tricks for the inspiration). in this example we keep
track of the ingredients we are collecting for a recipe. when you check or uncheck an ingredient's checkbox, a javascript function checks the total number of checked ingredients: if none are checked, the recipe name's checkbox is set to unchecked. if one or two are checked, the recipe name's checkbox is set to indeterminate. if all three are checked, the recipe name's checkbox is set to checked. ...
<link>: The External Resource Link element - HTML: Hypertext Markup Language
link> to contain the crossorigin attribute. font css @font-face image <img> and <picture> elements with srcset or imageset attributes, svg <image> elements, css *-image rules object <object> elements script <script> elements, worker importscripts style <link rel=stylesheet> elements, css @import
track <
track> elements video <video> elements worker worker, sharedworker crossorigin this enumerated attribute indicates whether cors must be used when fetching the resource. cors-enabled images can be reused in the <canvas> element without being tainted. the allowed values are: anonymous a cross-origin request (i.e. with an origin http header) is...
<source>: The Media or Image Source element - HTML: Hypertext Markup Language
es project, please clone https://github.com/mdn/interactive-examples and send us a pull request. content categories none. permitted content none, it is an empty element. tag omission it must have a start tag, but must not have an end tag. permitted parents a media element—<audio> or <video>—and it must be placed before any flow content or <
track> element. a <picture> element, and it must be placed before the <img> element. implicit aria role no corresponding role permitted aria roles no role permitted dom interface htmlsourceelement attributes this element includes the global attributes. media media query of the resource's intended media; this should be used only in a <picture> elem...
HTML elements reference - HTML: Hypertext Markup Language
sources, represented using the src attribute or the <source> element: the browser will choose the most suitable one. it can also be the destination for streamed media, using a mediastream. <img> the html <img> element embeds an image into the document. <map> the html <map> element is used with <area> elements to define an image map (a clickable link area). <
track> the html <
track> element is used as a child of the media elements, <audio> and <video>. it lets you specify timed text
tracks (or time-based data), for example to automatically handle subtitles. <video> the html video element (<video>) embeds a media player which supports video playback into the document. you can use <video> for audio content as well, but the <audio> element may...
x-ms-acceleratorkey - HTML: Hypertext Markup Language
do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. the x-ms-acceleratorkey attribute accessibly declares that an accelerator key has been assigned to an element: the element is activated via javascript when the key(s) are pressed on a keyboard. this proprietary property is specific to internet explorer and microsoft edge. ...
Preloading content with rel="preload" - HTML: Hypertext Markup Language
in <audio>. document: an html document intended to be embedded by a <frame> or <iframe>. embed: a resource to be embedded inside an <embed> element. fetch: resource to be accessed by a fetch or xhr request, such as an arraybuffer or json file. font: font file. image: image file. object: a resource to be embedded inside an <object> element. script: javascript file. style: css stylesheet.
track: webvtt file. worker: a javascript web worker or shared worker. video: video file, as typically used in <video>. note: there's more detail about these values and the web features they expect to be consumed by in the preload spec — see link element extensions. also note that the full list of values the as attribute can take is governed by the fetch spec — see request destinations. inclu...
Common MIME types - HTTP
icalendar format text/calendar .jar java archive (jar) application/java-archive .jpeg .jpg jpeg images image/jpeg .js javascript text/javascript, per the following specifications: https://html.spec.whatwg.org/multipage/#scriptinglanguages https://html.spec.whatwg.org/multipage/#dependencies:willful-violation https://data
tracker.ietf.org/doc/draft-ietf-dispatch-javascript-mjs/ .json json format application/json .jsonld json-ld format application/ld+json .mid .midi musical instrument digital interface (midi) audio/midi audio/x-midi .mjs javascript module text/javascript .mp3 mp3 audio audio/mpeg .mpeg mpeg video video/...
Resource URLs - HTTP
do not use it on production sites facing the web: it will not work for every user. there may also be large incompatibilities between implementations and the behavior may change in the future. resource urls, urls prefixed with the resource: scheme, are used by firefox and firefox browser extensions to load resources internally, but some of the information is available to sites the browser connects to as well. ...
Browser detection using the user agent - HTTP
do it. are you trying to work around a specific bug in some version of a browser? look, or ask, in specialized forums: you're unlikely to be the first to hit this problem. also, experts, or simply people with another point of view, can give you ideas for working around the bug. if the problem seems uncommon, it's worth checking if this bug has been reported to the browser vendor via their bug
tracking system (mozilla; webkit; blink; opera). browser makers do pay attention to bug reports, and the analysis may hint about other workarounds for the bug. are you trying to check for the existence of a specific feature? your site needs to use a specific web feature that some browsers don't yet support, and you want to send those users to an older web site with fewer features but that you know wi...
Configuring servers for Ogg media - HTTP
l any plug-ins or other software to do so. this guide covers a few server configuration changes that may be necessary for your web server to correctly serve ogg media files. this information may also be useful if you encounter other media types your server isn't already configured to recognize. serve media with the correct mime type *.ogg and *.ogv files containing video (possibly with an audio
track as well, of course), should be served with the video/ogg mime type. *.oga and *.ogg files containing only audio should be served with the audio/ogg mime type. if you don't know whether the ogg file contains audio or video, you can serve it with the mime type application/ogg, and the browser will treat it as a video file. most servers don't by default serve ogg media with the correct mime types,...
CSP: media-src - HTTP
tags and note that capitalization and whitespace matter, including leading or trailing whitespace. see unsafe inline script for an example. in csp 2.0 this applied only to inline scripts. csp 3.0 allows it in the case of script-src for external scripts. examples violation cases given this csp header: content-security-policy: media-src https://example.com/ the following <audio>, <video> and <
track> elements are blocked and won't load: <audio src="https://not-example.com/audio"></audio> <video src="https://not-example.com/video"> <
track kind="subtitles" src="https://not-example.com/subtitles"> </video> specifications specification status comment content security policy level 3the definition of 'media-src' in that specification. working draft no change...
Content-Security-Policy - HTTP
nt-src specifies valid sources for fonts loaded using @font-face. frame-src specifies valid sources for nested browsing contexts loading using elements such as <frame> and <iframe>. img-src specifies valid sources of images and favicons. manifest-src specifies valid sources of application manifest files. media-src specifies valid sources for loading media using the <audio> , <video> and <
track> elements. object-src specifies valid sources for the <object>, <embed>, and <applet> elements. elements controlled by object-src are perhaps coincidentally considered legacy html elements and are not receiving new standardized features (such as the security attributes sandbox or allow for <iframe>). therefore it is recommended to restrict this fetch-directive (e.g., explicitly set object-src ...
ETag - HTTP
esponse if the content has not changed. additionally, etags help prevent simultaneous updates of a resource from overwriting each other ("mid-air collisions"). if the resource at a given url changes, a new etag value must be generated. a comparison of them can determine whether two representations of a resource are the same. etags are therefore similar to fingerprints, and might also be used for
tracking purposes by some servers. they might also be set to persist indefinitely by a
tracking server. header type response header forbidden header name no syntax etag: w/"<etag_value>" etag: "<etag_value>" directives w/ optional 'w/' (case-sensitive) indicates that a weak validator is used. weak etags are easy to generate, but are far less useful for comparisons...
Feature-Policy - HTTP
mode. screen-wake-lock controls whether the current document is allowed to use screen wake lock api to indicate that device should not turn off or dim the screen. web-share controls whether or not the current document is allowed to use the navigator.share() of web share api to share text, links, images, and other content to arbitrary destiations of user's choice, e.g. mobile apps. xr-spatial-
tracking controls whether or not the current document is allowed to use the webxr device api to interact with a webxr session. example securecorp inc. wants to disable microphone and geolocation apis in its application. it can do so by delivering the following http response header to define a feature policy: feature-policy: microphone 'none'; geolocation 'none' by specifying the 'none' keyword fo...
Sec-Fetch-Dest - HTTP
audio sec-fetch-dest: audioworklet sec-fetch-dest: document sec-fetch-dest: embed sec-fetch-dest: empty sec-fetch-dest: font sec-fetch-dest: image sec-fetch-dest: manifest sec-fetch-dest: nested-document sec-fetch-dest: object sec-fetch-dest: paintworklet sec-fetch-dest: report sec-fetch-dest: script sec-fetch-dest: serviceworker sec-fetch-dest: sharedworker sec-fetch-dest: style sec-fetch-dest:
track sec-fetch-dest: video sec-fetch-dest: worker sec-fetch-dest: xslt sec-fetch-dest: audioworklet sec-fetch-dest: audioworklet values audio audioworklet document embed empty font image manifest object paintworklet report script serviceworker sharedworker style
track video worker xslt nested-document examples todo specifications ...
Via - HTTP
header type general header forbidden header name yes syntax via: [ <protocol-name> "/" ] <protocol-version> <host> [ ":" <port> ] or via: [ <protocol-name> "/" ] <protocol-version> <pseudonym> directives <protocol-name> optional. the name of the protocol used, such as "http". ...
Link prefetching FAQ - HTTP
from a different host? yes. there is no same-origin restriction for link prefetching. limiting prefetching to only urls from the the same server would not offer any increased browser security. do prefetched requests contain a referer: header? yes, prefetched requests include a http referer: header indicating the document from which the prefetching hint was extracted. this may impact referrer
tracking that is commonly used on many sites. for this reason, link prefetching may not be appropriate for all content. however, it is possible to instruct mozilla to validate a prefetched document when the user follows a href to the prefetched document by specifying the cache-control: must-revalidate http response header. this header enables caching, but requires an if-modified-since or if-none-match ...
Iterators and generators - JavaScript
onsumed only as necessary. because of this, iterators can express sequences of unlimited size, such as the range of integers between 0 and infinity. here is an example which can do just that. it allows creation of a simple range iterator which defines a sequence of integers from start (inclusive) to end (exclusive) spaced step apart. its final return value is the size of the sequence it created,
tracked by the variable iterationcount. function makerangeiterator(start = 0, end = infinity, step = 1) { let nextindex = start; let iterationcount = 0; const rangeiterator = { next: function() { let result; if (nextindex < end) { result = { value: nextindex, done: false } nextindex += step; iterationcount++; ...
JavaScript technologies overview - JavaScript
ecmascript language specification, also standardized by ecma tc39. the internationalization api provides collation (string comparison), number formatting, and date-and-time formatting for javascript applications, letting the applications choose the language and tailor the functionality to their needs. the initial standard was approved in december 2012; the status of implementations in browsers is
tracked in the documentation of the intl object. the internationalization specification is nowadays also ratified on a yearly basis and browsers constantly improve their implementation. dom apis webidl the webidl specification provides the glue between the dom technologies and ecmascript. the core of the dom the document object model (dom) is a cross-platform, language-independent convention for r...
JavaScript language resources - JavaScript
2017 ecmascript 2017 internationalization api specification es.next is a dynamic name that refers to whatever the next version is at the time of writing. es.next features are more correctly called proposals, because, by definition, the specification has not been finalized yet. see wikipedia ecmascript entry for more information on ecmascript history. you can participate in or just
track the work on the next revisions of the ecmascript language specification, code-named "harmony", and the ecmascript internationalization api specification via public wiki and the es-discuss mailing list linked from ecmascript.org. implementations spidermonkey - the javascript engine used in various mozilla products, including firefox; rhino - the javascript engine is written in java; tamarin ...
JSON.stringify() - JavaScript
ng the replacer function on each property. note: you cannot use the replacer function to remove values from an array. if you return undefined or a function then null is used instead. note: if you wish the replacer to distinguish an initial object from a key with an empty string property (since both would give the empty string as key and potentially an object as value), you will have to keep
track of the iteration count (if it is beyond the first iteration, it is a genuine empty string key). example replacer, as a function function replacer(key, value) { // filtering out properties if (typeof value === 'string') { return undefined; } return value; } var foo = {foundation: 'mozilla', model: 'box', week: 45, transport: 'car', month: 7}; json.stringify(foo, replacer); // '{"we...
Strict mode - JavaScript
;"); second, strict mode code doesn't alias properties of arguments objects created within it. in normal code within a function whose first argument is arg, setting arg also sets arguments[0], and vice versa (unless no arguments were provided or arguments[0] is deleted). arguments objects for strict mode functions store the original arguments when the function was invoked. arguments[i] does not
track the value of the corresponding named argument, nor does a named argument
track the value in the corresponding arguments[i]. function f(a) { 'use strict'; a = 42; return [a, arguments[0]]; } var pair = f(17); console.assert(pair[0] === 42); console.assert(pair[1] === 17); third, arguments.callee is no longer supported. in normal code arguments.callee refers to the enclosing function. this...
Image file type and format guide - Web media technologies
t introduced by mozilla which extends the png standard to add support for animated images. conceptually similar to the animated gif format which has been in use for decades, apng is more capable in that it supports a variety of color depths, whereas animated gif supports only 8-bit indexed color. apng is ideal for basic animations that do not need to synchronize to other activities or to a sound
track, such as progress indicators, activity throbbers, and other animated sequences. for example, apng is one of the formats supported when creating animated stickers for apple's imessage application (and the messages application on ios). they're also commonly used for the animated portions of web browsers' user interfaces. mime type image/apng file extension(s) .apng ...
Media type and format guide: image, audio, and video content - Web media technologies
in common media types when specifying the mime type describing a media format, you can provide details using the codecs parameter as part of the type string. this guide describes the format and possible values of the codecs parameter for the common media types. codecs used by webrtc webrtc doesn't use a container, but instead streams the encoded media itself from peer to peer using mediastream
track objects to represent each audio or video
track. this guide discusses the codecs commonly used with webrtc. guides concepts digital audio concepts an introduction to how audio is converted into digital form and stored for use by computers. it explains basic concepts about how audio is sampled, as well as concepts such as sample rate, audio frames, and audio compression. digital video con...
Web media technologies
cts. <video> the <video> element is an endpoint for video content in a web context. it can be used to simply present video files, or as a destination for streamed video content. <video> can also be used as a way to link media apis with other html and dom technologies, including <canvas> (for frame grabbing and manipulation), for example. accessible from javascript as htmlvideoelement objects. <
track> the html <
track> element can be placed within an <audio> or <video> element to provide a reference to a webvtt format subtitle or caption
track to be used when playing the media. accessible from javascript as html
trackelement objects. <source> the html <source> element is used within an <audio> or <video> element to specify source media to present. multiple sources can be used to provide the ...
Web Performance
third-party scripts, you can drastically improve the user experience. this article looks in detail at how html can be used to ensure maximum performance. multimedia: images and video the lowest hanging fruit of web performance is often media optimization. serving different media files based on each user agent's capability, size, and pixel density is possible. additional tips like removing audio
tracks from background videos can improve performance even further. in this article we discuss the impact video, audio, and image content has on performance, and the methods to ensure that impact is as minimal as possible. css performance features css may be a less important optimization focus for improved performance, but there are some css features that impact performance more than others. in this ...
Privacy, permissions, and information security
users' personal information or imagery being obtained unexpectedly by third parties. security and privacy defined before we go into any depth about the various security and privacy features available to users on the web, let's define some important terms. personally identifiable information personally identifiable information (pii) is information which can be used, in whole or in part, to
track down and/or identify a specific person. as such, pii extends beyond the web to all aspects of life. for example, if a site leaks a list of users' names and zip codes online, a bad actor could almost certainly
track down at least some percentage of those users by simply using the corresponding phone books. personally identification can include information like usernames, real names, passwords, p...
<a> - SVG: Scalable Vector Graphics
points to. value type: <url> ; default value: none; animatable: yes hreflang the human language of the url or url fragment that the hyperlink points to. value type: <string> ; default value: none; animatable: yes ping a space-separated list of urls to which, when the hyperlink is followed, post requests with the body ping will be sent by the browser (in the background). typically used for
tracking. for a more widely-supported feature addressing the same use cases, see navigator.sendbeacon(). value type: <list-of-urls> ; default value: none; animatable: no referrerpolicy which referrer to send when fetching the url. value type: no-referrer|no-referrer-when-downgrade|same-origin|origin|strict-origin|origin-when-cross-origin|strict-origin-when-cross-origin|unsafe-url ; default value:...
SVG 2 support in Mozilla - SVG: Scalable Vector Graphics
path measured in text elements coordinate system implementation status unknown embedded content change notes <video> implementation status unknown <audio> implementation status unknown <iframe> implementation status unknown <canvas> implementation status unknown <source> implementation status unknown <
track> implementation status unknown painting change notes paint-order implemented (bug 828805) will-change instead of buffered-rendering implementation status unknown context-fill and context-stroke paint values implemented (bug 719286 (firefox 18.0 / thunderbird 18.0 / seamonkey 2.15) and bug 798843 (firefox 26.0 / thunderbird 26.0 / seam...
Referer header: privacy and security concerns - Web security
th the referer http header. this article describes them, and offers advice on mitigating those risks. the referrer problem the referer (sic) header contains the address of the previous web page from which a link to the currently requested page was followed, which has lots of fairly innocent uses including analytics, logging, or optimized caching. however, there are more problematic uses such as
tracking or stealing information, or even just side effects such as inadvertently leaking sensitive information. for example, consider a "reset password" page with a social media link in a footer. if the link was followed, depending on how information was shared the social media site may receive the reset password url and may still be able to use the shared information, potentially compromising a user...