js 获取视频封面
// 获取封面 drawVideo(video) { return new Promise((res, rej) => { const canvas = document.createElement('canvas') const ctx = canvas.getContext('2d') canvas.width = video.width canvas.height = video.height ...
Search for a command to run...
Articles tagged with #js
// 获取封面 drawVideo(video) { return new Promise((res, rej) => { const canvas = document.createElement('canvas') const ctx = canvas.getContext('2d') canvas.width = video.width canvas.height = video.height ...
function handleResize() { var htmlWidth = document.documentElement.clientWidth || document.body.clientWidth let htmlDom = document.getElementsByTagName('html')[0] // 处理不同页面宽度下rem的值 if (htmlWidth < 1400 && htmlWidth > 1000) { htm...
js数据类型 原始数据类型:number、string、boolean、undefined、null、symbol、bigint 引用数据类型:object(包括Array,Function、Object类等) 区别:原始数据类型的存放在栈中,引用数据类型存放在堆中,它的地址在栈中,一般我们访问就是它的地址 闭包 概念:函数嵌套函数,内部函数能访问外部变量,这个变量称为自由变量 解决的问题:保存变量 带来的问题:会造成内存泄漏问题 闭包的应用:防抖节流 promise 概念:...