discord-player
Advanced tools
Comparing version 5.2.0 to 5.2.1-dev
@@ -674,2 +674,4 @@ /// <reference types="node" /> | ||
* @property {boolean} [disableVolume=false] If player should disable inline volume | ||
* @property {boolean} [volumeSmoothness=0] The volume transition smoothness between volume changes (lower the value to get better result) | ||
* Setting this or leaving this empty will disable this effect. Example: `volumeSmoothness: 0.1` | ||
* @property {Function} [onBeforeCreateStream] Runs before creating stream | ||
@@ -688,2 +690,3 @@ */ | ||
disableVolume?: boolean; | ||
volumeSmoothness?: number; | ||
onBeforeCreateStream?: (track: Track, source: TrackSource, queue: Queue) => Promise<Readable>; | ||
@@ -690,0 +693,0 @@ } |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -152,3 +152,3 @@ "use strict"; | ||
createQueue(guild, queueInitOptions = {}) { | ||
var _a; | ||
var _a, _b; | ||
guild = this.client.guilds.resolve(guild); | ||
@@ -161,3 +161,4 @@ if (!guild) | ||
delete queueInitOptions["metadata"]; | ||
(_a = queueInitOptions.ytdlOptions) !== null && _a !== void 0 ? _a : (queueInitOptions.ytdlOptions = this.options.ytdlOptions); | ||
(_a = queueInitOptions.volumeSmoothness) !== null && _a !== void 0 ? _a : (queueInitOptions.volumeSmoothness = 0.1); | ||
(_b = queueInitOptions.ytdlOptions) !== null && _b !== void 0 ? _b : (queueInitOptions.ytdlOptions = this.options.ytdlOptions); | ||
const queue = new Queue_1.Queue(this, guild, queueInitOptions); | ||
@@ -164,0 +165,0 @@ queue.metadata = _meta; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -705,2 +705,5 @@ "use strict"; | ||
this._filtersUpdate = options.filtersUpdate; | ||
if (resource.volume && typeof this.options.volumeSmoothness === "number") { | ||
Reflect.set(resource.volume, "_smoothing", this.options.volumeSmoothness || 0); | ||
} | ||
this.setVolume(this.options.initialVolume); | ||
@@ -707,0 +710,0 @@ setTimeout(() => { |
@@ -77,2 +77,7 @@ "use strict"; | ||
*/ | ||
/** | ||
* The playlist which track belongs | ||
* @name Track#playlist | ||
* @type {Playlist} | ||
*/ | ||
void this._patch(data); | ||
@@ -79,0 +84,0 @@ } |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ "use strict"; |
{ | ||
"name": "discord-player", | ||
"version": "5.2.0", | ||
"version": "5.2.1-dev", | ||
"description": "Complete framework to facilitate music commands using discord.js", | ||
@@ -12,4 +12,7 @@ "main": "dist/index.js", | ||
"exports": { | ||
"require": "./dist/index.js", | ||
"import": "./dist/index.mjs" | ||
".": { | ||
"require": "./dist/index.js", | ||
"import": "./dist/index.mjs" | ||
}, | ||
"./smoothVolume": "./dist/smoothVolume.js" | ||
}, | ||
@@ -64,10 +67,11 @@ "scripts": { | ||
"dependencies": { | ||
"@discordjs/voice": "^0.7.5", | ||
"@discordjs/voice": "^0.8.0", | ||
"discord-ytdl-core": "^5.0.4", | ||
"libsodium-wrappers": "^0.7.9", | ||
"prism-media": "https://codeload.github.com/discord-player/prism-media/tar.gz/main", | ||
"soundcloud-scraper": "^5.0.2", | ||
"spotify-url-info": "^2.2.3", | ||
"tiny-typed-emitter": "^2.1.0", | ||
"youtube-sr": "^4.1.9", | ||
"ytdl-core": "^4.9.1" | ||
"youtube-sr": "^4.1.12", | ||
"ytdl-core": "^4.10.0" | ||
}, | ||
@@ -74,0 +78,0 @@ "devDependencies": { |
@@ -169,2 +169,16 @@ # Discord Player | ||
### Smooth Volume | ||
Discord Player will make volume transition smooth. To enable this, you need to add this line at the top of your main file: | ||
```js | ||
// CJS | ||
require("discord-player/smoothVolume"); | ||
// ESM | ||
import "discord-player/smoothVolume" | ||
``` | ||
> ⚠️ Make sure that line is situated at the **TOP** of your **main** file. | ||
### Use cookies | ||
@@ -219,3 +233,3 @@ | ||
// track here would be youtube track | ||
return (await playdl.stream(track.url)).stream; | ||
return (await playdl.stream(track.url, { discordPlayerCompatibility : true })).stream; | ||
// we must return readable stream or void (returning void means telling discord-player to look for default extractor) | ||
@@ -222,0 +236,0 @@ } |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
HTTP dependency
Supply chain riskContains a dependency which resolves to a remote HTTP URL which could be used to inject untrusted code and reduce overall package reliability.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
163306
20
3695
241
9
1
1
+ Addedprism-media@https://codeload.github.com/discord-player/prism-media/tar.gz/main
+ Added@discordjs/voice@0.8.0(transitive)
+ Added@types/node@22.9.3(transitive)
+ Addeddiscord-api-types@0.26.1(transitive)
+ Addedundici-types@6.19.8(transitive)
- Removed@discordjs/voice@0.7.5(transitive)
- Removed@types/node@22.10.0(transitive)
- Removeddiscord-api-types@0.24.0(transitive)
- Removedundici-types@6.20.0(transitive)
Updated@discordjs/voice@^0.8.0
Updatedyoutube-sr@^4.1.12
Updatedytdl-core@^4.10.0