amp-soundcloud
Mainkan trek SoundCloud dari dalam file AMP Html.
1 Struktur utama
<!doctype html>
<html ⚡>
<head>
<meta charset="utf-8">
<script async src="https://cdn.ampproject.org/v0.js"></script>
2 Disposisi
Masukkan yang berikut ini script setelah pembukaan <head>
<script async custom-element="amp-soundcloud" src="https://cdn.ampproject.org/v0/amp-soundcloud-0.1.js"></script>
3 Mode klasik
Anda dapat menemukan TrackID di kode penyisipan Soundcloud. Satu-satunya mode komposisi yang kompatibel adalah ketinggian tetap. Dapatkan ketinggian kode penyisipan Soundcloud.
Code
<amp-soundcloud height="166"
layout="fixed-height"
data-trackid="233161566"></amp-soundcloud>
Demo
4 Mode klasik memungkinkan Anda untuk mengatur warna khusus melalui atribut data-color
Code
<amp-soundcloud height="166"
layout="fixed-height"
data-trackid="233161566"
data-color="448AFF"></amp-soundcloud>
Demo
5 Modo visual
Mode visual tidak memungkinkan untuk mengubah warna. Pastikan untuk menggunakan ketinggian yang sama dengan kode penyisipan Soundcloud.
Code
<amp-soundcloud height="450"
layout="fixed-height"
data-trackid="233161566"
data-visual="true"></amp-soundcloud>
Demo
FULLn struktur kode lengkap
<!doctype html>
<html ⚡>
<head>
<meta charset="utf-8">
<script async src="https://cdn.ampproject.org/v0.js"></script>
<script async custom-element="amp-soundcloud" src="https://cdn.ampproject.org/v0/amp-soundcloud-0.1.js"></script>
<link rel="canonical" href="https://blogsgoblogger.blogspot.com/2019/02/cara-memainkan-soundcloud-tracks-dalam.html">
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
<style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript>
</head>
<body>
<amp-soundcloud height="166"
layout="fixed-height"
data-trackid="233161566"></amp-soundcloud>
<amp-soundcloud height="166"
layout="fixed-height"
data-trackid="233161566"
data-color="448AFF"></amp-soundcloud>
<amp-soundcloud height="450"
layout="fixed-height"
data-trackid="233161566"
data-visual="true"></amp-soundcloud>
</body>
</html>