mirror of
https://github.com/hevin-lee/EasyPlayerJs.git
synced 2026-06-15 14:20:02 +00:00
Add use cases
This commit is contained in:
19
demo/html/EasyWasmPlayer.js
Normal file
19
demo/html/EasyWasmPlayer.js
Normal file
File diff suppressed because one or more lines are too long
41
demo/html/index.html
Normal file
41
demo/html/index.html
Normal file
@@ -0,0 +1,41 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>EasyWasmPlayer</title>
|
||||
<script src="/EasyWasmPlayer.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h4 style="width:600px;margin: auto;">H265播放器</h4>
|
||||
<br>
|
||||
<div style="width:600px;height: 400px; background-color:pink;margin: auto;">
|
||||
<div id="newplay" onClick="onplay"></div>
|
||||
<p>列如:http://127.0.0.1:8080/flv/hls/stream.flv</p>
|
||||
<input type="text" id="value">
|
||||
<button id="btn">播放</button>
|
||||
</div>
|
||||
<script>
|
||||
// 播放器回调函数
|
||||
callbackfun = function (e) {
|
||||
console.log(e);
|
||||
}
|
||||
// 播放按钮
|
||||
var btn = document.getElementById('btn');
|
||||
// 地址栏
|
||||
var value = document.getElementById('value');
|
||||
// 实例播放器
|
||||
var player = new WasmPlayer(null, 'newplay', callbackfun,{
|
||||
Height:true
|
||||
})
|
||||
//播放事件 传入地址播放
|
||||
btn.onclick = function(){
|
||||
player.play(value.value,1);
|
||||
console.log(value.value);
|
||||
}
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
BIN
demo/html/libDecoder.wasm
Normal file
BIN
demo/html/libDecoder.wasm
Normal file
Binary file not shown.
Reference in New Issue
Block a user