Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(211)

Unified Diff: sdk/lib/web_audio/dart2js/web_audio_dart2js.dart

Issue 11443002: Revert "Moving AudioElement back to dart:html" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/svg/dartium/svg_dartium.dart ('k') | sdk/lib/web_audio/dartium/web_audio_dartium.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/web_audio/dart2js/web_audio_dart2js.dart
diff --git a/sdk/lib/web_audio/dart2js/web_audio_dart2js.dart b/sdk/lib/web_audio/dart2js/web_audio_dart2js.dart
index dbaef0078d81ae42b9b5cc79086d2b7df46e7e33..4a50eba14600d9594afddba9103ce2490e845eb2 100644
--- a/sdk/lib/web_audio/dart2js/web_audio_dart2js.dart
+++ b/sdk/lib/web_audio/dart2js/web_audio_dart2js.dart
@@ -268,6 +268,21 @@ class AudioDestinationNode extends AudioNode native "*AudioDestinationNode" {
// BSD-style license that can be found in the LICENSE file.
+/// @domName HTMLAudioElement; @docsEditable true
+class AudioElement extends MediaElement native "*HTMLAudioElement" {
+
+ factory AudioElement([String src]) {
+ if (!?src) {
+ return _AudioElementFactoryProvider.createAudioElement();
+ }
+ return _AudioElementFactoryProvider.createAudioElement(src);
+ }
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+
/// @domName AudioGain; @docsEditable true
class AudioGain extends AudioParam native "*AudioGain" {
}
@@ -676,6 +691,9 @@ class WaveShaperNode extends AudioNode native "*WaveShaperNode" {
// BSD-style license that can be found in the LICENSE file.
-/// @domName WaveTable; @docsEditable true
-class WaveTable native "*WaveTable" {
+class _AudioElementFactoryProvider {
+ static AudioElement createAudioElement([String src = null]) {
+ if (src == null) return JS('AudioElement', 'new Audio()');
+ return JS('AudioElement', 'new Audio(#)', src);
+ }
}
« no previous file with comments | « sdk/lib/svg/dartium/svg_dartium.dart ('k') | sdk/lib/web_audio/dartium/web_audio_dartium.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698