gecko/dom/interfaces/html/nsIDOMHTMLAudioElement.idl
Ralph Giles f63a794f44 Bug 763010 - Expose media element metadata. r=cpearce
Implements a media.mozGetMetadata() method returning a new javascript object whose properties are key value pairs respresenting metadata tags from the media resource. This data is available after readystate enters METADATA_LOADED.

Currently this is only implemented for Ogg Vorbis streams.

Media format metadata is parsed out by the media decoders. In the nsCodecStateMachine::ReadMetadata subclasses we fill in an nsDataHashtable pointer using the format-specifc api.

The hash pointer is passed up to the media element as part of the MetadataLoaded event.

The hash is deleted if the load is aborted. The audio metadata is also reset to zero (as in the constructor), resolving a todo comment.
2012-07-30 20:14:29 -04:00

37 lines
1.1 KiB
Plaintext

/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsIDOMHTMLMediaElement.idl"
%{C++
#include "jsapi.h"
%}
/**
* The nsIDOMHTMLAudioElement interface is the interface to a HTML
* <audio> element.
*
* For more information on this interface, please see
* http://www.whatwg.org/specs/web-apps/current-work/#audio
*
* @status UNDER_DEVELOPMENT
*/
[scriptable, uuid(5fb3bed5-e9da-49ef-8488-ee3304db1a09)]
interface nsIDOMHTMLAudioElement : nsIDOMHTMLMediaElement
{
// Setup the audio stream for writing
void mozSetup(in PRUint32 channels, in PRUint32 rate);
// Write audio to the audio stream
[implicit_jscontext]
unsigned long mozWriteAudio(in jsval data);
// Get the current offset (measured in samples since the start) of the audio
// stream created using mozWriteAudio().
unsigned long long mozCurrentSampleOffset();
};