设为首页收藏本站

云荷-个人作品展示

 找回密码
 中文注册

QQ登录

只需一步,快速开始

搜索
热搜: 音画 图文 音乐
12
返回列表 发新帖
楼主: 云端漫步
打印 上一主题 下一主题

【漫步特效】MV音乐视频播放器之二

[复制链接]
11#
发表于 2025-8-4 22:36:12 | 只看该作者
工整漂亮,音乐视频制作真不赖!
回复 支持 反对

使用道具 举报

12#
发表于 2025-8-4 22:36:39 | 只看该作者
感谢哥们儿分享精彩!
回复 支持 反对

使用道具 举报

13#
 楼主| 发表于 2025-8-5 01:22:01 | 只看该作者
本帖最后由 云端漫步 于 2025-8-5 02:10 编辑
圊圊淥詶 发表于 2025-8-4 21:42
漫步老师分享一下这个代码呗,我也想学学

  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4.     <meta charset="UTF-8">
  5.     <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6.     <title>论坛视频播放器</title>
  7.     <script src="https://cdn.tailwindcss.com"></script>
  8.     <link href="https://cdn.staticfile.org/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
  9.     <script>
  10.         tailwind.config = {
  11.             theme: {
  12.                 extend: {
  13.                     colors: {
  14.                         darkred: '#c8c108',
  15.                         cyan: '#00FFFF',
  16.                         gold: '#f0e7b5',
  17.                         goldLight: '#FFF8DC',
  18.                     },
  19.                     fontFamily: {
  20.                         sans: ['Inter', 'system-ui', 'sans-serif'],
  21.                     },
  22.                 }
  23.             }
  24.         }
  25.     </script>
  26.     <style type="text/tailwindcss">
  27.         @layer utilities {
  28.             .content-auto {
  29.                 content-visibility: auto;
  30.             }
  31.             .scrollbar-thin {
  32.                 scrollbar-width: thin;
  33.             }
  34.             .scrollbar-thin::-webkit-scrollbar {
  35.                 width: 5px;
  36.             }
  37.             .scrollbar-thin::-webkit-scrollbar-thumb {
  38.                 background-color: rgba(156, 163, 175, 0.5);
  39.                 border-radius: 9999px;
  40.             }
  41.             .player-controls {
  42.                 opacity: 0;
  43.                 transition: opacity 0.3s ease;
  44.             }
  45.             .video-container:hover .player-controls {
  46.                 opacity: 1;
  47.             }
  48.             .playlist-item {
  49.                 transition: all 0.2s ease;
  50.             }
  51.             .playlist-item:hover {
  52.                 transform: translateX(5px);
  53.             }
  54.             .video-ratio {
  55.                 aspect-ratio: 16/9;
  56.             }
  57.         }
  58.     </style>
  59. </head>
  60. <body class="bg-gray-900 text-white min-h-screen">
  61.     <div class="container mx-auto px-4 py-8 max-w-7xl">
  62.         <!-- 顶部控制区域 -->
  63.         <div class="bg-darkred rounded-t-lg p-4 flex flex-col lg:flex-row gap-4 items-center justify-between">
  64.             <div class="text-xl font-bold mb-2 lg:mb-0">云端漫步经典MV视频播放器</div>
  65.             
  66.             <div class="flex flex-wrap gap-4 w-full lg:w-auto">
  67.                 <div class="flex items-center gap-2">
  68.                     <label for="horizontal">水平:</label>
  69.                     <input type="range" id="horizontal" min="0" max="100" value="50"
  70.                         class="w-32 h-2 bg-gray-700 rounded-lg appearance-none cursor-pointer">
  71.                     <span id="horizontal-value" class="w-10 text-center">50</span>
  72.                 </div>
  73.                
  74.                 <div class="flex items-center gap-2">
  75.                     <label for="width">宽度:</label>
  76.                     <input type="range" id="width" min="640" max="1920" value="1280"
  77.                         class="w-32 h-2 bg-gray-700 rounded-lg appearance-none cursor-pointer">
  78.                     <span id="width-value" class="w-14 text-center">1280</span>
  79.                 </div>
  80.                
  81.                 <div class="flex items-center gap-2">
  82.                     <label for="height">高度:</label>
  83.                     <input type="range" id="height" min="360" max="720" value="540"
  84.                         class="w-32 h-2 bg-gray-700 rounded-lg appearance-none cursor-pointer">
  85.                     <span id="height-value" class="w-14 text-center">540</span>
  86.                 </div>
  87.             </div>
  88.         </div>
  89.         
  90.         <!-- 主要内容区域 -->
  91.         <div class="flex flex-col lg:flex-row gap-4 bg-gray-800 p-4 rounded-b-lg max-h-[800px]">
  92.             <!-- 左侧视频播放器 -->
  93.             <div class="lg:w-3/4">
  94.                 <div class="relative video-container" id="video-container">
  95.                     <video id="main-video" class="w-full bg-black rounded-lg video-ratio" controls>
  96.                         <p>HTML5视频播放。</p>
  97.                     </video>
  98.                     
  99.                     <!-- 播放/暂停按钮 -->
  100.                     <div class="absolute inset-0 flex items-center justify-center player-controls">
  101.                         <button id="play-pause-btn" class="bg-black/50 hover:bg-black/70 text-white w-16 h-16 rounded-full flex items-center justify-center transition-all duration-300 transform hover:scale-110">
  102.                             <i class="fa fa-play text-2xl"></i>
  103.                         </button>
  104.                     </div>
  105.                     
  106.                     <!-- 代码显示区域 -->
  107.                     <div class="absolute bottom-2 left-2 bg-black/70 text-white text-xs p-2 rounded opacity-70">
  108.                         <div>左值: <span id="left-value">0</span></div>
  109.                         <div>顶值: <span id="top-value">0</span></div>
  110.                     </div>
  111.                 </div>
  112.                
  113.                 <!-- 视频信息 - 进一步缩小高度和宽度 -->
  114.                 <div class="mt-2 p-1.5 bg-gold rounded-lg text-gray-800 max-h-[60px] max-w-[80%] mx-auto overflow-y-auto">
  115.                     <h2 id="video-title" class="text-xs font-bold mb-0.5 truncate">1斑MV</h2>
  116.                     <p id="video-description" class="text-[10px]">
  117.                         视频描述将显示在这里。
  118.                     </p>
  119.                 </div>
  120.             </div>
  121.             
  122.             <!-- 右侧播放列表 -->
  123.             <div class="lg:w-1/4 bg-cyan/20 rounded-lg p-4 overflow-y-auto scrollbar-thin">
  124.                 <h3 class="text-lg font-bold text-gray-900 mb-3">播放列表</h3>
  125.                 <ul id="playlist" class="space-y-2">
  126.                     <li class="playlist-item bg-cyan/40 hover:bg-cyan/60 p-3 rounded-lg cursor-pointer text-gray-900" data-url="https://cccimg.com/view.php/973bd4f8915b191bf4dd3cc54c806f60.mp4">
  127.                         1斑MV
  128.                     </li>
  129.                     <li class="playlist-item bg-cyan/40 hover:bg-cyan/60 p-3 rounded-lg cursor-pointer text-gray-900" data-url="https://cccimg.com/view.php/090cdc6631620a9c77b3cfe074fd524f.mp4">
  130.                         2Come As You Are
  131.                     </li>
  132.                     <li class="playlist-item bg-cyan/40 hover:bg-cyan/60 p-3 rounded-lg cursor-pointer text-gray-900" data-url="https://cccimg.com/view.php/a27b255bed39bb5e2e5b509a75b09d6e.mp4">
  133.                         3《智子》MV
  134.                     </li>
  135.                     <li class="playlist-item bg-cyan/40 hover:bg-cyan/60 p-3 rounded-lg cursor-pointer text-gray-900" data-url="https://cccimg.com/view.php/a60bc75b847c929d74e520cb1b48b0bb.mp4">
  136.                         4天高海阔
  137.                     </li>
  138.                     <li class="playlist-item bg-cyan/40 hover:bg-cyan/60 p-3 rounded-lg cursor-pointer text-gray-900" data-url="https://cccimg.com/view.php/6733fca05e32ff313d8d4936df7ab263.mp4">
  139.                         5那又怎样
  140.                     </li>
  141.                     <li class="playlist-item bg-cyan/40 hover:bg-cyan/60 p-3 rounded-lg cursor-pointer text-gray-900" data-url="https://cccimg.com/view.php/36f94f9db7bef9af9a1ad62e8ee75635.mp4">
  142.                         6河畔少年
  143.                     </li>
  144.                     <li class="playlist-item bg-cyan/40 hover:bg-cyan/60 p-3 rounded-lg cursor-pointer text-gray-900" data-url="https://cccimg.com/view.php/cde984c03d561cfdfc20d5a2d3b76b8b.mp4">
  145.                         7蛟龙出海
  146.                     </li>
  147.                     <li class="playlist-item bg-cyan/40 hover:bg-cyan/60 p-3 rounded-lg cursor-pointer text-gray-900" data-url="https://cccimg.com/view.php/c7cef57863ef46c4c791706d29b56b84.mp4">
  148.                         8相爱就是说了
  149.                     </li>
  150.                     <li class="playlist-item bg-cyan/40 hover:bg-cyan/60 p-3 rounded-lg cursor-pointer text-gray-900" data-url="https://cccimg.com/view.php/7ee90978660f041a596d1fcb2b7bef82.mp4">
  151.                         9清晨五点
  152.                     </li>
  153.                     <li class="playlist-item bg-cyan/40 hover:bg-cyan/60 p-3 rounded-lg cursor-pointer text-gray-900" data-url="https://cccimg.com/view.php/ea8f5307f1b4150917fa7b32cdbebacc.mp4">
  154.                         10带我去找夜生活
  155.                     </li>
  156.                     <li class="playlist-item bg-cyan/40 hover:bg-cyan/60 p-3 rounded-lg cursor-pointer text-gray-900" data-url="https://cccimg.com/view.php/4f03b71a14e785dbedad57543057c6e1.mp4">
  157.                         11曹操
  158.                     </li>
  159.                 </ul>
  160.             </div>
  161.         </div>
  162.     </div>
  163.    
  164.     <script>
  165.         // 获取DOM元素
  166.         const video = document.getElementById('main-video');
  167.         const playPauseBtn = document.getElementById('play-pause-btn');
  168.         const playlist = document.getElementById('playlist');
  169.         const videoTitle = document.getElementById('video-title');
  170.         const videoDescription = document.getElementById('video-description');
  171.         const horizontalSlider = document.getElementById('horizontal');
  172.         const horizontalValue = document.getElementById('horizontal-value');
  173.         const widthSlider = document.getElementById('width');
  174.         const widthValue = document.getElementById('width-value');
  175.         const heightSlider = document.getElementById('height');
  176.         const heightValue = document.getElementById('height-value');
  177.         const leftValue = document.getElementById('left-value');
  178.         const topValue = document.getElementById('top-value');
  179.         const videoContainer = document.getElementById('video-container');
  180.         const playlistContainer = playlist.parentElement;
  181.         
  182.         // 设置初始视频
  183.         video.src = 'https://cccimg.com/view.php/973bd4f8915b191bf4dd3cc54c806f60.mp4';
  184.         videoTitle.textContent = '1斑MV';
  185.         
  186.         // 播放/暂停功能
  187.         playPauseBtn.addEventListener('click', () => {
  188.             if (video.paused) {
  189.                 video.play();
  190.                 playPauseBtn.innerHTML = '<i class="fa fa-pause text-2xl"></i>';
  191.             } else {
  192.                 video.pause();
  193.                 playPauseBtn.innerHTML = '<i class="fa fa-play text-2xl"></i>';
  194.             }
  195.         });
  196.         
  197.         // 视频播放状态变化时更新按钮
  198.         video.addEventListener('play', () => {
  199.             playPauseBtn.innerHTML = '<i class="fa fa-pause text-2xl"></i>';
  200.         });
  201.         
  202.         video.addEventListener('pause', () => {
  203.             playPauseBtn.innerHTML = '<i class="fa fa-play text-2xl"></i>';
  204.         });
  205.         
  206.         // 播放列表点击事件
  207.         playlist.querySelectorAll('li').forEach(item => {
  208.             item.addEventListener('click', () => {
  209.                 // 移除所有选中状态
  210.                 playlist.querySelectorAll('li').forEach(li => {
  211.                     li.classList.remove('bg-cyan/80');
  212.                     li.classList.add('bg-cyan/40');
  213.                 });
  214.                
  215.                 // 添加选中状态
  216.                 item.classList.remove('bg-cyan/40');
  217.                 item.classList.add('bg-cyan/80');
  218.                
  219.                 // 更新视频
  220.                 video.src = item.getAttribute('data-url');
  221.                 videoTitle.textContent = item.textContent.trim();
  222.                 videoDescription.textContent = `正在播放: ${item.textContent.trim()}`;
  223.                 video.play();
  224.             });
  225.         });
  226.         
  227.         // 水平滑块事件
  228.         horizontalSlider.addEventListener('input', () => {
  229.             horizontalValue.textContent = horizontalSlider.value;
  230.             videoContainer.style.transform = `translateX(${horizontalSlider.value - 50}px)`;
  231.             leftValue.textContent = horizontalSlider.value - 50;
  232.         });
  233.         
  234.         // 宽度滑块事件
  235.         widthSlider.addEventListener('input', () => {
  236.             widthValue.textContent = widthSlider.value;
  237.             video.style.width = `${widthSlider.value}px`;
  238.         });
  239.         
  240.         // 高度滑块事件 - 更新视频高度和播放列表高度
  241.         heightSlider.addEventListener('input', () => {
  242.             heightValue.textContent = heightSlider.value;
  243.             video.style.height = `${heightSlider.value}px`;
  244.             playlistContainer.style.maxHeight = `${heightSlider.value}px`;
  245.         });
  246.         
  247.         // 鼠标移动时更新坐标
  248.         videoContainer.addEventListener('mousemove', (e) => {
  249.             const rect = videoContainer.getBoundingClientRect();
  250.             const x = e.clientX - rect.left;
  251.             const y = e.clientY - rect.top;
  252.             
  253.             leftValue.textContent = Math.round(x);
  254.             topValue.textContent = Math.round(y);
  255.         });
  256.         
  257.         // 初始设置
  258.         videoContainer.style.transform = `translateX(${horizontalSlider.value - 50}px)`;
  259.         playlistContainer.style.maxHeight = `${heightSlider.value}px`;
  260.     </script>
  261. </body>
  262. </html>
复制代码

评分

2

查看全部评分

回复 支持 反对

使用道具 举报

14#
 楼主| 发表于 2025-8-5 01:32:00 | 只看该作者
本帖最后由 云端漫步 于 2025-8-5 01:40 编辑


我这都是明码,设为开放没加密过,可以改xxx经典MV视频播放器,代码行段不要动否则乱码。切记不要动这链
https://cdn.staticfile.org/font- ... ont-awesome.min.css内码内容否则效果失效。论坛视频播放器可改可不改。换上列表名称。换上视频地址。视频地址要可源正确地址,如视频地址非正常也会视频失效。复制代码后放在.html格式内上传空间取得地址链,用发贴代码发表。


这发贴代码优化过的。别的发贴代码无用。
<div id="message69970213" class="t_msgfont " >
    <div style="position:absolute;z-index:32768;background:none;width:100%;left:0px;margin-top:150px;">
        <center>
            <IFRAME src="空间取得地址链.html" width="1100" height="800" marginWidth="0" marginHeight="0" frameBorder="0" scrolling="no" allowfullscreen></IFRAME>
        </center>
    </div>
    <div style="height:800px"></div><BR><BR><BR><BR><BR><BR></div>

评分

2

查看全部评分

回复 支持 反对

使用道具 举报

15#
 楼主| 发表于 2025-8-5 01:44:06 | 只看该作者
本帖最后由 云端漫步 于 2025-8-5 20:24 编辑

搜索漫步开源
《漫步大图》
【漫步特效】
回复 支持 反对

使用道具 举报

16#
 楼主| 发表于 2025-8-5 02:26:40 | 只看该作者
本帖最后由 云端漫步 于 2025-8-5 02:32 编辑

让我们同享音画的乐趣!

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?中文注册

x
回复 支持 反对

使用道具 举报

17#
发表于 2025-8-5 13:14:39 | 只看该作者
音乐视频播放器之二了
这一款也很漂亮
在线点播欣赏,给力
回复 支持 反对

使用道具 举报

18#
发表于 2025-8-5 13:18:05 | 只看该作者
漫步老师辛苦了,下半夜还在分享代码与注意事项,送上花花~~~~
回复 支持 反对

使用道具 举报

19#
发表于 2025-8-5 20:13:02 | 只看该作者
云端漫步 发表于 2025-8-5 01:32
我这都是明码,设为开放没加密过,可以改xxx经典MV视频播放器,代码行段不要动否则乱码。切记不要动这链
...

感谢感谢,谢谢漫步老师,费心了啊,已经收藏了,~~
回复 支持 反对

使用道具 举报

20#
发表于 2025-8-5 20:13:32 | 只看该作者
云端漫步 发表于 2025-8-5 02:26
让我们同享音画的乐趣!

谢谢漫步老师,一起开心~~
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 中文注册

本版积分规则

苏ICP备16043306号-1    

GMT+8, 2025-8-15 08:53 , Processed in 0.132238 second(s), 23 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表