h2oai / wave

Realtime Web Apps and Dashboards for Python and R
https://wave.h2o.ai
Apache License 2.0
3.9k stars 323 forks source link

Audio doesn't play in Safari #2174

Closed mtanco closed 8 months ago

mtanco commented 8 months ago

Wave SDK Version, OS

Wave 1.0.0 on OS X on Safari (fails), Chrome (works as expected

Actual behavior

In Safari, the audio freezes a couple milliseconds in and doesn't play

Expected behavior

(A clear and concise description of what you expected to happen.)

Steps To Reproduce

image

from h2o_wave import main, app, Q, ui
import os

@app('/')
async def serve(q: Q):
    # Upload the audio file to Wave server first.
    if not q.app.initialized:
        q.app.uploaded_mp3, = await q.site.upload([os.path.join(os.path.dirname(__file__), 'Untitled.m4a')])
        q.app.initialized = True

    q.page['example'] = ui.form_card(box='1 1 -1 -1', items=[
        ui.audio_annotator(
            name='annotator',
            title='My Audio Title',
            path=q.app.uploaded_mp3,
            tags=[
            #     ui.audio_annotator_tag(name='f', label='Flute', color='$blue'),
            #     ui.audio_annotator_tag(name='d', label='Drum', color='$brown'),
            ],
        ),
    ])

    await q.page.save()
mturoci commented 8 months ago

Does the mp3 work? Wondering whether it's a format support issue.