New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[next] AudioElement not playing from file blobs in dartium, dart2js/chrome is ok #16904
Comments
Removed Area-HTML label. |
Still true in 1.8. Might be fixed with the next rev. Removed Priority-Unassigned label. |
Still wrong in 1.12. Simplified test case:
|
@tomyeh I think this is a known issue. Dartium is based on Chromium – which is 100% open source. I think you need special licenses to play mp3. If you see the pop-pop-win sample – https://github.com/dart-lang/sample-pop_pop_win – it has both m43 and ogg audio. The ogg audio (which is open/free) works great in Dartium. |
Great! Thanks for the information. |
OK, so that sounds like this is working as intended. Or at least as well as it can work in a Chromium-based browser. |
This issue was originally filed by greg....@gmail.com
The following code correctly displays/plays images, video, and audio in chrome 33 when compiled with dart2js.
In Dartium 31 images and video work, but audio files do not load.
Tested on Ubuntu.
import 'dart:html';
void main() {
document.body.append(new FileUploadInputElement()
..text = 'Open'
..onChange.listen(open));
}
void open(event) {
FileUploadInputElement element = event.target;
if (element.files.isNotEmpty) {
var file = element.files.first;
var url = Url.createObjectUrl(file);
if (file.type.startsWith('image'))
document.body.append(new ImageElement(src: url, width: 100));
else if (file.type.startsWith('video'))
document.body.append(new VideoElement()
..src = url
..controls = true);
else if (file.type.startsWith('audio'))
document.body.append(new AudioElement()
..src = url
..controls = true);
else
document.body.append(new Text('Unsupported file type: ${file.type}'));
}
}
The text was updated successfully, but these errors were encountered: