このチュートリアルでは、フロープレーヤーのビデオサイズを動的に調整する方法を示しています。これは、レスポンシブデザインや、さまざまなビットレートと解像度でビデオを処理する場合に特に便利です(通常、16:9のアスペクト比を維持します)。
関連記事:
// Resize video function $('.change-size-btn').on('click', function(e) { e.preventDefault(); // Get video ID const videoId = $(this).closest('.fms').attr('id'); // Determine display type (fixed, fit, fullscreen) const btnElem = $(this); const vidElem = $('#' + videoId).find('object'); const widgetContainer = $('#' + videoId).closest('.video-container'); const displayType = btnElem.attr('vidDisplayType'); let width, height; // Fixed dimensions if (displayType === 'fixed') { height = btnElem.attr('vidHeight'); width = btnElem.attr('vidWidth'); } // Fit to container else if (displayType === 'fit') { height = widgetContainer.height(); width = widgetContainer.width(); } // Resize video console.log(`Resizing video to ${width} x ${height}...`); vidElem.height(height).width(width).fadeIn("slow", function() { console.log('Resize complete.'); $f(videoId).getScreen().animate({ width: width, height: height }, 500); }); });
以上がFlowPlayerの動的ビデオサイズの詳細内容です。詳細については、PHP 中国語 Web サイトの他の関連記事を参照してください。