-
Notifications
You must be signed in to change notification settings - Fork 11
/
index.html
115 lines (114 loc) · 4.38 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>PostbirdMp4ToBlob</title>
<link rel="stylesheet" href="./css/bootstrap.min.css">
<script src="./js/postbird-mp4-to-blob.min.js"></script>
<style>
*{
margin:0;
padding:0;
box-sizing: border-box;
}
html,body{
}
video{
width:200px;
}
.video-container{
text-align: center;
}
small{
color:#aaaaaa;
}
</style>
</head>
<body>
<div class="jumbotron">
<div class="container ">
<h1>PostbirdMp4ToBlob <small>将 MP4 video 转 blob 的js插件</small></h1>
<p>利用 javascript 将 video src 转 blob</p>
<p><a class="btn btn-link" target="_blank" href="https://github.com/postbird/PostbirdMp4ToBlob" role="button">Github:https://github.com/postbird/PostbirdMp4ToBlobthub</a></p>
<p><a class="btn btn-link" target="_blank" href="https://gitee.com/postbird/PostbirdMp4ToBlob" role="button">Gitosc:https://gitee.com/postbird/PostbirdMp4ToBlob</a></p>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-md-12">
<h2>演示效果:</h2>
</div>
<div class="col-md-6">
<div class="page-header">
<h3>使用插件,加载blob </h3>
<p>审查 video 元素,查看 src</p>
</div>
<div class="video-container">
<video id="video" webkit-playsinline="true" controls playsinline="true" type="video/mp4" x5-video-player-type="h5" >
</video>
</div>
</div>
<div class="col-md-6">
<div class="page-header">
<h3>未使用插件,直接加载视频 </h3>
<p>审查 video 元素,查看 src</p>
</div>
<div class="video-container">
<video id="video2" webkit-playsinline="true" controls playsinline="true" type="video/mp4" x5-video-player-type="h5" src="./video/v0-new.mp4" >
</video>
</div>
</div>
</div>
</div>
<hr>
<div class="container">
<div class="page-header">
<h3>使用方法:</h3>
</div>
<div>
<h5>1、引入js文件:</h5>
<pre>./js/postbird-mp4-to-blob.js</pre>
</div>
<div>
<h5>2、调用插件:</h5>
<pre>
var url = './video/v0-new.mp4'; // 视频url
var mimeCodec = 'video/mp4; codecs="avc1.640028, mp4a.40.2"'; // 编码格式
PostbirdMp4ToBlob.init('#video',url,mimeCodec); // #video 是选择器
</pre>
</div>
</div>
<div class="container">
<div class="page-header">
<h3>可能的错误:</h3>
<p>MediaSource 错误:Failed to execute 'endOfStream' on 'MediaSource': The MediaSource's readyState is not 'open'.</p>
</div>
<div>
<p>
解决该错误请参考:<a href="http://www.ptbird.cn/mediadource-readyState-is-not-open.html" target="_blank">http://www.ptbird.cn/mediadource-readyState-is-not-open.html</a>
</p>
</div>
<div class="page-header">
<h3>获取视频的 Codecs 信息:</h3>
<p>一般来说直接使用 'video/mp4; codecs="avc1.640028, mp4a.40.2"' 是没有问题的</p>
</div>
<div>
<p>
获取视频 Codecs 请参考(文章最后):<a href="http://www.ptbird.cn/mediadource-readyState-is-not-open.html" target="_blank">http://www.ptbird.cn/mediadource-readyState-is-not-open.html</a>
</p>
</div>
</div>
<hr>
<div class="footer" style="text-align:center;padding:20px 0;">
<a href="http://www.ptbird.cn" target="_blank">Powered by Postbird - www.ptbird.cn</a>
</div>
</body>
<script>
var url = './video/v0-new.mp4';
var mimeCodec = 'video/mp4; codecs="avc1.640028, mp4a.40.2"';
PostbirdMp4ToBlob.init('#video',url,mimeCodec);
</script>
</html>