js实现多视频合并预览代码

代码语言:html

所属分类:多媒体

代码描述:js实现多视频合并预览代码

代码标签: js 多视频 合并 预览 代码

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>视频合并预览工具</title>
    <style>
        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }
        body {
            font-family: 'Arial', sans-serif;
            background-color: #f5f5f5;
            color: #333;
            padding: 20px;
            max-width: 1200px;
            margin: 0 auto;
        }
        h1 {
            text-align: center;
            margin-bottom: 20px;
            color: #2c3e50;
        }
        .container {
            display: flex;
            flex-direction: column;
            gap: 20px;
        }
        .upload-section {
            background-color: #fff;
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        }
        .upload-btn {
            background-color: #3498db;
            color: white;
            border: none;
            padding: 10px 20px;
            border-radius: 4px;
            cursor: pointer;
            font-size: 16px;
            transition: background-color 0.3s;
        }
        .upload-btn:hover {
            background-color: #2980b9;
        }
        .preview-section {
            background-color: #fff;
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        }
        .video-container {
            width: 100%;
            max-width: 800px;
            margin: 0 auto;
            background-color: #000;
            border-radius: 8px;
            overflow: hidden;
        }
        #previewVideo {
            width: 100%;
            display: block;
        }
        .timeline-container {
            background-color: #fff;
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
            margin-top: 20px;
        }
        .timeline {
            width: 100%;
            min-height: 100px;
            background-color: #ecf0f1;
            border-radius: 4px;
            padding: 10px;
            display: flex;
            gap: 5px;
            overflow-x: auto;
            position: relative;
        }
        .timeline-indicator {
            position: absolute;
            width: 2px;
            height: 100%;
            background-color: red;
            top: 0;
            left: 0;
            pointer-events: none;
            z-index: 10;
        }
        .video-clip {
            min-width: 120px;
            height: 80px;
            background-color: #3498db;
            border-radius: 4px;
            display: flex;
            flex-direction: column;
            padding: 5px;
            cursor: pointer;
            position: relative;
            overflow: hidden;
        }
        .video-clip.active {
            border: 2px solid #e74c3c;
        }
        .video-clip-thumbnail {
            width: 100%;
            height: 50px;
            background-color: #2c3e50;
            border-radius: 2px;
            overflow: hidden;
        }
        .video-clip-thumbnail img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        .video-clip-title {
            margin-top: 5px;
            font-size: 12px;
            color: white;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .video-clip-duration {
            position: absolute;
            bottom: 5px;
            right: 5px;
            font-size: 10px;
            background-color: rgba(0, 0, 0, 0.6);
            color: white;
            padding: 2px 4px;
            border-radius: 2px;
        }
        .controls {
            display: flex;
            gap: 10px;
            margin-top: 10px;
            justify-content: center;
        }
        button {
            background-color: #3498db;
            color: white;
            border: none;
            padding: 8px 15px;
            border-radius: 4px;
            cursor: pointer;
            font-size: 14px;
            transition: background-color 0.3s;
        }
        button:hov.........完整代码请登录后点击上方下载按钮下载查看

网友评论0