-
Notifications
You must be signed in to change notification settings - Fork 0
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
埋め込みプレイヤーに対応させたい #9
Comments
埋め込みプレイヤーはiframeで以下のコードで利用できる模様。 <iframe src="https://open.spotify.com/embed/album/1DFixLWuPkv3KT3TnV35m3" width="300" height="380" frameborder="0" allowtransparency="true" allow="encrypted-media"></iframe> |
確認したら上記コードのid部分 idはspotifyのapiから返ってくる情報のうち、以下のhashに格納されている。
|
僕のコードだと railsのerbをこんな感じで作れば埋め込めそう。 <iframe src="https://open.spotify.com/embed/album/<%= @album["id"] %>" width="300" height="380" frameborder="0" allowtransparency="true" allow="encrypted-media"></iframe> |
railsはiframeもセキュリティに引っかかるっぽいので、別途バリデーションを調整する必要がある。 https://qiita.com/keisuke_kimura/items/1a0812837baab2cc100a response.headers['X-Frame-Options'] = 'ALLOW-FROM https://open.spotify.com' でいけるのかな〜。帰って確認してみよ。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://developer.spotify.com/documentation/widgets/generate/play-button/
ここらへん参照かな〜
The text was updated successfully, but these errors were encountered: