diff --git a/src/plugins/audioPlaybackSpeed/README.md b/src/plugins/mediaPlaybackSpeed/README.md similarity index 59% rename from src/plugins/audioPlaybackSpeed/README.md rename to src/plugins/mediaPlaybackSpeed/README.md index f49f9cf53..066a24061 100644 --- a/src/plugins/audioPlaybackSpeed/README.md +++ b/src/plugins/mediaPlaybackSpeed/README.md @@ -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) diff --git a/src/plugins/audioPlaybackSpeed/components/SpeedIcon.tsx b/src/plugins/mediaPlaybackSpeed/components/SpeedIcon.tsx similarity index 100% rename from src/plugins/audioPlaybackSpeed/components/SpeedIcon.tsx rename to src/plugins/mediaPlaybackSpeed/components/SpeedIcon.tsx diff --git a/src/plugins/audioPlaybackSpeed/index.tsx b/src/plugins/mediaPlaybackSpeed/index.tsx similarity index 87% rename from src/plugins/audioPlaybackSpeed/index.tsx rename to src/plugins/mediaPlaybackSpeed/index.tsx index bd6bd7cde..aff0dc8d5 100644 --- a/src/plugins/audioPlaybackSpeed/index.tsx +++ b/src/plugins/mediaPlaybackSpeed/index.tsx @@ -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) { + playbackSpeedComponent(mediaRef: RefObject) { const changeSpeed = (speed: number) => { - const audio = audioRef.current; - if (audio) { - audio.playbackRate = speed; + const media = mediaRef.current; + if (media) { + media.playbackRate = speed; } }; @@ -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(){", diff --git a/src/plugins/audioPlaybackSpeed/styles.css b/src/plugins/mediaPlaybackSpeed/styles.css similarity index 68% rename from src/plugins/audioPlaybackSpeed/styles.css rename to src/plugins/mediaPlaybackSpeed/styles.css index 3251010d2..816190a48 100644 --- a/src/plugins/audioPlaybackSpeed/styles.css +++ b/src/plugins/mediaPlaybackSpeed/styles.css @@ -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); }