Skip to content

Commit

Permalink
refactor(audioPlaybackSpeed): rename to MediaPlaybackSpeed
Browse files Browse the repository at this point in the history
I was about to add support for videos but then I noticed it already works xD
  • Loading branch information
D3SOX committed Jun 2, 2024
1 parent d6ca6c8 commit dc41a4c
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
These are all my Vencord plugins that are not yet in the [official Vencord repository](https://vencord.dev/plugins#d3sox). Some of them have [pending PRs](https://github.com/Vendicated/Vencord/pulls/d3sox).
See the plugin folders for screenshots

[**AudioPlaybackSpeed**](./audioPlaybackSpeed)
Adds an icon to change the playback speed of voice message and audio embeds

🎡 [**BetterActivities**](./betterActivities)
Shows activity icons in the member list and allows showing all activities

Expand All @@ -23,6 +20,9 @@ Adds a follow option in the user context menu to always be in the same VC as the
😒 [**IgnoreTerms**](./ignoreTerms)
Ignore Discord's new terms of service

[**MediaPlaybackSpeed**](./mediaPlaybackSpeed)
Adds an icon to change the playback speed of media embeds

🔔 [**NotifyUserChanges**](./notifyUserChanges)
Adds a notify option in the user context menu to get notified when a user changes voice channels or online status

Expand Down
2 changes: 1 addition & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const Native = getNative();
import Plugins from "~plugins";

const PLUGINS = [
require("./audioPlaybackSpeed").default,
require("./mediaPlaybackSpeed").default,
require("./betterActivities").default,
require("./blockKrisp").default,
require("./d3soxUpdater").default,
Expand Down
4 changes: 2 additions & 2 deletions audioPlaybackSpeed/README.md → mediaPlaybackSpeed/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# AudioPlaybackSpeed
# MediaPlaybackSpeed

Adds an icon to change the playback speed of voice message and audio embeds
Adds an icon to change the playback speed of media embeds

![New icon with menu to change the playback speed](https://github.com/Vendicated/Vencord/assets/24937357/21792b09-8d6a-45be-a6e8-916cdd67a477)
File renamed without changes.
16 changes: 8 additions & 8 deletions audioPlaybackSpeed/index.tsx → mediaPlaybackSpeed/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@ import { RefObject } from "react";

import SpeedIcon from "./components/SpeedIcon";

const cl = classNameFactory("vc-audio-playback-speed-");
const cl = classNameFactory("vc-media-playback-speed-");

const speeds = makeRange(0.25, 3.5, 0.25);

export default definePlugin({
name: "AudioPlaybackSpeed",
description: "Adds an icon to change the playback speed of voice message and audio embeds",
name: "MediaPlaybackSpeed",
description: "Adds an icon to change the playback speed of media embeds",
authors: [Devs.D3SOX],

playbackSpeedComponent(audioRef: RefObject<HTMLAudioElement>) {
playbackSpeedComponent(mediaRef: RefObject<HTMLMediaElement>) {
const changeSpeed = (speed: number) => {
const audio = audioRef.current;
if (audio) {
audio.playbackRate = speed;
const media = mediaRef.current;
if (media) {
media.playbackRate = speed;
}
};

Expand Down Expand Up @@ -70,7 +70,7 @@ export default definePlugin({
replace: "$&,$self.playbackSpeedComponent($1)"
}
},
// audio embeds
// audio & video embeds
{
// need to pass media ref via props to make it easily accessible from inside controls
find: "renderControls(){",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
.vc-audio-playback-speed-icon {
.vc-media-playback-speed-icon {
background-color: transparent;
height: 100%;
z-index: 2;
color: var(--interactive-normal);
}

.vc-audio-playback-speed-icon:hover {
.vc-media-playback-speed-icon:hover {
color: var(--interactive-active);
}

0 comments on commit dc41a4c

Please sign in to comment.