diff --git a/src/App.js b/src/App.js
index bc5adf0..4f88da5 100644
--- a/src/App.js
+++ b/src/App.js
@@ -25,7 +25,7 @@ function App() {
token: _token,
});
- s.getPlaylist("37i9dQZEVXcJZyENOWUFo7").then((response) =>
+ s.getPlaylist("37i9dQZF1DWYteTcNVQZNq").then((response) =>
dispatch({
type: "SET_DISCOVER_WEEKLY",
discover_weekly: response,
@@ -57,6 +57,13 @@ function App() {
playlists,
});
});
+ s.getMyDevices().then(({devices})=>{
+ console.log("Benim cihazlarım",devices[0].id)
+ dispatch({
+ type:"SET_DEVICE",
+ device_id:devices[0]?.id
+ })
+ })
}
}, [token, dispatch]);
diff --git a/src/Body.js b/src/Body.js
index 63ae5e6..e1e17e4 100644
--- a/src/Body.js
+++ b/src/Body.js
@@ -8,12 +8,13 @@ import FavoriteIcon from "@material-ui/icons/Favorite";
import MoreHorizIcon from "@material-ui/icons/MoreHoriz";
function Body({ spotify }) {
- const [{ discover_weekly }, dispatch] = useStateValue();
+ const [{ discover_weekly,device_id }, dispatch] = useStateValue();
const playPlaylist = (id) => {
spotify
.play({
- context_uri: `spotify:playlist:37i9dQZEVXcJZyENOWUFo7`,
+ device_id:device_id,
+ context_uri: `spotify:playlist:37i9dQZF1DWYteTcNVQZNq`,
})
.then((res) => {
spotify.getMyCurrentPlayingTrack().then((r) => {
@@ -32,6 +33,7 @@ function Body({ spotify }) {
const playSong = (id) => {
spotify
.play({
+ device_id:device_id,
uris: [`spotify:track:${id}`],
})
.then((res) => {
@@ -71,8 +73,8 @@ function Body({ spotify }) {