|
- <!DOCTYPE html>
- <html>
- <head>
- <title>capture.captureAudio</title>
- <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
- <script type="text/javascript" charset="utf-8">
- //captureAudio方法成功执行后回调函数
- function captureSuccess(mediaFiles) {
- var i, len;
- for (i = 0, len = mediaFiles.length; i < len; i += 1) {
- //业务逻辑
- //navigator.notification.alert(mediaFiles[i].fullPath + " " +mediaFiles[i].name);
- var element = document.getElementById('heading');
- element.innerHTML = "<embed width='350' height='50' src='".mediaFiles[i].fullPath."' >";
- }
- }
- //captureAudio方法执行失败后回调函数
- function captureError(error) {
- var msg = 'capture 发生错误: ' + error.code;
- navigator.notification.alert(msg, null, 'Uh oh!');
- }
- function captureAudio() {
- // limit 录制的音频数
- navigator.device.capture.captureAudio(captureSuccess, captureError, {limit: 1});
- }
- </script>
- </head>
- <body>
- <h1>capture.captureAudio</h1><br/>
- <button onclick="captureAudio();">Capture Audio</button> </br>
- <div id="heading"></div><br>
- </body>
- </html>
复制代码
把这里注视掉无错、、、
-
- var element = document.getElementById('heading');
- element.innerHTML = "<embed width='350' height='50' src='".mediaFiles[i].fullPath."' >";
复制代码
不因该这么写吗? |
|