H.265 Player 在线播放器Demo1DEMO
currentFrame:0
import h265player from "h265player";
import Events from "h265player/dist/events";
const el = document.querySelector(".play-container");
const src = "https://homfen.github.io/h265player/data/video2/video.m3u8";
const libPath = "https://homfen.github.io/h265player/lib/";
const player = new h265player(el, {
sourceURL: src,
type: "HLS",
libPath,
isLive: false,
playBackRate: 1,
muted: false,
controlBar: true,
maxBufferLength: 6000,
autoPlay: false,
autoScale: true,
defaultAlert: false
});
const timeupdate = () => {
if (!player) return;
const currentTime = player.currentTime;
console.log(currentTime);
};
player.events.on(Events.ImagePlayerRenderEnd, timeupdate);