找回密码
 立即注册
搜索
查看: 3536|回复: 0

随机美女小姐姐视频播放源码

[复制链接]
  • 打卡等级:暂无等级
  • 打卡总天数:189
  • 打卡月天数:13
  • 打卡总奖励:145
  • 最近打卡:2025-11-13 10:56:25
灌水成绩
13861
48
2034798
主题
帖子
积分

等级头衔

ID : 1

管理员

积分成就 威望 : 999999
贡献 : 9999
下载币 : 10892
在线时间 : 1011 小时
注册时间 : 2013-9-5
最后登录 : 2025-11-13

发表于 昨天 18:36 | 显示全部楼层 |阅读模式 IP:广东东莞
免责
免费领取大流量卡,每日更新蔡州手游APP源码密码加入群聊接手游搭建—``下载币--购买服务器☆长期招聘游戏测试员(无偿),有兴趣联系站长QQ58493525微信A0396C
  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, maximum-scale=1.0, user-scalable=no">
  6.     <!-- iOS 相关meta标签 -->
  7.     <meta name="apple-mobile-web-app-capable" content="yes">
  8.     <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
  9.     <meta name="apple-mobile-web-app-title" content="随机舞蹈">
  10.    
  11.     <!-- 添加到主屏幕的图标 -->
  12.     <link rel="apple-touch-icon" href="icon-180.png">
  13.     <link rel="apple-touch-icon" sizes="152x152" href="icon-152.png">
  14.     <link rel="apple-touch-icon" sizes="180x180" href="icon-180.png">
  15.     <link rel="apple-touch-icon" sizes="167x167" href="icon-167.png">
  16.    
  17.     <!-- 启动画面 -->
  18.     <link rel="apple-touch-startup-image" href="launch.png">
  19.    
  20.     <title>随机舞蹈视频</title>
  21.     <style>
  22.         /* 防止iOS点击闪烁 */
  23.         * {
  24.             -webkit-tap-highlight-color: transparent;
  25.             -webkit-touch-callout: none;
  26.             -webkit-user-select: none;
  27.             user-select: none;
  28.         }
  29.         
  30.         /* 适配刘海屏和曲面屏 */
  31.         body {
  32.             padding-top: env(safe-area-inset-top);
  33.             padding-bottom: env(safe-area-inset-bottom);
  34.             padding-left: env(safe-area-inset-left);
  35.             padding-right: env(safe-area-inset-right);
  36.         }

  37.         /* 全局样式 */
  38.         * {
  39.             margin: 0;
  40.             padding: 0;
  41.             box-sizing: border-box;
  42.         }

  43.         body {
  44.             background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
  45.             min-height: 100vh;
  46.             display: flex;
  47.             align-items: center;
  48.             justify-content: center;
  49.             font-family: 'Microsoft YaHei', sans-serif;
  50.             flex-direction: column; /* 使内容垂直排列 */
  51.         }

  52.         .container {
  53.             width: 95%;
  54.             max-width: 1200px;
  55.             margin: 20px auto;
  56.             padding: 20px;
  57.             background: rgba(255, 255, 255, 0.1);
  58.             border-radius: 15px;
  59.             backdrop-filter: blur(10px);
  60.             box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  61.             padding-bottom: calc(20px + env(safe-area-inset-bottom));
  62.             position: relative; /* 使容器相对定位 */
  63.         }

  64.         .video-container {
  65.             position: relative;
  66.             width: 100%;
  67.             height: calc(100vh - 200px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  68.             min-height: 400px;
  69.             margin-bottom: 30px;
  70.             border-radius: 10px;
  71.             overflow: hidden;
  72.             box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  73.         }

  74.         video {
  75.             position: absolute;
  76.             top: 50%;
  77.             left: 50%;
  78.             width: 100%;
  79.             height: 100%;
  80.             object-fit: cover; /* 修改为cover以适配曲面屏,避免黑边 */
  81.             transform: translate(-50%, -50%); /* 居中对齐 */
  82.             border-radius: 10px;
  83.             background: #000;
  84.             touch-action: manipulation;
  85.         }

  86.         .controls {
  87.             display: flex;
  88.             justify-content: center;
  89.             gap: 20px;
  90.             flex-wrap: wrap;
  91.         }

  92.         button {
  93.             -webkit-appearance: none;
  94.             appearance: none;
  95.             min-width: 120px;
  96.             padding: 12px 25px;
  97.             font-size: 16px;
  98.             cursor: pointer;
  99.             border: none;
  100.             border-radius: 50px;
  101.             color: white;
  102.             font-weight: bold;
  103.             transition: all 0.3s ease;
  104.             background-size: 200% auto;
  105.             box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  106.         }

  107.         /* 所有按钮设置渐变色 */
  108.         .next-button {
  109.             background-image: linear-gradient(45deg, #FF6B6B, #FFE66D);
  110.         }

  111.         .refresh-button {
  112.             background-image: linear-gradient(45deg, #4ECDC4, #556270);
  113.         }

  114.         .play-toggle-button {
  115.             background-image: linear-gradient(45deg, #6C5CE7, #a367dc);
  116.         }

  117.         .like-button {
  118.             background-image: linear-gradient(45deg, #FF6B6B, #FFE66D);
  119.         }

  120.         .pip-button {
  121.             background-image: linear-gradient(45deg, #6bd0ff, #ce43b7);
  122.         }

  123.         button:hover {
  124.             background-position: right center;
  125.             transform: translateY(-2px);
  126.             box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  127.         }

  128.         /* 响应式设计 */
  129.         @media (max-width: 768px) {
  130.             .container {
  131.                 width: 98%;
  132.                 padding: 10px;
  133.             }

  134.             button {
  135.                 min-width: 100px;
  136.                 padding: 10px 20px;
  137.                 font-size: 14px;
  138.             }

  139.             .controls {
  140.                 gap: 10px;
  141.             }
  142.         }

  143.         /* 添加加载动画 */
  144.         @keyframes pulse {
  145.             0% { opacity: 1; }
  146.             50% { opacity: 0.5; }
  147.             100% { opacity: 1; }
  148.         }

  149.         .loading {
  150.             animation: pulse 1.5s infinite;
  151.         }

  152.         /* 添加iOS风格的加载动画 */
  153.         @keyframes ios-loading {
  154.             0% { transform: rotate(0deg); }
  155.             100% { transform: rotate(360deg); }
  156.         }

  157.         .loading::after {
  158.             content: '';
  159.             position: absolute;
  160.             top: 50%;
  161.             left: 50%;
  162.             width: 40px;
  163.             height: 40px;
  164.             margin: -20px 0 0 -20px;
  165.             border: 4px solid #fff;
  166.             border-top-color: transparent;
  167.             border-radius: 50%;
  168.             animation: ios-loading 1s linear infinite;
  169.         }

  170.         /* 添加视频播放器控件的iOS风格 */
  171.         video::-webkit-media-controls-panel {
  172.             background-image: linear-gradient(transparent, rgba(0, 0, 0, 0.5));
  173.         }

  174.         /* 爱心动画效果 */
  175.         @keyframes floatUp {
  176.             0% {
  177.                 transform: translateY(0) scale(1);
  178.                 opacity: 1;
  179.             }
  180.             100% {
  181.                 transform: translateY(-100px) scale(1.5);
  182.                 opacity: 0;
  183.             }
  184.         }

  185.         .floating-heart {
  186.             position: absolute;
  187.             font-size: 20px;
  188.             animation: floatUp 3s forwards;
  189.             pointer-events: none;
  190.         }

  191.         /* 提示框样式 */
  192.         .alert {
  193.             position: absolute;
  194.             top: 50%;
  195.             left: 50%;
  196.             transform: translate(-50%, -50%);
  197.             background: rgba(255, 255, 255, 0.8);
  198.             padding: 20px;
  199.             border-radius: 10px;
  200.             box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  201.             display: none; /* 默认隐藏 */
  202.         }

  203.         /* 版权信息样式 */
  204.         .copyright {
  205.             margin-top: 20px;
  206.             font-size: 14px;
  207.             text-align: center; /* 居中显示 */
  208.             background: linear-gradient(45deg, #08962b, #431b8d); /* 渐变色 */
  209.             -webkit-background-clip: text;
  210.             -webkit-text-fill-color: transparent; /* 文字填充透明 */
  211.         }
  212.     </style>
  213. </head>
  214. <body>
  215.     <div class="container">
  216.         <div class="video-container">
  217.             <video id="danceVideo" controls>
  218.                 您的浏览器不支持视频播放。
  219.             </video>
  220.         </div>
  221.         <div class="controls">
  222.             <button class="next-button" onclick="nextVideo()">下一个</button>
  223.             <button class="refresh-button" onclick="refreshVideo()">刷新</button>
  224.             <button class="play-toggle-button" onclick="togglePlay()">暂停/播放</button>
  225.             <button class="like-button" onclick="createHearts()">点赞</button>
  226.             <button class="pip-button" onclick="togglePip()">画中画</button>
  227.         </div>
  228.         <div class="alert" id="alertBox">复制成功,请打开浏览器进行下载保存!</div>
  229.         <div class="copyright"><a href="https://www.dadawz.cn/" id="copyrightLink">© 2024 大大-随机舞蹈. 保留所有权利.</a></div> <!-- 大大博客 https://www.dadawz.cn/-->
  230.     </div>

  231.     <script>
  232.         /**
  233.          * [url=home.php?mod=space&uid=8139]@type[/url] {HTMLVideoElement}
  234.          */
  235.         const video = document.getElementById('danceVideo');

  236.         /**
  237.          * 视频源数组 - 可以替换为您自己的API或视频源
  238.          * @type {string[]}
  239.          */
  240.         const videoSources = [
  241.             'https://api.yviii.com/video/suiji.php',
  242.             'https://api.yviii.com/video/i.php',
  243.             'http://api.mhycloud.fun:81/api/dy',
  244.         ];

  245.         /**
  246.          * 获取随机视频源
  247.          * @returns {string} 随机视频URL
  248.          */
  249.         function getRandomVideo() {
  250.             const randomIndex = Math.floor(Math.random() * videoSources.length);
  251.             return videoSources[randomIndex];
  252.         }

  253.         /**
  254.          * 添加加载状态处理
  255.          */
  256.         function setLoading(isLoading) {
  257.             const video = document.getElementById('danceVideo');
  258.             if (isLoading) {
  259.                 video.classList.add('loading');
  260.             } else {
  261.                 video.classList.remove('loading');
  262.             }
  263.         }

  264.         /**
  265.          * 增强版的下一个视频函数
  266.          */
  267.         async function nextVideo() {
  268.             setLoading(true);
  269.             const newSrc = getRandomVideo();
  270.             // 确保不会连续播放同一个视频
  271.             if (newSrc === video.src) {
  272.                 return nextVideo();
  273.             }
  274.             video.src = newSrc;
  275.             try {
  276.                 await video.play();
  277.             } catch (error) {
  278.                 console.error('视频播放失败:', error);
  279.             }
  280.             video.oncanplay = () => {
  281.                 setLoading(false);
  282.             };
  283.         }

  284.         /**
  285.          * 刷新当前视频
  286.          */
  287.         function refreshVideo() {
  288.             video.currentTime = 0;
  289.             video.play();
  290.         }

  291.         /**
  292.          * 切换视频播放/暂停状态
  293.          */
  294.         function togglePlay() {
  295.             if (video.paused) {
  296.                 video.play();
  297.             } else {
  298.                 video.pause();
  299.             }
  300.         }

  301.         /**
  302.          * 创建爱心动画效果
  303.          */
  304.         function createHearts() {
  305.             for(let i = 0; i < 15; i++) {
  306.                 setTimeout(() => {
  307.                     const heart = document.createElement('div');
  308.                     heart.innerHTML = ['❤️', '⭐', '✨', '💖', '💕'][Math.floor(Math.random() * 5)];
  309.                     heart.className = 'floating-heart';
  310.                     heart.style.left = Math.random() * window.innerWidth + 'px';
  311.                     heart.style.fontSize = (20 + Math.random() * 20) + 'px';
  312.                     document.body.appendChild(heart);
  313.                     
  314.                     setTimeout(() => {
  315.                         heart.remove();
  316.                     }, 3000);
  317.                 }, i * 100);
  318.             }
  319.         }

  320.         /**
  321.          * 切换画中画模式
  322.          */
  323.         function togglePip() {
  324.             if (document.pictureInPictureElement) {
  325.                 document.exitPictureInPicture().catch(error => {
  326.                     console.error('退出画中画失败:', error);
  327.                 });
  328.             } else {
  329.                 video.requestPictureInPicture().catch(error => {
  330.                     console.error('进入画中画失败:', error);
  331.                 });
  332.             }
  333.         }

  334.         // 禁用双指缩放
  335.         document.addEventListener('gesturestart', function(e) {
  336.             e.preventDefault();
  337.         });

  338.         // 处理iOS的各种手势
  339.         let touchStartY = 0;
  340.         document.addEventListener('touchstart', function(e) {
  341.             touchStartY = e.touches[0].clientY;
  342.         }, { passive: false });

  343.         document.addEventListener('touchmove', function(e) {
  344.             const touchY = e.touches[0].clientY;
  345.             const delta = touchStartY - touchY;

  346.             // 如果不是在视频上滑动,则阻止默认行为
  347.             if (!e.target.matches('video')) {
  348.                 e.preventDefault();
  349.             }
  350.         }, { passive: false });

  351.         // 添加iOS的错误处理
  352.         video.addEventListener('error', function(e) {
  353.             console.error('视频加载错误:', e.target.error);
  354.             nextVideo();
  355.         });

  356.         // 处理iOS后台播放
  357.         document.addEventListener('visibilitychange', function() {
  358.             if (document.hidden) {
  359.                 video.pause();
  360.             }
  361.         });

  362.         // 初始化
  363.         window.onload = function() {
  364.             nextVideo();
  365.             video.addEventListener('ended', nextVideo); // 播放完自动播放下一个
  366.         };
  367.     </script>
  368. </body>
  369. </html>
复制代码


免责
帖子地址打造全网最多免费游戏网站
今日来客 列表模式
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

本站已运行 ©2013-2026

QQ|Archiver|手机版|小黑屋|蔡州手游 |网站地图

GMT+8, 2025-11-13 15:42

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

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