Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ffmpegPath option #1933

Merged
merged 5 commits into from
Aug 4, 2024
Merged

Add ffmpegPath option #1933

merged 5 commits into from
Aug 4, 2024

Conversation

retrouser955
Copy link
Collaborator

Changes

Add ffmpegPath option to player instead of setting the path via process.env.FFMPEG_PATH

Status

  • These changes have been tested and formatted properly.
  • This PR includes only documentation changes, no code change.
  • This PR introduces some Breaking changes.

Copy link

vercel bot commented Aug 4, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
discord-player-website ⬜️ Ignored (Inspect) Visit Preview Aug 4, 2024 9:13am

@retrouser955 retrouser955 requested a review from twlite August 4, 2024 08:35
@retrouser955 retrouser955 marked this pull request as draft August 4, 2024 08:42
@retrouser955
Copy link
Collaborator Author

Seems to work with the music bot inside the monorepo

		this.player = new Player(this as any, {
			ytdlOptions: {
				requestOptions: {
					headers: {
						cookie: process.env.YOUTUBE_COOKIE
					}
				}
			},
			skipFFmpeg: true,
			ffmpegPath: `${__dirname}/lib`
		});
		console.log(`FFMPEG PATH IS: ${process.env.FFMPEG_PATH}`)
                // Actually log: FFMPEG PATH IS: __dirname/lib

But tests are failing

    it("should set process.env.FFMPEG_PATH to given path", () => {
        // not actual ffmpeg path. just dummy
        new Player(client, {
            ffmpegPath: "./packages/ffmpeg"
        })

        expect(process.env.FFMPEG_PATH).toBe("./packages/ffmpeg")
    })
    // error

Copy link
Collaborator

@twlite twlite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test("should set process.env.FFMPEG_PATH to given path", () => {
  // not actual ffmpeg path. just dummy
  new Player(client, {
      ffmpegPath: "./packages/ffmpeg",
      ignoreInstance: true
  })

  expect(process.env.FFMPEG_PATH).toBe("./packages/ffmpeg")
})

does this work?

packages/discord-player/src/Player.ts Outdated Show resolved Hide resolved
@retrouser955
Copy link
Collaborator Author

test("should set process.env.FFMPEG_PATH to given path", () => {
  // not actual ffmpeg path. just dummy
  new Player(client, {
      ffmpegPath: "./packages/ffmpeg",
      ignoreInstance: true
  })

  expect(process.env.FFMPEG_PATH).toBe("./packages/ffmpeg")
})

does this work?

Yup works.

@retrouser955 retrouser955 requested a review from twlite August 4, 2024 09:15
@retrouser955 retrouser955 marked this pull request as ready for review August 4, 2024 09:19
@twlite twlite merged commit 5760b85 into stable Aug 4, 2024
3 checks passed
@twlite twlite deleted the add/ffmpeg-path-option branch August 4, 2024 09:27
@twlite twlite mentioned this pull request Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants