browser - Vaadin audio element doesn't work when I use it to play .m4a sound files (Vaadin 7.3.2) -
browser - Vaadin audio element doesn't work when I use it to play .m4a sound files (Vaadin 7.3.2) -
i utilize display html5 sound in 1 of vaadin application. when requst info in browser, , save file, can played - fails so, when seek in vaadin.
can point out, doing wrong?
public class audioarea extends sound { public audioarea(final int soundid) { super(); streamresource resource = new streamresource( new streamresource.streamsource() { public inputstream getstream() { byte[] info = myvaadinui.request.getbinarydata( soundid, binarydatasource.type_sound, 0, 0); if (data == null) { homecoming null; } homecoming new bytearrayinputstream(data); } }, ""); setsource(resource); markasdirty(); } }
are sure browser supports format? if seek plain html can play it? if browser supports format, suggest this:
audio sound = new audio("myaudio"); audio.setsource(new themeresource("audio/myaudio.m4a")); mylayout.addcomponent(audio);
and set file under theme folder (or can utilize fileresource
instead).
edit
maybe missing mime type problem:
streamresource resource = new streamresource( new streamresource.streamsource() { public inputstream getstream() { byte[] info = myvaadinui.request.getbinarydata( soundid, binarydatasource.type_sound, 0, 0); if (data == null) { homecoming null; } homecoming new bytearrayinputstream(data); } }, "") { @override public string getmimetype() { homecoming "audio/mp4"; } };
audio browser vaadin m4a
Comments
Post a Comment