Vimeo 視頻在產品頁面上不起作用。它顯示縮略圖,但點擊時,它顯示加載 gif,但視頻沒有播放。在管理面板上將視頻添加到產品時出現問題,它顯示未找到視頻錯誤。我通過更新此處給出的 app/code/Magento/ProductVideo/view/adminhtml/web/js/get-video-information.js 檔案來修復它https://github.com/magento/magento2/commit/f2231f8d953bb650c3462a824716fd8972c6bb6c。但是現在視頻沒有在前端播放。
uj5u.com熱心網友回復:
您在前端產品頁面上顯示的具體錯誤是什么?請確認您的 Magento 版本和重現問題的步驟。
您可以檢查 Magento 2.3.5 的以下修復 https://github.com/magento/magento2/commit/f2231f8d953bb650c3462a824716fd8972c6bb6c
對于 Magento 2.4.1 https://github.com/magento/magento2/pull/31767/files
應用補丁在本地修復問題:https: //support.magento.com/hc/en-us/articles/360047139492
https://support.magento.com/hc/en-us/articles/4405321730445-MDVA-38308-Error-after-adding-Vimeo-videos-to-disabled-products
使用命令通過 composer 應用補丁:
composer require magento/quality-patches
查看補丁串列。
./vendor/bin/magento-patches status
您必須在應用補丁后清理快取以查看 Magento 應用程式中的更改:
/bin/magento cache:clean
而已
uj5u.com熱心網友回復:
我可以通過更新 lib/web/fotorama/fotorama.js 來解決這個問題
我改變了函式playVideo& onStageTap。
that.playVideo = function () {
var dataFrame = activeFrame,
// video = dataFrame.video,
video = null,
_activeIndex = activeIndex;
if(dataFrame.hasOwnProperty('videoUrl') && dataFrame.videoUrl){
video = dataFrame.videoUrl.replace("vimeo.com", "player.vimeo.com/video");
}
// if (typeof video === 'object' && dataFrame.videoReady) {
if (dataFrame.videoUrl) {
o_nativeFullScreen && that.fullScreen && that.cancelFullScreen();
waitFor(function () {
return !fullScreenApi.is() || _activeIndex !== activeIndex;
}, function () {
if (_activeIndex === activeIndex) {
dataFrame.$video = dataFrame.$video || $(div(videoClass)).append(createVideoFrame(video));
dataFrame.$video.appendTo(dataFrame[STAGE_FRAME_KEY]);
$wrap.addClass(wrapVideoClass);
$videoPlaying = dataFrame.$video;
stageNoMove();
$arrs.blur();
$fullscreenIcon.blur();
triggerEvent('loadvideo');
}
});
}
return this;
};
function onStageTap(e, toggleControlsFLAG) {
var target = e.target,
$target = $(target);
// if ($target.hasClass(videoPlayClass)) {
if ($target.hasClass('fotorama-video-container')) {
that.playVideo();
} else if (target === fullscreenIcon) {
that.toggleFullScreen();
} else if ($videoPlaying) {
target === videoClose && unloadVideo($videoPlaying, true, true);
} else if (!$fotorama.hasClass(fullscreenClass)) {
that.requestFullScreen();
}
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/516747.html
