如何使用 setCurrentTime() 设置开始时间偏移
我有语音文本录音,我希望允许用户在录音中的特定点开始录音,例如开始时间后 12.5 秒。使用下面的示例代码,我怎样才能实现这一点?
<audio id="player2" src="/player/media/AirReview-Landmarks-02-ChasingCorporate.mp3" type="audio/mp3" controls="controls" preload="preload">
</audio>
<script>
var player = $('audio,video').mediaelementplayer(
{
// the order of controls you want on the control bar (and other plugins below)
features: ['playpause','progress','current','duration','tracks','volume','fullscreen'],
audioWidth: 300,
// enables Flash and Silverlight to resize to content size
enableAutosize: true,
startVolume: 0.7,
success: function(player, node) {
$('#' + node.id + '-mode').html('mode: ' + player.pluginType);
}
}
);
</script>
I have recordings of spoken text where I would like to allow users to start an audio recording at a specific point within the recording, for example, 12.5 seconds after the start time. Using the sample code below, how can I make this happen?
<audio id="player2" src="/player/media/AirReview-Landmarks-02-ChasingCorporate.mp3" type="audio/mp3" controls="controls" preload="preload">
</audio>
<script>
var player = $('audio,video').mediaelementplayer(
{
// the order of controls you want on the control bar (and other plugins below)
features: ['playpause','progress','current','duration','tracks','volume','fullscreen'],
audioWidth: 300,
// enables Flash and Silverlight to resize to content size
enableAutosize: true,
startVolume: 0.7,
success: function(player, node) {
$('#' + node.id + '-mode').html('mode: ' + player.pluginType);
}
}
);
</script>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
查找 mediaelementplayer 对象:
设置时间(以秒为单位)(例如 12.5):
:)
Find mediaelementplayer object:
Set time in seconds (12.5 for example):
:)
我能够弄清楚如何通过外部链接控制 mediaelement.js 播放器。必须使用变量初始化播放器。
I was able to figure out how to control the mediaelement.js player with external links. The player has to be initialized using a variable.