xiaoyanbot
V2EX  ›  问与答

小程序音频播放接口, 我想播放 第 20 秒 到 第 22 秒 的内容,如何实现?

  •  
  •   xiaoyanbot · Mar 9, 2018 · 2235 views
    This topic created in 3181 days ago, the information mentioned may be changed or developed.

    https://mp.weixin.qq.com/debug/wxadoc/dev/api/api-audio.html#wxcreateaudiocontextaudioid

    看到从第 20 秒开始播放可以做到, 但第 22 秒停止怎么弄?

    5 replies  •  2018-03-09 13:55:16 +08:00
    xiaoyanbot
    xiaoyanbot
    OP
    Mar 9, 2018
    1
    自己计时不可靠吧?
    Chemist
    Chemist
    Mar 9, 2018 via iPhone
    2
    难道你指望每播一秒的音频给你执行一次回调吗。
    ragnaroks
    ragnaroks
    Mar 9, 2018
    3
    https://mp.weixin.qq.com/debug/wxadoc/dev/api/createInnerAudioContext.html

    currentTime(Number)
    当前音频的播放位置(单位:s ),只有在当前有合法的 src 时返回,时间不取整,保留小数点后 6 位
    MinonHeart
    MinonHeart
    Mar 9, 2018 via iPad
    4
    用新版接口
    learnshare
    learnshare
    Mar 9, 2018
    5
    我记得之前的 js-sdk 相当不可靠
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   934 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 19:56 · PVG 03:56 · LAX 11:56 · JFK 14:56
    ♥ Do have faith in what you're doing.