gpt4 book ai didi

javascript - 玩家状态在Beatport与iframe上实现了javascript? soundcloud支持?

转载 作者:行者123 更新时间:2023-12-03 00:55:42 26 4
gpt4 key购买 nike

我已经使用iframe在许多网站上成功实现了静态播放器。到目前为止,这已经达到了我的目的,并且实现起来有些复杂。我经常需要通过php中的GET变量传递“框架”状态。我的一个客户一直在显示问题,很高兴看到网址栏中显示了网址,这现在让我重新考虑了自己的方法。

在查看Beatport的html5播放器的源代码时,似乎他们使用的是JavaScript实例化的播放器,该播放器看上去非常解剖且明确。那么...他们是否跟踪玩家状态并将这些变量从一页传递到另一页?他们的平台是什么? PHP的/ Ajax ? node.js? ruby ?这个异步I / O在工作吗?还是html5的音频对象所提供的凉爽?这是我想了解的东西,因为我可能必须将整个方法重新定位以用于将来的应用程序。

此外,Soundcloud Player API是否吐出进度位置?任何帮助是极大的赞赏。

最佳答案

据我所知,Beatport网站是完整的Ajax,没有实际的页面重载,当您单击链接时,将动态重载主要站点的内容。地址栏中的位置更改可以通过javascript(http://stackoverflow.com/questions/1457/modify-address-bar-url-in-ajax-app-to-match-current-state)完成

我建议为这种功能使用某种框架。我不熟悉PHP框架环境,但在SO上听说过http://agiletoolkit.org/,似乎提供了这种功能

Soundloud播放器确实确实“吐出”了更新。在其API中对此进行了记录:

http://developers.soundcloud.com/docs/custom-player#events

onMediaTimeUpdate.scPlayer gets triggered constantly when the player is playing, could be used to display track progress outside of the player node


$(document).bind('onMediaTimeUpdate.scPlayer', function(event){
console.log(event.target, 'the track is at ' + event.position + ' out of ' + event.duration + ' which is ' + event.relative + ' of the total');
});

关于javascript - 玩家状态在Beatport与iframe上实现了javascript? soundcloud支持?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14175936/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com