Skip to content

Commit

Permalink
feat: stream proxy (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardocasares authored Feb 16, 2021
1 parent 9a89831 commit 63ec96a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ jobs:
- run: yarn --frozen-lockfile
- run: yarn build
env:
STREAM_PROXY: "http://stream.url"
VERCEL_GIT_COMMIT_SHA: ${{ github.sha }}
NEXT_PUBLIC_GA_TRACKING_ID: "N/A"
6 changes: 6 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,10 @@ module.exports = {
NEXT_PUBLIC_SENTRY_RELEASE: process.env.VERCEL_GIT_COMMIT_SHA,
NEXT_PUBLIC_GA_TRACKING_ID: process.env.NEXT_PUBLIC_GA_TRACKING_ID,
},
async rewrites() {
return [{
source: "/stream",
destination: process.env.STREAM_PROXY
}];
}
};
2 changes: 1 addition & 1 deletion src/lib/hooks/usePlayer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export function usePlayer() {

const load = (station: Station) => {
if (audio.current.src !== station.url) {
audio.current.src = station.url;
audio.current.src = `/stream?target=${station.url}`;

event({
action: "load",
Expand Down

1 comment on commit 63ec96a

@vercel
Copy link

@vercel vercel bot commented on 63ec96a Feb 16, 2021

Choose a reason for hiding this comment

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

Please sign in to comment.