MediaPlayer错误未知错误

时间:2017-05-17 10:05:07

标签: android cordova

我正在使用离子2。

我提到了https://github.com/nchutchind/cordova-plugin-streaming-media

这是我的代码

  constructor(private streamingMedia: StreamingMedia,public navCtrl: NavController, public navParams: NavParams) {

    var videoUrl = "http://came3.nkansai.ne.jp:81/nphMotionJpeg?Resolution=640x480&Quality=Motion";

    let options: StreamingVideoOptions = {
      successCallback: () => { console.log('Video played') },
      errorCallback: (e) => { 
      console.log('Error streaming')
      console.log(e) 
     },
      orientation: 'landscape'
    };



    this.streamingMedia.playVideo('http://came3.nkansai.ne.jp:81/nphMotionJpeg?Resolution=640x480&Quality=Motion', options);
 }

我得到这个错误

MediaPlayer错误:未知(1)-2147483648

请建议我,

感谢。

1 个答案:

答案 0 :(得分:0)

要修复上述方案,请按照以下步骤操作: - >在config.xml中添加以下代码:

    <allow-intent href="*" />
    <access origin="*" />
    <allow-navigation href="http://*/*" />
    <allow-navigation href="https://*/*" />
    <allow-navigation href="*" />
    <allow-navigation href="data:*" />

- &GT;在index.html中添加以下代码:

    <meta http-equiv="Content-Security-Policy" content="style-src 'self' 'unsafe-inline'; media-src *; connect-src *">