Advertisement
felipemathyas

playlist

Apr 30th, 2024
788
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 4.38 KB | Movies | 0 0
  1.  
  2. <!DOCTYPE html>
  3. <html lang="en">
  4. <head>
  5.     <meta charset="UTF-8">
  6.     <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7.     <title>Vídeos do YouTube</title>
  8.     <style>
  9.         body {
  10.             font-family: Arial, sans-serif;
  11.             margin: 0;
  12.             padding: 0;
  13.         }
  14.  
  15.         #videoContainer {
  16.             position: fixed;
  17.             bottom: 0;
  18.             left: 0;
  19.             width: 100%;
  20.             background-color: #333;
  21.             color: white;
  22.             text-align: center;
  23.             padding: 10px;
  24.             display: none;
  25.         }
  26.  
  27.         #player {
  28.             width: 100%;
  29.             height: 360px;
  30.         }
  31.  
  32.         #dropdown {
  33.             position: fixed;
  34.             top: 10px;
  35.             right: 10px;
  36.             z-index: 1;
  37.             display: inline-block;
  38.         }
  39.  
  40.         #dropdownContent {
  41.             display: none;
  42.             position: absolute;
  43.             background-color: #333;
  44.             box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  45.             min-width: 160px;
  46.             z-index: 1;
  47.         }
  48.  
  49.         #dropdown button {
  50.             background-color: #333;
  51.             color: white;
  52.             padding: 10px;
  53.             font-size: 16px;
  54.             border: none;
  55.             cursor: pointer;
  56.         }
  57.  
  58.         #dropdownContent a {
  59.             color: white;
  60.             padding: 12px 16px;
  61.             text-decoration: none;
  62.             display: block;
  63.         }
  64.  
  65.         #dropdownContent a:hover {
  66.             background-color: #555;
  67.         }
  68.     </style>
  69. </head>
  70. <body>
  71.  
  72.     <div id="dropdown">
  73.         <button onclick="toggleDropdown()">Clique aqui</button>
  74.         <div id="dropdownContent">
  75.             <a href="javascript:void(0)" onclick="loadPlaylist('PLPuTuKInxLDMYgn7tPLimd7U5qWn83sYj')">Playlist 1</a>
  76.             <a href="javascript:void(0)" onclick="loadPlaylist('PLPb0hyjbXnkoZ9vs0Us4DoLVn2fVrlQWC')">Playlist 2</a>
  77.             <a href="javascript:void(0)" onclick="loadPlaylist('PLyklBR4eLE2ZC9VZDUfCHVqtgl78YvbqM')">Forro atg</a>
  78.             <a href="javascript:void(0)" onclick="loadPlaylist('PLJn4hP4ODKFykbV59b2XWmw7GVrzokGrf')">pISADINHA atg</a>
  79.             <a href="javascript:void(0)" onclick="loadPlaylist('RDa42Y37YSuCM')">Muuuuuuuuuu atg</a>
  80.             <a href="javascript:void(0)" onclick="loadPlaylist('PLNZ3Ss0T52ZJ00rNHhhotS5EpbcEo4yBS')">Mucao22222 atg</a>
  81.             <a href="javascript:void(0)" onclick="loadPlaylist('PLUUbgea4rQYDXWou8VIvH1gLmg9OAEyex')">mIX MUCAO</a>
  82.             <a href="javascript:void(0)" onclick="loadPlaylist('tRsukCHYWP8')">11 de muh antiga</a>
  83.  
  84.             <a href="javascript:void(0)" onclick="loadPlaylist('PL9IA2wt9WiE9VpX4khA-GWKM9hhZV3hOM')">Sertanejo Antigas</a>
  85.             <a href="javascript:void(0)" onclick="loadPlaylist('PL86Y3BW5O5CK13_rHsALKp2UHMoWSef5z')">Sertanejo 2024</a>
  86.         </div>
  87.     </div>
  88.  
  89.     <div id="videoContainer">
  90.         <div id="player"></div>
  91.     </div>
  92.  
  93.     <script src="https://www.youtube.com/iframe_api"></script>
  94.     <script>
  95.         var player;
  96.  
  97.         function onYouTubeIframeAPIReady() {
  98.             player = new YT.Player('player', {
  99.                 height: '180',
  100.                 width: '240',
  101.                 events: {
  102.                     'onReady': onPlayerReady,
  103.                     'onStateChange': onPlayerStateChange
  104.                 }
  105.             });
  106.         }
  107.  
  108.         function onPlayerReady(event) {
  109.             // O player está pronto
  110.         }
  111.  
  112.         function onPlayerStateChange(event) {
  113.             // O estado do player mudou
  114.         }
  115.  
  116.         function loadPlaylist(playlistId) {
  117.             player.loadPlaylist({
  118.                 list: playlistId,
  119.                 listType: 'playlist',
  120.                 index: 0,
  121.                 suggestedQuality: '360'
  122.             });
  123.             document.getElementById('videoContainer').style.display = 'block';
  124.             closeDropdown();
  125.         }
  126.  
  127.         function toggleDropdown() {
  128.             var dropdownContent = document.getElementById('dropdownContent');
  129.             dropdownContent.style.display = (dropdownContent.style.display === 'block') ? 'none' : 'block';
  130.         }
  131.  
  132.         function closeDropdown() {
  133.             var dropdownContent = document.getElementById('dropdownContent');
  134.             dropdownContent.style.display = 'none';
  135.         }
  136.     </script>
  137.  
  138. </body>
  139. </html>
  140.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement