Greasy Fork is available in English.

HTML5ビデオプレーヤーの拡張スクリプト

ビデオ拡張スクリプトは、Bilibili、Douyin、Tencent Video、Youku、iQiyi、Xigua Video、YouTube、Weibo Video、Zhihu Video、Sohu Video、NetEase Open Course、Baidu ネットワーク ディスク、Alibaba クラウド ディスクなど、すべての H5 ビデオ Web サイトをサポートします。テッド、インスタグラム、ツイッターなど 完全なショートカット キー コントロール、サポート: 倍速再生/加速再生、ビデオ スクリーンショット、ピクチャー イン ピクチャー、フルスクリーン Web ページ、明るさ、彩度、コントラストの調整、カスタム構成の強化、その他の機能により、快適なオンラインを提供します。ビデオ再生体験。 ビデオ広告、オンライン チュートリアル/教育ビデオなどを早送りする機能もあります。

< HTML5ビデオプレーヤーの拡張スクリプトについてのフィードバック

質問/コメント

§
投稿日: 2022/06/24

旋转视频画面之后,上下两边的画面显示不全,我参考这个脚本https://greasyfork.org/scripts/371665-yuotubequickdo,修复了这个问题,大佬看看行不行。 // 按键S:画面旋转 90 度 if (keyCode === 83) { // t.rotate += 90; // if (t.rotate % 360 === 0) t.rotate = 0; // player.style.transform = scale(${t.scale}) translate(${t.translate.x}px, ${t.translate.y}px) rotate( ${t.rotate}deg); // t.tips(i18n.t('tipsMsg.imgrotate') + t.rotate + '°'); const qT = (query) => document.getElementsByTagName(query); const h5Player = qT('video')[0]; const transformCss = getComputedStyle(h5Player).transform; let matrix = transformCss.match('matrix\((.*)\)'); let rad = 0; if (matrix) { matrix = matrix[1].split(','); if (matrix) { rad = Math.atan2(matrix[1], matrix[0]); } } const deg = parseFloat((rad * 180 / Math.PI).toFixed(1)) + 90; let transform = rotate(${deg}deg); if (deg == 0 || deg == 180) { transform += scale(1); } else { transform += scale(${h5Player.videoHeight / h5Player.videoWidth}); } player.style.transform = transform; t.tips(i18n.t('tipsMsg.imgrotate') + deg + '°'); }

§
投稿日: 2022/06/24
編集日: 2022/06/24

// 按键S:画面旋转 90 度
if (keyCode === 83) {
// t.rotate += 90;
// if (t.rotate % 360 === 0) t.rotate = 0;
// player.style.transform = `scale(${t.scale}) translate(${t.translate.x}px, ${t.translate.y}px) rotate( ${t.rotate}deg)`;
// t.tips(i18n.t('tipsMsg.imgrotate') + t.rotate + '°');
const qT = (query) => document.getElementsByTagName(query);
const h5Player = qT('video')[0];
const transformCss = getComputedStyle(h5Player).transform;
let matrix = transformCss.match('matrix\\((.*)\\)');
let rad = 0;
if (matrix) {
matrix = matrix[1].split(',');
if (matrix) {
rad = Math.atan2(matrix[1], matrix[0]);
}
}
const deg = parseFloat((rad * 180 / Math.PI).toFixed(1)) + 90;
let transform = `rotate(${deg}deg)`;
if (deg == 0 || deg == 180) {
transform += `scale(1)`;
} else {
transform += `scale(${h5Player.videoHeight / h5Player.videoWidth})`;
}
player.style.transform = transform;
t.tips(i18n.t('tipsMsg.imgrotate') + deg + '°');
}

返信を投稿

返信を投稿するにはログインしてください。