如何在 Joomla 中完成的网站中添加背景音乐?

发布于 2024-10-09 05:15:00 字数 182 浏览 12 评论 0原文

我想添加在为客户开发的网站后台运行的音乐。该网站是在 Joomla 中生成的。有谁知道我可以添加在网站后台运行的音乐的任何组件(或任何方式)。

我知道这可以通过在所选模板的索引页面中嵌入标签来实现,但一个额外的要求(来自客户端)是每当任何访问者单击任何其他链接时,音乐应该继续播放,但不能从头开始。可行吗?有人可以帮我解决这个问题吗?

I want to add music which runs in the background of a website being developed for a client. The site is generated in Joomla. Does anyone knows about any component (or any way) through which I can add music which runs in the background of the website.

I know it can be achieved via embed tag in the index page of the selected template, but one additional requirement (from the client) is whenever any visitor clicks on any other link, the music should continue but not start from the beginning. Is it feasible? Can anyone help me regarding this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

離人涙 2024-10-16 05:15:00

能够播放音乐而无需每次单击链接时重新启动歌曲的唯一方法是将 Joomla 站点加载到一个框架中,并将音频播放器加载到另一个框架中。

不过,我强烈建议您与客户交谈。音频是高跳出率的常见原因,在框架中加载网站会搞砸您的搜索引擎优化。

The only way you are going to be able to play the music without restarting the song every time a link is clicked is to load the Joomla site in a frame and the audio player in another frame.

I would seriously recommend talking to the client though. Audio is a common cause of high bounce rates and loading the site in a frame is going to screw up your SEO.

最终幸福 2024-10-16 05:15:00

我还没有尝试过,但我想你可以添加一个自定义 html 模块。请阅读下面的 W3C 文档。
HTML5 音频

好的,我刚刚尝试过。

更新

我向 Joomla 添加了一个新模块。选择“自定义 HTML”。在内容中放置类似的内容

<p> <audio autoplay="autoplay" loop="loop" controls="controls">
    <source src="images\Audio\rock-guitar_fJqv24ru.mp3" type="audio/mpeg" />Your browser does not support the audio tag.</audio>

I haven't tried it but i'm thinking you can add a custom html module. Read the W3C documentation below.
HTML5 Audio

Ok, i just tried it.

Update

I added a new module to Joomla. Choose "Custom HTML". In the content put something similar to this

<p> <audio autoplay="autoplay" loop="loop" controls="controls">
    <source src="images\Audio\rock-guitar_fJqv24ru.mp3" type="audio/mpeg" />Your browser does not support the audio tag.</audio>

滥情哥ㄟ 2024-10-16 05:15:00

我说不要这样做...

但是,如果您仍然想继续背景音乐创意...这里有2个很好的插件/模块来完成这个侵入性功能。

  1. 音乐播放器 - 类似播放器的选项自动播放。访客将能够停止背景音乐并调整音量控制。
  2. JBGMusic - 演示链接已损坏JED,这里正在工作。不幸的用户将完全无法控制背景音乐。

I say DON'T DO IT...

However if you still want to carry on with background music idea... Here 2 good plug-in/module to accomplish this intrusive feature.

  1. Music Player - Player like option with auto-play. The visitor will be able to STOP background music and adjust volume control.
  2. JBGMusic - demo link is broken in JED, here is working one. Unfortunate user will have absolutely no control over background music.
少女情怀诗 2024-10-16 05:15:00

Have you looked at the Joomla extensions, there are a few media players there.
If you're after after an auto playing music in the background with no controls, you won't find it there though. If that is what you're planning please don't!

风追烟花雨 2024-10-16 05:15:00

最好是进入主题/模板标题代码,将其添加到正文中。

Best would be go to into the themes/template header code, add it to the body.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文