|
|
- <!DOCTYPE html>
- <html lang="zh">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>西瓜播放器与DASH示例</title>
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/xgplayer@latest/dist/xgplayer.min.css">
- <style>
- #xgplayer {
- width: 100%;
- height: auto;
- }
- </style>
- </head>
- <body>
- <h1>西瓜播放器与DASH协议示例</h1>
- <div id="xgplayer"></div>
- <script src="https://cdn.jsdelivr.net/npm/xgplayer@latest/dist/xgplayer.min.js"></script>
- <script>
- const player = new Player({
- id: 'xgplayer',
- url: 'https://example.com/path/to/your/manifest.mpd', // 替换为您的DASH清单文件URL
- type: 'dash', // 指定视频类型为DASH
- autoplay: true, // 自动播放
- controls: true, // 显示控制条
- width: '100%', // 播放器宽度
- height: 'auto' // 播放器高度
- });
- </script>
- </body>
- </html>
复制代码- <?php
- $inputFile = 'input.mp4';
- $outputFile = 'output.mp4';
- $command = "ffmpeg -i $inputFile -c:v libx264 -preset fast -crf 22 $outputFile";
- exec($command, $output, $return_var);
- if ($return_var === 0) {
- echo "转换成功!";
- } else {
- echo "转换失败!";
- }
- ?>
复制代码
|
|