Skip to content
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

Closed
DartBot opened this issue Feb 18, 2014 · 7 comments
Closed
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-html

Comments

@DartBot
Copy link

DartBot commented Feb 18, 2014

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}'));
  }
}

@kevmoo
Copy link
Member

kevmoo commented Feb 18, 2014

Added Area-HTML, Triaged labels.

@kevmoo
Copy link
Member

kevmoo commented Apr 7, 2014

Removed Area-HTML label.
Added Area-Library, Library-Html labels.

@alan-knight
Copy link
Contributor

Still true in 1.8. Might be fixed with the next rev.


Removed Priority-Unassigned label.
Added Priority-Medium label.
Changed the title to: "[next] AudioElement not playing from file blobs in dartium, dart2js/chrome is ok".

@DartBot DartBot added Type-Defect area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-html labels Jan 16, 2015
@tomyeh
Copy link

tomyeh commented Dec 4, 2015

Still wrong in 1.12. Simplified test case:

new AudioElement("foo.mp3").play();

@kevmoo
Copy link
Member

kevmoo commented Dec 4, 2015

@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.

@tomyeh
Copy link

tomyeh commented Dec 5, 2015

Great! Thanks for the information.

@alan-knight
Copy link
Contributor

OK, so that sounds like this is working as intended. Or at least as well as it can work in a Chromium-based browser.

@kevmoo kevmoo removed the triaged label Mar 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-html
Projects
None yet
Development

No branches or pull requests

4 participants