nativescript TNS播放器在播放音频时出错

时间:2018-02-20 15:37:51

标签: audio nativescript angular5 angular2-nativescript

我正在使用nativescript来构建该应用程序。我想用音乐播放器播放音频。我正在使用TNS播放器https://github.com/nstudio/nativescript-audio。它适用于某些.mp3文件。但是当文件大小超过70-80 MB而不是给出以下错误时。

public async playAudio(filepath: string) {
const playerOptions: AudioPlayerOptions = {
  audioFile: filepath,
  loop: false,
  completeCallback: async () => {
    alert("Audio file complete.");
    await this._player.dispose();

    console.log("player disposed");
  },
  errorCallback: errorObject => {
    console.log(JSON.stringify(errorObject));
  },
  infoCallback: args => {
    console.log(JSON.stringify(args));
  }
};
this._player.playFromUrl(playerOptions); }

功能

    function printDiv(printThis) {
         var printContents = document.getElementById(printThis).innerHTML;
         var originalContents = document.body.innerHTML;
         document.body.innerHTML = printContents;
         window.print();
         document.body.innerHTML = originalContents;
    }

0 个答案:

没有答案