html5
在 Gingerbread 2.3 和 iOS 4.2+ 上,HTML5 标签都会生成一个带有
next
和 previous
按钮的界面。
我如何连接这些控件? 它似乎不是 HTML5 媒体事件之一
它们发出什么 JavaScript 事件或者它们发送 HTTP ICECast 消息? (单击按钮时不会发送 HTTP 标头)
对于 示例 与屏幕截图,请参阅https://coolaj86.com/demos/sandbox/html5-audio-tag.html
在 Android 上:
- 如果您有姜饼或更好的设备,默认情况下您会在网络应用程序中看到控件。
在 iOS(iPhone、iPod、iPad)上:
- 开始在 iPod/iPad/iPhone 上播放音乐样本
- ,然后单击按钮将应用程序“背景化”。
- 双击下方菜单并从左向右滑动即可访问播放器控件。
注意:播放/暂停
控件确实或多或少按预期工作(设置适当的 Content-Range HTTP 标头有帮助)
Both on Gingerbread 2.3 and iOS 4.2+ the HTML5 <audio>
tag generates an interface with next
, and previous
buttons.
How do I hook into those controls?
It doesn't appear to be one of the HTML5 Media Events according to
What JavaScript events do they emit or do they send HTTP ICECast messages?
(No HTTP headers are sent on the button click)
For an example with screenshots, see https://coolaj86.com/demos/sandbox/html5-audio-tag.html
On Android:
- if you have gingerbread or better you'll see the controls in the webapp by default.
On iOS (iPhone, iPod, iPad):
- Begin playing the music sample on your iPod/iPad/iPhone
- Then click the button to "background" the app.
- Double click and swipe from left to right in the lower menu to access the player controls.
Note: play/pause
control does work more or less as expected (setting the appropriate Content-Range HTTP header helps)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
对于 iOS,
来自 webkit-help 邮件列表:
As for iOS
From the webkit-help mailing list:
AFAIK,当您尝试使用新的 HTML 5 规范播放任何媒体文件时,手机(android/iphone)会打开默认播放器。
由于实际播放是通过媒体播放器应用程序完成的,因此无法控制这些按钮。
AFAIK, mobile phones (android/iphone) open the default player when you attempt to play any media file using the new HTML 5 specification.
There's no way to control those buttons since the actual playback is done via the media player application.
我不知道是否有意,但到目前为止,http://www.当您当前播放任何音频时,schillmania.com/projects/soundmanager2/demo/page-player/ 可与“下一步”按钮配合使用。如果音频结束,“NEXT”按钮将停止工作。并且“上一首”按钮不会转到上一首歌曲,而是重新开始当前歌曲。
我不知道斯科特(创建者)是否已经编写了这个代码。我尝试调试该页面 JS 文件,但没有发现任何下一个/上一个逻辑已完成。
显然,这应该是可能的。它的工作有点问题,而且没有文档,但让我们构建它!
按钮有什么作用?
onfinish
事件。:/ 到目前为止,这就是我所掌握的信息。我尝试
monitorEvents
但没有成功,它应该触发一些事件。I don't know if intended, but so far, http://www.schillmania.com/projects/soundmanager2/demo/page-player/ works with the NEXT button while you are CURRENTLY PLAYING any audio. If the audio finishes, the NEXT button stops working. And the PREVIOUS button doesn't go to previous song, but restarts current song.
I don't know if Scott (the creator) has coded this, or not. I've tried debugging that page JS files, and didn't find any next/prev logic done.
Clearly, it should be possible. It's working kind of buggy and there is no documentation, but let's build it!
What do the buttons do?
onfinish
event.:/ So far, that's the info I have. I'm trying to
monitorEvents
without success, it should be triggering some event.