如何在WordPress中添加MP3音频文件

Uploading audio and video files to WordPress using the Media Uploader is easy. Even though the media uploader recognizes these files and display appropriate file-type icons next to them, WordPress does not have a media player that can play these files. You can use a third party platform like SoundCloud to embed audio, but the goal of this article is to allow you to upload audio files using the default media uploader and embed them into a post or page. In this article, we will show you how to add MP3 audio files in WordPress using oEmbed.

使用Media Uploader将音频和视频文件上传到WordPress很容易。 即使媒体上传器可以识别这些文件并在它们旁边显示适当的文件类型图标,但WordPress仍没有可以播放这些文件的媒体播放器。 您可以使用SoundCloud之类的第三方平台嵌入音频,但是本文的目的是允许您使用默认的媒体上传器上传音频文件并将其嵌入到帖子或页面中。 在本文中,我们将向您展示如何使用oEmbed在WordPress中添加MP3音频文件。

MP3 and Ogg Audio Files Embed in WordPress

Firstly, you need to install and activate oEmbed HTML5 audio plugin. After activating the plugin, go to the post or page where you want to add audio file.

首先,您需要安装并激活oEmbed HTML5音频插件。 激活插件后,转到您要添加音频文件的帖子或页面。

Click on Add Media button to upload audio file from your computer. You can upload files in mp3, ogg, and wav formats. Once you have uploaded the file, copy file location and paste raw URL in your post.

单击添加媒体按钮以从计算机上载音频文件。 您可以上传mp3,ogg和wav格式的文件。 上传文件后,复制文件位置并将原始URL粘贴到帖子中。

Copy File Location in Media Uploader

The plugin will use HTML5 audio tag to automatically embed audio file from your URL. While using this method, you will notice that the media player for ogg and mp3 files looks different in Firefox. Currently, Firefox does not support oEmbed HTML5 audio for MP3 files so the plugin falls back to a flash player instead of HTML5 when it detects Firefox. With the flash fallback, this method works for most browsers and platforms.

该插件将使用HTML5音频标签从您的URL自动嵌入音频文件。 使用此方法时,您会注意到ogg和mp3文件的媒体播放器在Firefox中看起来有所不同。 目前,Firefox不支持MP3文件的嵌入式HTML5音频,因此,当插件检测到Firefox时,它会退回到Flash播放器而不是HTML5。 借助Flash后备广告,该方法适用于大多数浏览器和平台。

We hope you found this article useful. If you are using some other solution to embed audio files on your site please share it with us in the comments below.

我们希望您觉得本文有用。 如果您使用其他解决方案在您的网站上嵌入音频文件,请在下面的评论中与我们分享。

翻译自: https://www.wpbeginner.com/plugins/add-mp3-audio-files-wordpress/

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值