carousel.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. <div class="my-4 carousel-wrapper">
  2. <div class="swiper carousel">
  3. <div class="swiper-wrapper">
  4. <!-- <div class="swiper-slide">
  5. <div class="toggle-video">
  6. <select onchange="setEwinFrame(this)">
  7. <option value="">切換主題</option>
  8. <option value="0922">0922 杭州亞運開跑</option>
  9. <option value="0927">0927 跆拳道表現亮眼</option>
  10. </select>
  11. </div>
  12. <div class="wrapper">
  13. <img src="/imgs/home/底圖-07.png"
  14. alt="choozmo|AI主播|AI|華視|華視團隊前進杭州 AI主播E-Win越洋連線|杭州亞運開跑|人工智慧|AI人工智慧|人工智能|虛擬主播|虛擬人|新聞播報">
  15. <div class="video-wrapper e-win">
  16. <iframe id="yt_ewin_frame" src="https://www.youtube.com/embed/YvmyRn6e9uw?autoplay=1&mute=1"
  17. title="YouTube video player" frameborder="0"
  18. allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
  19. allowfullscreen></iframe>
  20. </div>
  21. </div>
  22. </div> -->
  23. <div class="swiper-slide">
  24. <!-- <iframe src="https://www.youtube.com/embed/EEl8P8VshKs?si=JCbDL2qYGtE06JYq" title="YouTube video player"
  25. frameborder="0"
  26. allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
  27. allowfullscreen></iframe> -->
  28. <img src="/imgs/home/亞錦賽-07.webp"
  29. alt="choozmo|AI主播|AI|華視|亞錦賽|12月3號到12月10號鎖定亞錦棒球看華視|人工智慧|AI人工智慧|人工智能|虛擬主播|虛擬人|新聞播報">
  30. <div class="cts-player-item">
  31. <div id="cts-player"></div>
  32. </div>
  33. </div>
  34. <div class="swiper-slide">
  35. <div class="toggle-video">
  36. <select onchange="setEwinFrame(this)">
  37. <option value="">切換主題</option>
  38. <option value="0922">0922 杭州亞運開跑</option>
  39. <option value="0926">0926 滑板國手</option>
  40. <option value="0927">0927 跆拳道表現亮眼</option>
  41. <option value="1005">1005 男籃勝</option>
  42. <option value="1010">1010 杭州西湖</option>
  43. </select>
  44. </div>
  45. <img src="/imgs/home/底圖-07.webp"
  46. alt="choozmo|AI主播|AI|華視|華視團隊前進杭州 AI主播E-Win越洋連線|杭州亞運開跑|人工智慧|AI人工智慧|人工智能|虛擬主播|虛擬人|新聞播報">
  47. <div class="ewin-player-item">
  48. <div id="ewin-player"></div>
  49. </div>
  50. </div>
  51. <div class="swiper-slide">
  52. <a href="https://www.facebook.com/Ariel0702/?locale=zh_TW" target="_blank">
  53. <img src="/imgs/home/banner-main-01.png"
  54. alt="陳斐娟|克隆娟|三立iNEWS|AI Spokesperson|choozmo|AI主播|AI|AI建模|虛擬主播|人工智慧|客製化主播|最新服務|英文AI主播|AI 虛擬主播|生成式 AI技術|Facelandmark|deeplearning">
  55. <img src="/imgs/home/banner-main-02.png" alt="" class="person-img">
  56. </a>
  57. <div class="player-item">
  58. <div id="player"></div>
  59. </div>
  60. </div>
  61. <div class="swiper-slide">
  62. <a target="_blank" href="/main-news/警察廣播電台初次ai主播真人建模-與choozmo合作ai影片/">
  63. <div class="wrapper">
  64. <img src="/imgs/home/banner-01.jpg"
  65. alt="choozmo|AI主播|AI|警察廣播電臺|警廣|警廣路況|警廣線上收聽|人工智慧|AI人工智慧|人工智能|AI雙主播|雙主播|虛擬主播|虛擬人|新聞播報">
  66. <div class="video-wrapper">
  67. <iframe id="yt_frame" src="https://www.youtube.com/embed/HgrjL8pTpUY?autoplay=1&mute=1"
  68. title="YouTube video player" frameborder="0"
  69. allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
  70. allowfullscreen></iframe>
  71. </div>
  72. </div>
  73. </a>
  74. <div class="frame-item">
  75. <select onchange="setFrame(this)">
  76. <option value="">切換語言</option>
  77. <option value="國語">國語</option>
  78. <option value="臺語">臺語</option>
  79. <option value="英文">英文</option>
  80. <option value="日文">日文</option>
  81. <option value="泰文">泰文</option>
  82. <option value="印尼文">印尼文</option>
  83. <option value="越南文">越南文</option>
  84. <option value="馬來文">馬來文</option>
  85. <option value="原住民語">原住民語(阿美族)</option>
  86. <option value="客語">客語</option>
  87. <option value="手語">手語</option>
  88. </select>
  89. </div>
  90. </div>
  91. <div class="swiper-slide">
  92. <a href="/main-news/virtual-production-studio-turnkey-solution/">
  93. <img src="/imgs/home/banner-02.jpg"
  94. alt="Turnkey Solution|Virtual Production Studio|AI Spokesperson|choozmo|AI主播|AI|AI建模|虛擬主播|人工智慧|客製化主播|最新服務|英文AI主播|AI 虛擬主播|生成式 AI技術|Facelandmark|deeplearning">
  95. <!-- <img src="/imgs/home/banner01_mb.webp" alt="Choozmo in 2023CES" class="d-block d-md-none p-4"> -->
  96. </a>
  97. </div>
  98. </div>
  99. </div>
  100. <div class="swiper-button-next d-none d-md-block"></div>
  101. <div class="swiper-button-prev d-none d-md-block"></div>
  102. <div class="swiper-pagination"></div>
  103. </div>
  104. <script>
  105. // 載入 YouTube API
  106. let tag = document.createElement('script');
  107. tag.src = 'https://www.youtube.com/iframe_api';
  108. let firstScriptTag = document.getElementsByTagName('script')[0];
  109. firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
  110. // 在 API 載入完成後建立影片播放器
  111. let player;
  112. let ewinPlayer;
  113. let cts;
  114. function onYouTubeIframeAPIReady() {
  115. setupPlayer('player', 'vS8D5h7oUU0'); // 克隆娟
  116. setupPlayer('ewin-player', 'YvmyRn6e9uw'); // 亞運
  117. setupPlayer('cts-player', 'EEl8P8VshKs'); // 亞錦賽
  118. }
  119. function setupPlayer(playerId, videoId) {
  120. const player = new YT.Player(playerId, {
  121. videoId: videoId,
  122. playerVars: {
  123. 'autoplay': 0, // 不自動播放
  124. 'controls': 1, // 顯示播放控制項
  125. 'showinfo': 0, // 隱藏影片標題
  126. 'rel': 0, // 不顯示相關影片推薦
  127. },
  128. events: {
  129. 'onReady': function (event) {
  130. // 隱藏影片播放器
  131. event.target.mute();
  132. let posterDiv = document.createElement('div');
  133. let playerItem = document.querySelector(`.player-item`);
  134. let ewinDiv = document.createElement('div');
  135. let playerEwinItem = document.querySelector('.ewin-player-item');
  136. let ctsDiv = document.createElement('div');
  137. let playerCtsItem = document.querySelector('.cts-player-item');
  138. // 設定封面圖片(在影片上放封面圖片 div)
  139. posterDiv.classList.add('poster'); // 克隆娟
  140. event.target.getIframe().parentNode.insertBefore(posterDiv, event.target.getIframe());
  141. ewinDiv.classList.add('ewin'); // 亞運
  142. event.target.getIframe().parentNode.insertBefore(ewinDiv, event.target.getIframe());
  143. ctsDiv.classList.add('cts'); // 亞錦賽
  144. event.target.getIframe().parentNode.insertBefore(ctsDiv, event.target.getIframe());
  145. setTimeout(() => {
  146. playerItem.style.opacity = '1';
  147. playerEwinItem.style.opacity = '1';
  148. playerCtsItem.style.opacity = '1';
  149. }, 100);
  150. posterDiv.addEventListener('click', function () {
  151. posterDiv.style.display = 'none'; // 隱藏封面圖片
  152. event.target.unMute();
  153. event.target.setVolume(100);
  154. event.target.playVideo();
  155. });
  156. ewinDiv.addEventListener('click', function () {
  157. ewinDiv.style.display = 'none'; // 隱藏封面圖片
  158. event.target.unMute();
  159. event.target.setVolume(100);
  160. event.target.playVideo();
  161. });
  162. ctsDiv.addEventListener('click', function () {
  163. ctsDiv.style.display = 'none'; // 隱藏封面圖片
  164. event.target.unMute();
  165. event.target.setVolume(100);
  166. event.target.playVideo();
  167. });
  168. }
  169. }
  170. });
  171. }
  172. function setFrame(select) {
  173. let val = select.value;
  174. if (val === "國語") {
  175. $('#yt_frame').attr('src', 'https://www.youtube.com/embed/HgrjL8pTpUY?autoplay=1&mute=1');
  176. } else if (val === "臺語") {
  177. $('#yt_frame').attr('src', 'https://www.youtube.com/embed/iub7XwIIKsU?autoplay=1&mute=1');
  178. } else if (val === "英文") {
  179. $('#yt_frame').attr('src', 'https://www.youtube.com/embed/J0rMl5Aje8E?autoplay=1&mute=1');
  180. } else if (val === "日文") {
  181. $('#yt_frame').attr('src', 'https://www.youtube.com/embed/STBlnumMtJI?autoplay=1&mute=1');
  182. } else if (val === "泰文") {
  183. $('#yt_frame').attr('src', 'https://www.youtube.com/embed/IQSNsUpzH4M?autoplay=1&mute=1');
  184. } else if (val === "印尼文") {
  185. $('#yt_frame').attr('src', 'https://www.youtube.com/embed/moxFwtySJM8?autoplay=1&mute=1');
  186. } else if (val === "越南文") {
  187. $('#yt_frame').attr('src', 'https://www.youtube.com/embed/QfmlSYbvNsg?autoplay=1&mute=1');
  188. } else if (val === "馬來文") {
  189. $('#yt_frame').attr('src', 'https://www.youtube.com/embed/7jTyzenud8o?autoplay=1&mute=1');
  190. } else if (val === "原住民語") {
  191. $('#yt_frame').attr('src', 'https://www.youtube.com/embed/oGEX1P9AF9Y?autoplay=1&mute=1');
  192. } else if (val === "客語") {
  193. $('#yt_frame').attr('src', 'https://www.youtube.com/embed/OlyafG6Oxtk?autoplay=1&mute=1');
  194. } else if (val === "手語") {
  195. $('#yt_frame').attr('src', 'https://www.youtube.com/embed/ycUAa3iKjhA?autoplay=1&mute=1');
  196. }
  197. }
  198. function setEwinFrame(select) {
  199. let val = select.value;
  200. let player = document.querySelector('#ewin-player');
  201. let ewinImg = document.querySelector('.ewin');
  202. ewinImg.style.display = 'none'; // 隱藏封面圖片
  203. if (val === "0922") {
  204. $('#ewin-player').attr('src', 'https://www.youtube.com/embed/YvmyRn6e9uw?autoplay=1&mute=1');
  205. } else if (val === "0926") {
  206. $('#ewin-player').attr('src', 'https://www.youtube.com/embed/NQ7jKWlWOLk?autoplay=1&mute=1');
  207. } else if (val === "0927") {
  208. $('#ewin-player').attr('src', 'https://www.youtube.com/embed/woLoY-rw2pw?autoplay=1&mute=1');
  209. } else if (val === "1005") {
  210. $('#ewin-player').attr('src', 'https://www.youtube.com/embed/DSMvO1IOHdU?autoplay=1&mute=1');
  211. } else if (val === "1010") {
  212. $('#ewin-player').attr('src', 'https://www.youtube.com/embed/fb-kf9GYErE?autoplay=1&mute=1');
  213. }
  214. }
  215. </script>