Skip to content

Added MusicPlayer#17

Open
Guhan-SenSam wants to merge 6 commits intokivymd-extensions:mainfrom
Guhan-SenSam:musicplayer
Open

Added MusicPlayer#17
Guhan-SenSam wants to merge 6 commits intokivymd-extensions:mainfrom
Guhan-SenSam:musicplayer

Conversation

@Guhan-SenSam
Copy link
Contributor

Description of Changes

This is a minimalistic Music Player Widget. The widget can play multiple audio files that are passed to it as a list. A user can skip to the next track,skip to the previous track,pause and play and seek to any point in the audio file. When an audio file finishes the next audio track is automatically played. User can display music name,singer name and an album art for each audio which is passed through their own respective lists.

NOTE:

  • For the widget to work you must use some other audio provider than sdl2. This is because sdl2 doesn't support audio seek
    functionality.

  • As of now size_hint and custom sizes do not work due to the unique sizing of each part of the widget. I will be working on adding this later.

Screenshots

Screenshot from 2021-05-04 09-19-56
ezgif com-gif-maker(1)

@hmae
Copy link

hmae commented May 4, 2021

soundloader somehow doesn't load corectly audio files on android ..

  • try add jnius autoclass to load mediaplayer instead in case android ..
  • pygame or ffpyplayer for desktop ..

@Guhan-SenSam
Copy link
Contributor Author

Seems like a nice idea. Ill look into adding it

@quitegreensky
Copy link
Member

@Guhan-SenSam Nice job :) However i get following error when clicking on next button:

component\akivymd\kivymd_extensions\akivymd\uix\musicplayer.py", line 192, in skip_next  
     self.current_pic = self.pictures[id + 1]
 IndexError: list index out of range

@quitegreensky
Copy link
Member

Also is it possible to use like only 10-15 seconds for each sound track to keep the repo low in size? and limit them to only two tracks instead of three. I mean they don't look necessary.

@Guhan-SenSam
Copy link
Contributor Author

@quitegreensky Does this error appear only after pressing the next button after it has been pressed three times... Like it's only supposed to occur when the widget has reached the end of the list of the given audio files and the user presses the next button...but if the error is occurring on like the first click it may have something to do with the audio providers

@Guhan-SenSam
Copy link
Contributor Author

And ya I'll shorten the sound tracks and reduce them 👍

@Guhan-SenSam
Copy link
Contributor Author

I have reduced the file sizes and fixed the crash when user skips songs at end of song list. Now the widget just loops through all songs

@quitegreensky
Copy link
Member

@Guhan-SenSam Sorry i was busy recently and forgot about this PR. I notice some strange behaviors when i was testing the changes. It seems the slider doesn't work. Can you fix it?

Rec.0056.mp4

@Guhan-SenSam
Copy link
Contributor Author

Hmm it works for me. I think it must be that on your machine kivy is taking sdl2 as the default audio player. sdl2 doesn't have any seek functionality and that's why the seek bar isn't working. We have to set the audio player at the start of the demo program. I previously only had set the environment variable inside the screen.py of the widget. I have set the environment variable to use ffmpeg in the main.py now. Should work now.

@Guhan-SenSam
Copy link
Contributor Author

I have added docs and fixed seek not working sometimes

@kengoon
Copy link

kengoon commented Jun 8, 2021

@Guhan-SenSam if you can make that image CD to be rotating while it is playing, that will be really awesome(just suggesting)

@Guhan-SenSam
Copy link
Contributor Author

Seems like a nice idea 💡

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants