It is currently October 21st, 2019, 4:12 am

WebNowPlaying plugin. Supports sites like Youtube and Soundcloud

Plugins and Addons popular with the Community
User avatar
tjhrulz
Developer
Posts: 225
Joined: October 13th, 2016, 1:28 am
Location: Earth

Re: WebNowPlaying plugin. Supports sites like Youtube and Soundcloud

tjhrulz » October 29th, 2017, 3:23 pm

No that is latest, expect though a new update soon.
User avatar
tjhrulz
Developer
Posts: 225
Joined: October 13th, 2016, 1:28 am
Location: Earth

Re: WebNowPlaying plugin. Supports sites like Youtube and Soundcloud

tjhrulz » October 30th, 2017, 9:31 pm

Update 0.4.0 is now live for all web browsers, it is a complete rewrite that should make everyones experiences much better. While it is not mandatory there is also a new update for the Rainmeter plugin. Benefits of updating to it include better support for the new generic website handler (It may be ignored if it only obtained partial info on 0.3.0), and I removed the spotify API since it is no longer needed which should prevent a potential crash on heavily locked down networks.
User avatar
StArL0rd84
Posts: 336
Joined: February 8th, 2015, 10:07 pm
Location: EU, Denmark.

Re: WebNowPlaying plugin. Supports sites like Youtube and Soundcloud

StArL0rd84 » October 31st, 2017, 6:36 pm

Suggestion for next update:

Instead of [!CommandMeasure MeasurePlayPause "SetPosition +5"]
Maybe do something like [!CommandMeasure MeasurePlayPause "SetPosition 5"]
Which would skip to 5 percent into the song.

Right now i have set LeftMouseUpAction on my bar with
[!CommandMeasure mProgress "SetPosition $MouseX:%$"]

Which works flawlessly on YouTube, but SoundCloud does not like that format.
(Even after the 0.4.0.0 update) The song just skips the beginning when clicking on the bar.

Cannot really see any way i could make the bar clickable with just SetPosition +/-X.
(#WorkTime# = 1 ? #Work# : ([mEnergyLoss:%] > 100 ? #SleepMode# : #Rainmeter#))
User avatar
kyriakos876
Posts: 915
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: WebNowPlaying plugin. Supports sites like Youtube and Soundcloud

kyriakos876 » November 1st, 2017, 11:03 am

StArL0rd84 wrote:
Which works flawlessly on YouTube, but SoundCloud does not like that format.
(Even after the 0.4.0.0 update) The song just skips the beginning when clicking on the bar.
My skin works fine when I click on the bar, whether it's on YouTube or SoundCloud, and I use the same method.
User avatar
tjhrulz
Developer
Posts: 225
Joined: October 13th, 2016, 1:28 am
Location: Earth

Re: WebNowPlaying plugin. Supports sites like Youtube and Soundcloud

tjhrulz » November 1st, 2017, 5:46 pm

StArL0rd84 wrote:Suggestion for next update:

Instead of [!CommandMeasure MeasurePlayPause "SetPosition +5"]
Maybe do something like [!CommandMeasure MeasurePlayPause "SetPosition 5"]
Which would skip to 5 percent into the song.

Right now i have set LeftMouseUpAction on my bar with
[!CommandMeasure mProgress "SetPosition $MouseX:%$"]

Which works flawlessly on YouTube, but SoundCloud does not like that format.
(Even after the 0.4.0.0 update) The song just skips the beginning when clicking on the bar.

Cannot really see any way i could make the bar clickable with just SetPosition +/-X.

It actually is already like that (SetPosition works the same as it does for NowPlaying). If there is no +/- in the command then it assumes you want to go to that part of the song. So SetPosition 51 would set you at 51% of the way through the song. Look at your code that is already how you use that.

Let me download your skin and see if I can replicate it.

Edit: Your skin works just fine for me on every player I tested, obviously I am using the 0.4 plugin and extension. (PS. You might want to add a height to your album art so site that have square art do not make it extend past the bottom of the player) Maybe soundcloud is doing a staged rollout or something of a new website design? What language is it in and could you send a screenshot of soundcloud while listening to some music.
User avatar
StArL0rd84
Posts: 336
Joined: February 8th, 2015, 10:07 pm
Location: EU, Denmark.

Re: WebNowPlaying plugin. Supports sites like Youtube and Soundcloud

StArL0rd84 » November 2nd, 2017, 4:43 pm

tjhrulz wrote:It actually is already like that (SetPosition works the same as it does for NowPlaying). If there is no +/- in the command then it assumes you want to go to that part of the song. So SetPosition 51 would set you at 51% of the way through the song. Look at your code that is already how you use that.

Let me download your skin and see if I can replicate it.

Edit: Your skin works just fine for me on every player I tested, obviously I am using the 0.4 plugin and extension. (PS. You might want to add a height to your album art so site that have square art do not make it extend past the bottom of the player) Maybe soundcloud is doing a staged rollout or something of a new website design? What language is it in and could you send a screenshot of soundcloud while listening to some music.
Sorry for not responding sooner, but my plate is pretty full at the moment :(
This is my bar code:
(Can't easily package the new skin because it is integrated into a huge suite)

Code: Select all

[pBarStartBg]
 Meter=Image
 ImageName=#@#Images\BarStart.png
 X=75
 Y=6r
 AntiAlias=1
 ImageTint=#BarBgColor#,#BarBgTrans#
 DynamicVariables=1
 Group=BarBgTrans1
[pBarStart]
 Meter=Image
 ImageName=#@#Images\BarStart.png
 X=r
 Y=r
 AntiAlias=1
 ImageTint=#BarColor#,#BarTrans#
 Group=Controls&Info | BarTrans
[pBar]
 Meter=Bar
 MeasureName=mProgress
 X=3r
 Y=r
 W=146
 H=6
 BarColor=#BarColor#,#BarTrans#
 SolidColor=#BarBgColor#,#BarBgTrans#
 BarOrientation=Horizontal
 LeftMouseUpAction=[!CommandMeasure mProgress "SetPosition $MouseX:%$"]
 Group=Controls&Info | BarTrans | BarBgTrans2
[pBarEnd]
 Meter=Image
 ImageName=#@#Images\BarStart.png
 ImageFlip=Horizontal
 X=(([pBar:X])+([pBar:W]/2))
 Y=r
 AntiAlias=1
 ImageTint=#BarBgColor#,#BarBgTrans#
 Group=Controls&Info | BarBgTrans1
[pBarKnob]
 Meter=Image
 ImageName=#@#Images\BarStart.png
 ImageTint=#BarColor#,#BarTrans#
 DynamicVariables=1
 ImageFlip=Horizontal
 X=(([pBar:W]*(([mProgress:%]/100)))+([pBarStart:X]+3))
 Y=r
 AntiAlias=1
 Group=Controls&Info | BarTrans
And if i just do something like [!CommandMeasure mProgress "SetPosition 77"]
It still borks :confused:

Screenshot of SoundCloud:
SoundCloudScr.png
I am using the 0.4 plugin and extension:
fileversion.png
SoundCloudUpd.png
You do not have the required permissions to view the files attached to this post.
(#WorkTime# = 1 ? #Work# : ([mEnergyLoss:%] > 100 ? #SleepMode# : #Rainmeter#))
User avatar
tjhrulz
Developer
Posts: 225
Joined: October 13th, 2016, 1:28 am
Location: Earth

Re: WebNowPlaying plugin. Supports sites like Youtube and Soundcloud

tjhrulz » November 5th, 2017, 1:05 am

StArL0rd84 wrote:Sorry for not responding sooner, but my plate is pretty full at the moment :(
This is my bar code:
(Can't easily package the new skin because it is integrated into a huge suite)

Code: Select all

[pBarStartBg]
 Meter=Image
 ImageName=#@#Images\BarStart.png
 X=75
 Y=6r
 AntiAlias=1
 ImageTint=#BarBgColor#,#BarBgTrans#
 DynamicVariables=1
 Group=BarBgTrans1
[pBarStart]
 Meter=Image
 ImageName=#@#Images\BarStart.png
 X=r
 Y=r
 AntiAlias=1
 ImageTint=#BarColor#,#BarTrans#
 Group=Controls&Info | BarTrans
[pBar]
 Meter=Bar
 MeasureName=mProgress
 X=3r
 Y=r
 W=146
 H=6
 BarColor=#BarColor#,#BarTrans#
 SolidColor=#BarBgColor#,#BarBgTrans#
 BarOrientation=Horizontal
 LeftMouseUpAction=[!CommandMeasure mProgress "SetPosition $MouseX:%$"]
 Group=Controls&Info | BarTrans | BarBgTrans2
[pBarEnd]
 Meter=Image
 ImageName=#@#Images\BarStart.png
 ImageFlip=Horizontal
 X=(([pBar:X])+([pBar:W]/2))
 Y=r
 AntiAlias=1
 ImageTint=#BarBgColor#,#BarBgTrans#
 Group=Controls&Info | BarBgTrans1
[pBarKnob]
 Meter=Image
 ImageName=#@#Images\BarStart.png
 ImageTint=#BarColor#,#BarTrans#
 DynamicVariables=1
 ImageFlip=Horizontal
 X=(([pBar:W]*(([mProgress:%]/100)))+([pBarStart:X]+3))
 Y=r
 AntiAlias=1
 Group=Controls&Info | BarTrans
And if i just do something like [!CommandMeasure mProgress "SetPosition 77"]
It still borks :confused:

Screenshot of SoundCloud:
SoundCloudScr.png

I am using the 0.4 plugin and extension:
fileversion.png
SoundCloudUpd.png

Sorry man I was gone for the last few days dealing with some family issues.
I have tested the command extensively on my end and it seems to be working fine no matter what I throw at it. It could be that your skin is somehow using an edge case that youtube handles but you said even a manual normal setPosition failed (Just double checking you are doing everything on a scale of 0 - 100 right?). Could you try inputting the following code into your browser's developer console (Normally accessed by hitting F12)

Code: Select all

progress = function(progress)
{
    var loc = document.getElementsByClassName("playbackTimeline__progressWrapper")[0].getBoundingClientRect();
    progress *= loc.width;

    var a = document.getElementsByClassName("playbackTimeline__progressWrapper")[0];
    var e = document.createEvent('MouseEvents');
    e.initMouseEvent('mousedown', true, true, window, 1,
        screenX + loc.left + progress, screenY + loc.top + loc.height / 2,
        loc.left + progress, loc.top + loc.height / 2,
        false, false, false, false, 0, null);
    a.dispatchEvent(e);
    e.initMouseEvent('mouseup', true, true, window, 1,
        screenX + loc.left + progress, screenY + loc.top + loc.height / 2,
        loc.left + progress, loc.top + loc.height / 2,
        false, false, false, false, 0, null);
    a.dispatchEvent(e);
};
progress(0.5);
That should if it works right set the song to 50% through the song. If that does not work tell me the output of document.getElementsByClassName("playbackTimeline__progressWrapper")[0].getBoundingClientRect()
User avatar
StArL0rd84
Posts: 336
Joined: February 8th, 2015, 10:07 pm
Location: EU, Denmark.

Re: WebNowPlaying plugin. Supports sites like Youtube and Soundcloud

StArL0rd84 » November 5th, 2017, 10:40 am

Inputting the code you provided into my browser's developer console worked and it jumped to 50%.

Tried a to test couple of things in case i did something wrong installing stuff.
- Updated Rainmeter
- Re-downloaded your test skin and copied the plugin into Rainmeter plugins folder.
- tried to mess with your example skin and it either skips to the beginning of the song or to the next song depending on which
button i click. [MeterPositionBack]/[MeterPositionForward]
- Disabled ALL other Chrome extensions in case of a conflict there.
- Reinstalled the Chrome extension.

Since none of those things (Other than injecting the code directly into the browser) made a difference, i don't know what to try next :(
(#WorkTime# = 1 ? #Work# : ([mEnergyLoss:%] > 100 ? #SleepMode# : #Rainmeter#))
User avatar
tjhrulz
Developer
Posts: 225
Joined: October 13th, 2016, 1:28 am
Location: Earth

Re: WebNowPlaying plugin. Supports sites like Youtube and Soundcloud

tjhrulz » November 5th, 2017, 4:28 pm

Click on the album art in that example, does that set it to 50% of the way through the song? Also are progress measures correctly reporting what percent of the way through the song you are? All relative commands rely on that to calculate correctly.
User avatar
StArL0rd84
Posts: 336
Joined: February 8th, 2015, 10:07 pm
Location: EU, Denmark.

Re: WebNowPlaying plugin. Supports sites like Youtube and Soundcloud

StArL0rd84 » November 5th, 2017, 5:10 pm

tjhrulz wrote:Click on the album art in that example, does that set it to 50% of the way through the song? Also are progress measures correctly reporting what percent of the way through the song you are? All relative commands rely on that to calculate correctly.
When i click on the album art in the example, it sets it to 0% of the way through the song.
The progress measures are reporting correct percentage.
progress2.png
You do not have the required permissions to view the files attached to this post.
(#WorkTime# = 1 ? #Work# : ([mEnergyLoss:%] > 100 ? #SleepMode# : #Rainmeter#))