Hi,
Using Vaadin 8 I was playing back an audio file, which was generated by the server using this:
Audio tempAudio;
StreamResource resource = new StreamResource(
new StreamResource.StreamSource() {
public InputStream getStream() {
byte[] ab = ... // generated array of bytes;
return new ByteArrayInputStream(ab);
}
}, "") {
@Override
public String getMIMEType() {
return "audio/mp3";
}
};
if (tempAudio != null)
layoutMain.removeComponent(tempAudio);
tempAudio = new Audio(null, resource);
layoutMain.addComponent(tempAudio);
tempAudio.play();
What is the suggested way to do the same in Vaadin 10? I would really appreciate a code snippet, for example. similar to the above
Thanks!