solewniczak / dokuwiki-plugin-jplayer

MIT License
2 stars 1 forks source link

Cut song titles only if needed via CSS #1

Closed Laynee closed 6 years ago

Laynee commented 6 years ago

The song titles in the playlist are hard cut to 30 characters, even if the player width is set to something like the full width of the page. This results in huge unused space in the playlist. And the titles are not easily recognisable.

screenshot 2017-10-10 16-23-14

Would it be possible to cut the titles via CSS using something like text-overflow: ellipsis ?

https://css-tricks.com/snippets/css/truncate-string-with-ellipsis/

solewniczak commented 6 years ago

How did you stretch the player? Do you use any custom jplayer skin?

In the current plugin version I use mp3 title tag instead of filename. Check if your titles aren't cut.

Laynee commented 6 years ago

No custom skin, I just added .jp-audio {width: 100%} to my template's CSS. I checked the metadata of the mp3 files and titles are not cut. In jplayer/vendor/james-heinrich/getid3/getid3/module.tag.id3v1.php I found things like this :

$ParsedID3v1['title'] = $this->cutfield(substr($id3v1tag, 3, 30));

or this :

$ID3v1Tag .= str_pad(trim(substr($title, 0, 30)), 30, "\x00", STR_PAD_RIGHT);

Maybe it's related to the hard cut of the titles to 30 characters ?

Laynee commented 6 years ago

OK I've done some tests and the player is only returning ID3v1 tags instead of ID3v2 tags. ID3v1 tags are indeed limited to 30 characters. ID3v2 have no limit.

Nearly every MP3 files you can find are tagged with ID3v2 tags + ID3v1 tags for compatibility reasons (20+ years old hardware). And the jPlayer plugin only display ID3v1 tags.

I removed ID3v1 tags from an MP3 file, leaving only the ID3v2 tags and the title is read, without being cut at 30 characters.

Laynee commented 6 years ago

Problem solved, thanks!