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

drop soundmanager2 and bar-ui for HTML5 audio #481

Closed
Rello opened this issue Jul 15, 2020 · 40 comments
Closed

drop soundmanager2 and bar-ui for HTML5 audio #481

Rello opened this issue Jul 15, 2020 · 40 comments
Assignees
Milestone

Comments

@Rello
Copy link
Owner

Rello commented Jul 15, 2020

the old and unmaintained soundmanager2 + bar-ui libraries will be removed.
Standard HTML5 will be used

@Rello Rello added this to the 2.11.0 milestone Jul 15, 2020
@Rello Rello self-assigned this Jul 15, 2020
@Rello
Copy link
Owner Author

Rello commented Jul 21, 2020

@r4sas
Did you upgrade AP already? Does everything work for you?

@r4sas
Copy link
Contributor

r4sas commented Jul 21, 2020

@r4sas
Did you upgrade AP already? Does everything work for you?

Didn't checked for updates. When I checked in 8 hours after release, it wasn't available on NC. Will do againg later today.

@r4sas
Copy link
Contributor

r4sas commented Jul 21, 2020

Works for me, but current progress bar is not usable with high resolution, huge dot like in previous variant is needed.
add: endTime evement also need some checks to prevent printing NaN:NaN while track loading.
add 2: one more thing here: seconds need to be parsed with prepending zero (when lesser then 10 seconds it prints X:6 for six seconds).

@Rello
Copy link
Owner Author

Rello commented Jul 21, 2020

Ok. Thank you!

What happens with the bar in your case? Too small? I read something about resolution scaling - but I have only HD

The others: ok. Little finetuning. Will take care
The rework was quite big - the codebase is now SO MUCH smaller/simpler. Thats why I could include so many pending features.

Happy that it works in general.
Will look at the details...

@r4sas
Copy link
Contributor

r4sas commented Jul 21, 2020

image

That's in chromium.

add: current track position saving code sending request four times instead one.

@r4sas
Copy link
Contributor

r4sas commented Jul 21, 2020

555f9b8#diff-783b03491a86df59900aedf1a46bce10R175-R183
Too wrong code... I think we can use calculateCurrentValue because it doing same thing...

https://stackoverflow.com/a/6313008

@r4sas
Copy link
Contributor

r4sas commented Jul 21, 2020

Something like this:

    function formatSecondsToTime (seconds) {
        if (seconds <= 0) return "00:00";
        var hours = Math.floor(seconds / 3600),
            minutes = Math.floor(seconds / 60 % 60),
            seconds = (seconds % 60),
            time = (hours !== 0 ? String(hours).padStart(2, '0')+ ":" : "") + String(minutes).padStart(2, '0') + ":" + String(seconds).padStart(2, '0');
        return time;
    }

@r4sas
Copy link
Contributor

r4sas commented Jul 22, 2020

Ah, also volume control is not visible and not works.

@Rello
Copy link
Owner Author

Rello commented Jul 23, 2020

thank you for the pull requests. they look good. I like the idea with the rounded cover!

yes, volume control did not make it into the release. will have a look.
the question is, do you thing this is actually useful at all? I never used it

@r4sas
Copy link
Contributor

r4sas commented Jul 24, 2020

Sometimes it useful if didn't want mess with system volume levels when few applications with sound output works at same time (example: voice conference and music).

@r4sas
Copy link
Contributor

r4sas commented Jul 24, 2020

One more bug: track info is not updating in audio element, browsers always shows first track info.

@Rello
Copy link
Owner Author

Rello commented Jul 24, 2020

One more bug: track info is not updating in audio element, browsers always shows first track info.

got it. the currentTrackIndexUiChange() is only triggered when clicking on a title - not when the playback changes. will fix it

@Rello
Copy link
Owner Author

Rello commented Jul 24, 2020

fyi: the player gets confused when the playlist is sorted. I am working on this

Rello added a commit that referenced this issue Jul 26, 2020
#481

add JS-docu; reset start position when next/prev; remove obsolete tooltip coding; repair sorting of playlist; various code cleanups
@Rello
Copy link
Owner Author

Rello commented Jul 26, 2020

Hi,
I hope I got the issues fixed not. volume is still pending

@Rello
Copy link
Owner Author

Rello commented Jul 28, 2020

volume is back.
for simplicity I switched to the standard slider. the old code was so huge...
not yet 100% perfect, but getting there

Screenshot 2020-07-28 at 21 25 13

Rello added a commit that referenced this issue Jul 28, 2020
@Rello
Copy link
Owner Author

Rello commented Jul 28, 2020

@r4sas hey, do you have the chance to test the current status? I think it should be complete now

@r4sas
Copy link
Contributor

r4sas commented Jul 29, 2020

I'll check it later today.

@r4sas
Copy link
Contributor

r4sas commented Jul 29, 2020

add: current track position saving code sending request four times instead one.

Still exists. Problem in updating playback status 4 times in second (at least on my PC).

one more thing: If I'm starting playing track from saved state, I'm not able seek to track begining till switch to other track and return back.

image
Is here any ability to change view of slider (volume regulation button)? Doesn't match the NC style.

@r4sas
Copy link
Contributor

r4sas commented Jul 29, 2020

I did not find a usefull other formular yet to trigger the timing only once. I need to connect to the timeupdate but this is fireing more often
https://github.com/Rello/audioplayer/blob/master/js/player.js#L235-L236

Make something like temporary variable where you will store latest update second on call, if it != current, update, otherwise ignore call.

whcih NC-Style are you referring to?

I'm testing in chromium, about styling I mean that this is flat button, when other buttons ans NC using rounded dots, etc. See for input[type=range]:: with -webkit-slider-thumb, -moz-range-thumb and -ms-thumb.

@r4sas
Copy link
Contributor

r4sas commented Jul 29, 2020

Hm, I found that my browser messing with styles, investigating now...

add: user agent stylesheet, integrated in browser, overwriting any styles if no input[type="range"] is defined.

add2:

[Deprecation] '-webkit-appearance: sliderthumb-horizontal' for elements other than ::-webkit-slider-thumb and ::-webkit-media-slider-thumb is deprecated and will be removed in M79, around December 2019.
[Deprecation] '-webkit-appearance: sliderthumb-vertical' for elements other than ::-webkit-slider-thumb and ::-webkit-media-slider-thumb is deprecated and will be removed in M79, around December 2019

Testing on 78.0.3904.97.

add3:

input[type=range].volume-slider {
  -webkit-appearance: none;
}

input[type=range].volume-slider::-webkit-slider-runnable-track {
  width: 100%;
  height: 8px;
  cursor: pointer;
  background: var(--color-background-dark);
  border-radius: var(--border-radius);
}

input[type=range].volume-slider::-webkit-slider-thumb {
  border: 1px solid var(--color-border-dark);
  height: 14px;
  width: 14px;
  border-radius: 7px;
  background: #ffffff;
  cursor: pointer;
  -webkit-appearance: none;
  margin-top: -3px;
}

image

@r4sas
Copy link
Contributor

r4sas commented Jul 29, 2020

document.title = currentTrack.dataset.title + ' (' + currentTrack.dataset.artist + ' ) @ ' + OCA.Audioplayer.Core.initialDocumentTitle;

Extra space before ).

r4sas added a commit to r4sas/audioplayer that referenced this issue Jul 29, 2020
@r4sas
Copy link
Contributor

r4sas commented Jul 29, 2020

add3:

Good example for all browsers: https://css-tricks.com/styling-cross-browser-compatible-range-inputs-css/

@Rello
Copy link
Owner Author

Rello commented Jul 29, 2020

oh wow. going out for dinner; coming back; and seeing all this stuff!?
thank you for looking at this in this level of detail.
I really appreciate your effort and support here!

Rello pushed a commit that referenced this issue Jul 29, 2020
* volume css, autosave js - #481

* reset variable when changing track

* use NC backgroud color for volume slider dot
@Rello
Copy link
Owner Author

Rello commented Jul 29, 2020

it looks like this on my chrome now
Screenshot 2020-07-29 at 21 14 11

@r4sas
Copy link
Contributor

r4sas commented Jul 29, 2020

Yes, it must be like this, but I dont seen how remove transparancy when not hovered.

@Rello
Copy link
Owner Author

Rello commented Jul 29, 2020

do you also have this blue frame after you clicked the slider - until you click somewhere else?

Screenshot 2020-07-29 at 22 15 26

@r4sas
Copy link
Contributor

r4sas commented Jul 29, 2020

See #488, that was fixed here. Also try drop cache in your browser if you already applied it.

@Rello
Copy link
Owner Author

Rello commented Jul 29, 2020

ah, now. I merged the pull via my phpStorm.
I expected it to be clever enough to apply the patch also to my local files...
I updated everything. looks clean now!

@Rello
Copy link
Owner Author

Rello commented Jul 29, 2020

what do you think?
are you happy now with this? you are the quality gate for the release :-)

@r4sas
Copy link
Contributor

r4sas commented Jul 30, 2020

Is bar-ui styles still used?
I'm now looking in Firefox and Edge CSSs

@Rello
Copy link
Owner Author

Rello commented Jul 30, 2020

hello,
yes, the bar-header still uses the old ones. I did not want to start that work for now and put it on backlog.
i need to check which ones are really required and migrate them to the styles.css
for the moment I would suggest to live with it

@r4sas
Copy link
Contributor

r4sas commented Jul 30, 2020

With #489 I'm ending row of changes. I think we can do that 2.11.1.

@Rello
Copy link
Owner Author

Rello commented Jul 30, 2020

thank you. I also added you as contributor to the readme and authors.md
i hope its ok for you

@r4sas
Copy link
Contributor

r4sas commented Jul 30, 2020

No problems.

@Rello
Copy link
Owner Author

Rello commented Jul 30, 2020

hey,
I did not check it before the release. but for it looks like this now in chrome/safari
Screenshot 2020-07-30 at 16 30 19

@r4sas
Copy link
Contributor

r4sas commented Jul 30, 2020

Yup, that's what I mention in #490

@Rello
Copy link
Owner Author

Rello commented Jul 30, 2020

so I will push a .2 quickly

@Rello
Copy link
Owner Author

Rello commented Jul 30, 2020

Screenshot 2020-07-30 at 16 39 00
can you check the dark-mode?
white mode looks good now

@r4sas
Copy link
Contributor

r4sas commented Jul 30, 2020

ohh... That's strange... Let me check.

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

No branches or pull requests

2 participants