【问题标题】:Chrome & Firefox could not load the video file on the wordpress siteChrome 和 Firefox 无法在 wordpress 网站上加载视频文件
【发布时间】:2018-04-11 03:18:49
【问题描述】:

我有一个 wordpress 网站,用户可以在那里登录并在仪表板中观看我(管理员)上传的电影。视频很长,文件很大。 不幸的是,它们不能在 chrome 和 firefox 上加载。网站仅显示视频的控件,但看起来它们已被禁用。

这是我的视频的代码:

<video id="trainingVideo<?php echo $tb; ?>" class="training-video embed-responsive-item"  autoplay="autoplay" controls="controls">
     <source src="<?php echo $video_url; ?>" type="<?php echo $video['mime_type'] ?>">
</video>

这里是调试控制台:

jquery-migrate.min.js:2 JQMIGRATE: Migrate is installed, version 1.4.1
/wp-content/uploads/CKZ-Informacje-o-szkoleniu.mp4 Failed to load resource: the server responded with a status of 403 (Forbidden)
/wp-content/uploads/CKZ-prawo-cywilne.mp4 Failed to load resource: the server responded with a status of 403 (Forbidden)
/wp-content/uploads/CKZ-prawo-handlowe.mp4 Failed to load resource: the server responded with a status of 403 (Forbidden)
/wp-content/uploads/CKZ-podatki-op%C5%82aty-i-ubezpieczenia.mp4 Failed to load resource: the server responded with a status of 403 (Forbidden)
/wp-content/uploads/CKZ-organizacja-i-zarz%C4%85dzanie-przedsi%C4%99biorstwem.mp4 Failed to load resource: the server responded with a status of 508 (unused)
/wp-content/uploads/CKZ-prawo-transportowe.mp4 Failed to load resource: the server responded with a status of 508 (unused)
/wp-content/uploads/CKZ-finansowanie-inwestycji-i-przedsi%C4%99biorstw.mp4 Failed to load resource: the server responded with a status of 403 (Forbidden)
/wp-content/uploads/CKZ-czas-pracy-kierowc%C3%B3w.mp4 Failed to load resource: the server responded with a status of 403 (Forbidden)
/wp-content/uploads/CKZ-bezpiecze%C5%84stwo-w-transporcie.mp4 Failed to load resource: the server responded with a status of 403 (Forbidden)
/wp-content/uploads/CKZ-przewozy-specjalistyczne.mp4 Failed to load resource: the server responded with a status of 403 (Forbidden)
/wp-content/uploads/CKZ-kontrole-w-transporcie-drogowym.mp4 Failed to load resource: the server responded with a status of 508 (unused)
/wp-content/uploads/CKZ-porozumienia-i-organizacje-w-transporcie-drogowym.mp4 Failed to load resource: the server responded with a status of 508 (unused)
/wp-content/uploads/CKZ-zadania-egzaminacyjne-film.mp4 Failed to load resource: the server responded with a status of 508 (unused)
/wp-content/uploads/CKZ-finanse-i-ksi%C4%99gowo%C5%9B%C4%87.mp4 Failed to load resource: the server responded with a status of 404 (Not Found)
/wp-content/uploads/CKZ-zasady-za%C5%82adunku-pojazd%C3%B3w.mp4 Failed to load resource: the server responded with a status of 404 (Not Found)
/wp-content/uploads/CKZ-prawo-pracy.mp4 Failed to load resource: the server responded with a status of 404 (Not Found)

Microsoft Edge 不显示任何错误。你能帮我解决这个问题吗?

【问题讨论】:

    标签: php wordpress google-chrome firefox video


    【解决方案1】:

    您需要添加 2 个不同的源文件来播放视频。

    第一个是mp4

    第二个是ogg

    之后结构将是

    <video id="trainingVideo<?php echo $tb; ?>" class="training-video embed-responsive-item"  autoplay="autoplay" controls="controls">
        <source src="<?php echo $video_url_mp4; ?>">  <!-- mp4 -->
        <source src="<?php echo $video_url_ogg; ?>"> <!-- ogg -->
    </video>
    

    【讨论】:

    • 谢谢,但出现了另一个问题。我现在在尝试上传 OGG 文件时出现错误为了安全起见,不允许使用此文件类型
    • 好的,我已经上传了OGG文件,但是控制台仍然有错误:wp-content/uploads/SampleVideo_1280x720_1mb-1.ogg net::ERR_ABORTED
    • 您是否在 wordpress 媒体上传中遇到此错误?
    • 我已经上传文件没有错误。当我想以登录用户的身份观看视频时,稍后会发生错误。视频仅适用于 Microsoft Edge。
    • 能否请您提供网站链接,以便我更好地理解它
    猜你喜欢
    • 2012-08-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-09-26
    • 2015-07-14
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多