Skip to content

Instantly share code, notes, and snippets.

@techsamy
Last active September 30, 2025 06:55
Show Gist options
  • Select an option

  • Save techsamy/4f6fe698aef2255a4dc3a52585836f78 to your computer and use it in GitHub Desktop.

Select an option

Save techsamy/4f6fe698aef2255a4dc3a52585836f78 to your computer and use it in GitHub Desktop.
Force LinkedIn video playback speed to 16x
/*
# LinkedIn Video Playback Speed Enforcer
This JavaScript snippet forces LinkedIn videos to play at a fixed speed (16x),
preventing the website from changing or resetting the playback speed.
---
## How to use:
1. Open LinkedIn and navigate to a video you want to watch.
2. Open your browser's developer console (usually F12 or Ctrl+Shift+I).
3. Copy and paste this entire code snippet into the console and press Enter.
4. The video playback speed will be locked to 16x and enforced continuously.
5. If the video changes, the script will detect and apply the speed automatically.
---
## Notes:
- You can adjust the playback speed by changing the value of `speed` (currently 16).
- The script overrides the `playbackRate` property to block changes.
- It keeps re-applying the speed every 500ms to counter resets by the site.
*/
(() => {
const speed = 16;
let currentVideo, interval;
function setSpeed(v) {
if (!v) return;
v.playbackRate = speed;
const desc = Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype, 'playbackRate');
if (desc?.configurable) {
Object.defineProperty(v, 'playbackRate', {
configurable: true,
enumerable: true,
get: () => speed,
set: val => {
if (val !== speed) console.log(`Blocked playbackRate ${val}, kept ${speed}`);
else desc.set.call(v, val);
}
});
}
clearInterval(interval);
interval = setInterval(() => {
if (v.playbackRate !== speed) {
v.playbackRate = speed;
console.log(`Re-applied playbackRate to ${speed}`);
}
}, 500);
}
setInterval(() => {
const v = document.querySelector('video');
if (v !== currentVideo) {
currentVideo = v;
if (v) {
console.log('New video detected, enforcing playback speed...');
setSpeed(v);
}
}
}, 1000);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment