Skip to content

Commit

Permalink
remove proxied audio playing
Browse files Browse the repository at this point in the history
  • Loading branch information
ShivamJoker committed Sep 6, 2019
1 parent c9a0682 commit 78994d5
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions src/components/player/MainPlayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,12 @@ const MainPlayer = ({ location, history }) => {
});

// set the audio data
audioPlayer.current.src = "https://server.ylight.xyz/proxy/" + res.data;
const proxyURL = "https://server.ylight.xyz/proxy/"
audioPlayer.current.src = res.data;
playAudio();

// var audioContext = new AudioContext();

// var track = audioContext.createMediaElementSource(audioPlayer.current);
// track.connect(audioContext.destination);
};
Expand Down Expand Up @@ -220,7 +222,7 @@ const MainPlayer = ({ location, history }) => {
});

// set the audio data
audioPlayer.current.src = "https://server.ylight.xyz/proxy/" + res.data;
audioPlayer.current.src = res.data;
playAudio();
};

Expand All @@ -229,12 +231,8 @@ const MainPlayer = ({ location, history }) => {
id: video.id.videoId,
title: video.snippet.title,
channelTitle: video.snippet.channelTitle,
maxThumbnail: `https://img.youtube.com/vi/${
video.id.videoId
}/hqdefault.jpg`,
sdThumbnail: `https://img.youtube.com/vi/${
video.id.videoId
}/sddefault.jpg`
maxThumbnail: `https://img.youtube.com/vi/${video.id.videoId}/hqdefault.jpg`,
sdThumbnail: `https://img.youtube.com/vi/${video.id.videoId}/sddefault.jpg`
// this is the url of the max resolution of thumbnail
});

Expand Down Expand Up @@ -540,9 +538,7 @@ const MainPlayer = ({ location, history }) => {
id: item.id,
title: item.snippet.title,
channelTitle: item.snippet.channelTitle,
maxThumbnail: `https://img.youtube.com/vi/${
item.id
}/maxresdefault.jpg`,
maxThumbnail: `https://img.youtube.com/vi/${item.id}/maxresdefault.jpg`,
sdThumbnail: `https://img.youtube.com/vi/${item.id}/sddefault.jpg`
// this is the url of the max resolution of thumbnail
});
Expand Down Expand Up @@ -577,6 +573,7 @@ const MainPlayer = ({ location, history }) => {
onCanPlay={() => {
setAudioState("loaded");
}}
// crossOrigin="anonymous"
onPlay={() => setAudioState("playing")}
onPlaying={() => setAudioState("playing")}
onPause={() => setAudioState("paused")}
Expand Down

0 comments on commit 78994d5

Please sign in to comment.