After realizing that focusing on learning either Javascript or Greasemonkey separately was not ambitious enough, I decided to take on a bigger challenge by creating a Greasemonkey script to modify the functionality of YouTube.
I have verified that I have the HTML5 player enabled, and I have double-checked the function names in the Youtube API. Additionally, I am confident that Greasemonkey is correctly installed and the script is loading properly. This assurance comes from seeing the "YoutubeSpeed.user.js" file in the Greasemonkey context menu with a check mark next to it when a YouTube page is open. Furthermore, I tested a simpler Greasemonkey script () which worked without any issues. Essentially, my goal is to implement specific actions on YouTube videos as soon as they are opened, such as pausing, setting the speed to 2x, adjusting quality to 720p, and ensuring volume is at 100.
I believe the issue lies in either my utilization of the Youtube API, JavaScript syntax, or Greasemonkey syntax. These tools are valuable for me, so any assistance in mastering them would be greatly appreciated. Moreover, suggestions for enhancing the overall YouTube experience through additional script features are welcomed.
EDIT: It appears there was a typographical error. I intended to share my script, which is concise, hoping for help. Here it is:
// ==UserScript==
// @name YoutubeSpeed
// @namespace <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="c5a8a4b1b1f1f2f2f7f485bca4adaaaaeba6aaa8">[email protected]</a>
// @description Double The Speed Of Youtube Videos By Default
// @include https://www.youtube.com/*
function onPlayerReady() {
target.player.pauseVideo();
target.player.setPlaybackRate(2);
target.player.setPlaybackQuality(hd720);
target.player.unMute();
target.player.setVolume(volume:100);
};
// @grant none
// ==/UserScript__
In terms of an MCVE (Minimal, Complete, and Verifiable Example), for M, I have struggled to get any Greasemonkey scripts involving YouTube videos to function. For C, the entirety of my script is provided above. Regarding V, I acknowledge I could have expounded better; when I play a YouTube video, it does not execute the desired actions outlined in this script, instead playing normally. Since my inquiry pertains to making my Greasemonkey script compatible with YouTube, and the only code present is specifically for modifying YouTube, I believe irrelevant elements have been ruled out.
I hope this clarification suffices. Apologies for any previous shortcomings; this marks my initial use of StackOverflow.
Cheers, Eridine