Releases: aminomancer/WebNowPlaying-Companion-Personal-Edit
0.7.2
New update. This now uses optional chaining, so if you use chrome or edge, you need to enable "Experimental Javascript" in chrome://flags.
0.7.0
Added a new module that will toggle internal prefs "dom.min_background_timeout_value" while media is playing. This ensures that the buttons will be very snappy/responsive while they're actually in use. Prior to this you had to reduce this value to 50-200 or the buttons wouldn't update for a full second in some situations. With this update, the extension will use a sneaky trick to broadcast DOM pseudo-events about whether any player is active; and these can be picked up by a MutationObserver in a privileged script.
For that reason, this special feature requires (Alice0775's autoconfig loader)[https://github.com/alice0775/userChrome.js/tree/master/72]. If you don't want to download the loader, you can still use this extension without it. The listener module is just an optional enhancement. Put it in your chrome folder after setting up the autoconfig loader. It will automatically set the min timeout rate to 50 while playing media, and 2000 while not playing media. You can change those values pretty easily in the file. (WNPCListener.uc.js)
I also chopped off some clutter and baggage from the main scripts. That's about it~
Use the xpi on Firefox.
0.6.8
handle youtube mixes, better handling of unstarted embeds and embedded playlists
use the xpi for firefox.
0.6.6
fixed the rainmeter log clutter caused by errors getting album info from youtube categories.
use the xpi for firefox.
0.5.6
Added support for YouTube videos and playlists embedded in iframes, regardless of the main page's URL. Every feature is working, but there are some limitations inherent to the embedded YT player. Embedded players have no shuffle, loop playlist, or thumbs up/down functions in the first place, so we can't integrate those into WebNowPlaying. But everything else works. I develop this fork for my own use so there is one intentional quirk. When playing embedded playlists, the next/previous functions will pick a random video in the playlist rather than simply play the next video. Like my original modification, the previous function will rewind to the beginning of the video, while hitting it twice within 3 seconds will return to the previous video. There are a lot of conditional behaviors so the complete system is easier to just test yourself than to describe.
So you can check a sample YouTube shuffler I forked to see the intended behavior. That shuffler is actually what prompted this update. It allows you to easily program an alarm clock with windows task scheduler by just opening that URL at a specified time, and it will automatically shuffle the playlist. If you use a YouTube URL, you won't be able to shuffle it automatically without some kind of javascript extension, because there is no URL parameter for shuffling a playlist, it's just a button that requires user input or the click() function. This was easier than making an extension just to do that since I found one already finished, just needed to add jquery and fitvids to scale the video up, and add controls support etc.
Because I added embedded video support to WNPC for the purpose of using it in tandem with this YT shuffler, I decided to make the next/previous functions select random videos rather than just the next or previous video in the list. Otherwise you wouldn't really be able to shuffle through videos, you'd only get the shuffle functionality when a video ends on its own. And since WNPC can only touch an embedded video by getting injected INSIDE the iframe, it can't access the youtube iframe API. That means WNPC can't access a lot of the nice methods that the shuffler itself can. So I had to choose between always shuffling playlists or never shuffling them. There are some caveats that were hard to wrap my brain around so I can't really explain them very well but if you play around with it you'll see what I mean.
For non-playlists obviously there won't be any shuffling behavior. But for most non-playlist embeds there will hardly be any functionality in the first place. The main benefit is just being able to use the pause button and being able to query all the video info e.g. title, channel name, thumbnail, position/duration etc. I don't know if anyone else is actually using this extension but if you make a new issue about it I'll make a version with non-shuffling next/previous buttons, or I'll try to work out a way to toggle it. I think that actually wouldn't be too hard, I just don't fully understand all the nuances of working with the websocket API, and that does seem to require adding a new meter/variable object altogether.
Anyway this update also fixes album art for youtube in general. I guess the thumbnails haven't been working correctly since before I started working on this, just didn't notice it because I don't use the album image meter. It seems like the maxresdefault URL parameter no longer exists or has been replaced by just hqdefault. So anyway I changed all that stuff. I also improved on some of the logic, like parsing the video and playlist IDs out of the URL was being done with kinda sloppy math previously when it could have just been done using URLSearchParams. Which might be helpful in case youtube ever extends the length or otherwise modifies the formatting of these UIDs.
Overall pretty proud of this update, got the whole embedded player script working in one sitting before even testing it, I guess mostly because I still haven't really worked out the correct way to live-debug firefox extensions.
As usual the xpi is signed, zip is unsigned. Still don't know if the zip version works in chrome.
0.5.4
Fixed playlist-item clicking snippet for 'next' function.
Again, xpi is signed, zip is unsigned.
0.5.3
Overhauled the 'next' function so it:
- correctly picks the next video in a playlist
- jumps back to the first video when you press 'next' while watching the last video in a playlist
- jumps to a random video when you press 'next' while shuffle is on
- never results in playing a suggested video or "next up" video when loop is on (previously this happened when you got to the end of a playlist, even if loop was on, and could even happen in the middle of a playlist due to how bad YouTube's playlist index system is. Some of YouTube's functions count deleted/private videos towards the index, some of them don't. So if the "next" button considers you to be at index 328, but the playVideoAt() function thinks you're at index 300, and index 328 falls outside of the range of non-deleted/private videos, then the next button will pick the "next up" video, not a video in the playlist)
For really long playlists (seems like 225+) when you get to the end of the playlist and press 'next,' rather than playing the actual first video in the playlist, it plays the first video that's loaded in the playlist object. Unfortunately there doesn't seem to be any user-facing function or object in YouTube's API that is capable of returning every video in such a large playlist. It unloads videos that are more than ~225 units away. Oddly though, if you just let the last video play to the end and loop is on, it will correctly return to the 1st video most of the time. So I'm not sure what to make of that.
Optimized some of the functions so they will use less CPU in checking and assigning values
Made some minor modifications to the 'previous' and 'repeat' functions
The .xpi is signed for firefox.
The .zip is unsigned, not sure if chrome allows you to install unsigned extensions but I'm not gonna upload this to the chrome web store.
0.5.0
Fixed YouTube functions for latest UI changes.
XPI is mozilla signed. zip is not.