-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathh265-test.html
37 lines (36 loc) · 1.32 KB
/
h265-test.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
<meta name="renderer" content="webkit">
<title>h265 测试</title>
<meta name="description" content="首页描述"/>
<meta name="keywords" content="首页关键词"/>
<meta name="author" content="Web Layout:amu"/>
<meta name="format-detection" content="telephone=no,date=no,address=no,email=no,url=no"/>
<link rel="stylesheet" href="./src/style/base.css?v=1">
</head>
<body class="paper">
<div id="wrap">
</div>
<script>
console.log(MediaSource.isTypeSupported('video/mp4; codecs="hev1.1.6.L120.90"'))//safari true
let videoEl = document.createElement('video')
videoEl.src = './video-h265.mkv'
console.log(videoEl,typeof videoEl.canPlayType == 'function')
let supportHEVC = function(video) {
if (typeof videoEl.canPlayType == 'function') {
var playable = videoEl.canPlayType('video/mp4; codecs="hev1.1.6.L120.90"');//safari no
console.log(playable)
if ((playable.toLowerCase() == 'maybe') || (playable.toLowerCase() == 'probably')) {
return true;
}
}
return false;
};
console.log(supportHEVC())
</script>
</body>
</html>