InnerAudioContext.offSeeking

    Function callback

    示例

    请使用百度APP扫码

    InnerAudioContext.offSeeking - 图3

    • 在 swan 文件中
    • 在 js 文件中
    1. onLoad() {
    2. const innerAudioContext = swan.createInnerAudioContext();
    3. innerAudioContext.src = 'https://vd3.bdstatic.com/mda-ic7mxzt5cvz6f4y5/mda-ic7mxzt5cvz6f4y5.mp3';
    4. innerAudioContext.autoplay = false;
    5. innerAudioContext.onPlay(res => {
    6. title: 'onPlay',
    7. content: JSON.stringify(res)
    8. });
    9. console.log('onPlay', res);
    10. innerAudioContext.onSeeking(res => {
    11. swan.showModal({
    12. title: 'onSeeking',
    13. content: JSON.stringify(res)
    14. });
    15. });
    16. innerAudioContext.onEnded(res => {
    17. innerAudioContext.offSeeking();
    18. this.innerAudioContext = innerAudioContext;
    19. },
    20. seek() {
    21. this.innerAudioContext.seek(80);
    22. },
    23. offSeeking(){
    24. swan.showModal({
    25. title: 'offSeeking',
    26. content: '取消监听成功'
    27. });
    28. this.innerAudioContext.offSeeking();