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

Add play and pause to audio #458

Merged
merged 5 commits into from
Jul 18, 2024

Conversation

relardev
Copy link
Contributor

Addresses #457

Adds support for play and pause functions for Kino.Audio.

I have tested it with:

Untitled notebook

Section

req =
  Req.get!(
    "https://file-examples.com/storage/fe9f6f893066954d9aac3a2/2017/11/file_example_MP3_5MG.mp3"
  )

kino = Kino.Audio.new(req.body, :mp3)
for n <- 0..11 do
  case rem(n, 2) do
    0 -> Kino.Audio.play(kino)
    1 -> Kino.Audio.pause(kino)
  end

  :timer.sleep(1000)
end

Copy link
Member

@jonatanklosko jonatanklosko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

lib/kino/audio.ex Outdated Show resolved Hide resolved
lib/kino/audio.ex Outdated Show resolved Hide resolved
lib/assets/audio/main.js Outdated Show resolved Hide resolved
@jonatanklosko jonatanklosko merged commit 34addbb into livebook-dev:main Jul 18, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants