TiddlyWiki as a media player replacement

140 views
Skip to first unread message

bimlas

unread,
Jan 28, 2019, 8:11:59 AM1/28/19
to TiddlyWiki
I would like to use TiddlyWiki as a music player, so I could easily categorize music in several ways: by artist, genre, album, etc. For example, if my mood is "dark + blues + denver", I could easily find the right tracks (16 Horsepower for example) and I could use the storylist as the playlist in a regular media player.

TiddlyWiki can play music from local directory...

https://tiddlywiki.com/static/Audio.html


... or even from Spotify.


This could be a very useful feature, but it lacks the ability to start the next music after the current ends. Does anyone know of a solution (Javascript event?) that will automatically jump to the next track in the storylist?
Message has been deleted
Message has been deleted
Message has been deleted

bimlas

unread,
Jan 28, 2019, 9:24:54 AM1/28/19
to tiddl...@googlegroups.com
Just found a "pre-solution":

* Open https://tiddlywiki.com/static/Audio.html
* Right click on the page -> Inspect element -> open Console tab
* Paste this code and press Enter:

var players = document.getElementsByTagName('audio');
for(var i=0; i < players.length; i++) {
  players
[i].nextPlayer = players[i+1];
  players
[i].addEventListener('ended', function() {
   
this.nextPlayer.play();
 
});
}
// After the last song, jump to the first (repeat)
players
[players.length-1].nextPlayer = players[0];

* Start the first audio
* When it ends, second is started

I'm sure I will do this as a plugin, or if @Jermolene is interested in it, it will be a pull request.

bimlas

unread,
Jan 28, 2019, 9:29:05 AM1/28/19
to TiddlyWiki
... Bob that has ability to handle return codes & ques.

Please explain this, I don't understand. 
Reply all
Reply to author
Forward
0 new messages