Skip to content

Commit

Permalink
Merge pull request #198 from girlbymirror/master
Browse files Browse the repository at this point in the history
update
  • Loading branch information
girlbymirror authored Oct 23, 2022
2 parents dea2d1c + dcd7e52 commit f684542
Showing 1 changed file with 38 additions and 6 deletions.
44 changes: 38 additions & 6 deletions index-debug.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@
<meta charset="utf-8" name="discord" content="numberwolf#8694">
<meta charset="utf-8" name="github" content="https://github.com/numberwolf/h265web.js">

<script src="dist/missile.js"></script> <!-- IMPORTANT -->
<script src="dist/h265webjs-v20221022.js"></script> <!-- IMPORTANT -->
<script src="dist/missile.js"></script>
<script src="dist/h265webjs-v20221022.js"></script>

<!--<script src="dist-multi-thread/missile-multi-thread.js"></script>
<script src="dist-multi-thread/h265webjs-v20221022.js"></script>-->
<!-- <script src="dist-multi-thread/missile-multi-thread.js"></script>
<script src="dist-multi-thread/h265webjs-v20220828.js"></script> -->

<style>
</style>
Expand All @@ -54,7 +54,10 @@
<div style="width:100%; height:25px; background-color:blue; color:white;">
1. Input Play URL (Editable)
</div>
<!-- <input id="url-input" style="width:100%; height: 20px; background-color: rgba(30,31,20,1); color:rgba(240,181,53,1);" value="http://127.0.0.1/live/test.flv"> -->
<input id="url-input" style="width:100%; height: 20px; background-color: rgba(30,31,20,1); color:rgba(240,181,53,1);" value="example_normal/hevc_test_moov_set_head_16s.mp4">

<!--<input id="url-input" style="width:100%; height: 20px; background-color: rgba(30,31,20,1); color:rgba(240,181,53,1);" value="http://flv.vaiwan.com/live/test.live.flv">-->
</input>
<div style="width:100%; height:25px; background-color:blue; color:white;">
2. Input Player Config (Editable)
Expand Down Expand Up @@ -117,6 +120,8 @@
|
<button onclick="nextFrame()">1.Next Frame</button>
<button onclick="snapshot()">2.Snapshot</button>
<button onclick="playrate(0.5)">3.PlayRate 0.5</button>
<button onclick="resize(640, 200)">resize640x200</button>

<hr>

Expand All @@ -131,6 +136,10 @@
<a href="https://github.com/numberwolf/h265web.js">https://github.com/numberwolf/h265web.js</a>

<script>
if((/Safari/.test(navigator.userAgent) && !/Chrome/.test(navigator.userAgent))) {
alert("safari");
}

const h265webURL = "https://github.com/numberwolf/h265web.js";

var playerObj = null;
Expand Down Expand Up @@ -334,15 +343,38 @@
if (playerObj !== null) {
playerObj.playNextFrame();
}
}
}

function snapshot() {
const snapCanvas = document.querySelector("#snapshot-canvas");
if (playerObj !== null) {
playerObj.snapshot(snapCanvas);
loggerObj.scrollNewest("\r\nplayerObj.snapshot");
}
}
}

function playrate(rate=1.0) {
console.log(playerObj.player.videoTag);
if (playerObj !== null) {
let ret = playerObj.setPlaybackRate(rate);
loggerObj.scrollNewest(
"\r\nplayerObj playrate:"
+ ' ret:' + ret
+ ' tag:' + rate
+ ' res:' + playerObj.getPlaybackRate());
}
}

function resize(w, h) {
if (playerObj !== null) {
let ret = playerObj.resize(w, h);
loggerObj.scrollNewest(
"\r\nplayerObj resize:"
+ ' ret:' + ret
+ ' w:' + w
+ ' h:' + h);
}
}


window.onload = function() {
Expand Down

0 comments on commit f684542

Please sign in to comment.