你可以让嵌入式MP3继续播放它从哪里停止播放吗? [英] Can you make an embedded MP3 keep playing from where it left off?

查看:98
本文介绍了你可以让嵌入式MP3继续播放它从哪里停止播放吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以制作嵌入在网页中的mp3,如果重新加载页面,则可以继续播放它停止播放的内容?也许到cookie或其他方法。

 < embed src =track1.mp3>< / embed> ; 

例如:

track1.mp3嵌入在网页中;它是3分钟长。访问者加载网页并收听曲目的前1分25秒;然后关闭网页。我可以让track1.mp3在下次访问网页时从1分25秒开始播放吗? 看到一款基于闪存的MP3播放器提供了一种方法来做到这一点,在页面之间切换时只有很小的中断,但是不能在我的生活中找到想到任何搜索术语的项目。 (这个大词是无缝播放)。无论如何,这是一个已停产的项目,最近一次更新是在2006年的某个时候,所以从长远来看,这可能不会有太大用处。

但是现在,每个人并且他们的狗拥有一个支持JavaScript的浏览器,可能会改变您的页面架构以使其使用Ajax获取新页面是更好的方法。对于非JS浏览器,它可以被优雅地降级,并且可以无缝地播放JavaScript用户的任何技巧(因为该页面不会被重新加载)。



请参阅此处讨论此方法的优缺点: 为什么不只是使用页面请求的ajax来加载页面内容?



以及一些指针如何开始: JQuery / AJAX:使用动态内容加载外部DIV


Is it possible to make an mp3, that is embedded in a webpage, keep playing from where it left off if the page is reloaded? Perhaps into a cookie or with any other method.

<embed src="track1.mp3"></embed>

For example:

track1.mp3 is embedded in a webpage; it is 3 minutes long. A visitor loads the webpage and listens to the first 1 minute and 25 seconds of the track; then closes the webpage. Can I make track1.mp3 start playing from 1 minute and 25 seconds the next time that person visits the webpage?

解决方案

I have seen one Flash-based MP3 player providing an approach to do this, with only a minimal disruption when switching between pages, but can't for the life of me find the project with any search term that comes to mind. (The big word was "seamless playback"). Anyway, it was a discontinued project, the last update being sometime in 2006 so it wouldn't probably be much use on the long term.

But nowadays, with every man and their dog having a JavaScript-enabled browser, maybe changing your page's architecture to making it fetch new pages using Ajax is the better approach. It can be made degrade gracefully for non-JS browsers, and would allow for seamless playing without any tricks for JavaScript users (because the page is never reloaded).

See discussion about the pros and cons of the approach here: Why not just using ajax for Page Requests to load the page content?

And some pointers how to get started: JQuery/AJAX: Loading external DIVs using dynamic content

这篇关于你可以让嵌入式MP3继续播放它从哪里停止播放吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆