• <samp id="frm2q"><ins id="frm2q"></ins></samp>
      1. <samp id="frm2q"></samp>
        <progress id="frm2q"><bdo id="frm2q"><strong id="frm2q"></strong></bdo></progress>
        <menuitem id="frm2q"><ins id="frm2q"><u id="frm2q"></u></ins></menuitem>

        <progress id="frm2q"></progress>
      2. cordova插件- Media

        小編:管理員 69閱讀 2022.09.13

        • 添加插件

        $ cordova plugin add cordova-plugin-media

        • 插件的使用
        • Methods

        ·media.getCurrentAmplitude:Returns the current position within an audio file.

        ·media.getCurrentPosition:Returns the current position within an audio file.

        ·media.getDuration:Returns the duration of an audio file.

        ·media.play: Startor resume playing an audio file.

        ·media.pause: Pauseplayback of an audio file.

        ·media.pauseRecord: Pauserecording of an audio file.

        ·media.release:Releases the underlying operating system's audio resources.

        ·media.resumeRecord:Resume recording of an audio file.

        ·media.seekTo: Movesthe position within the audio file.

        ·media.setVolume: Setthe volume for audio playback.

        ·media.startRecord: Startrecording an audio file.

        ·media.stopRecord: Stoprecording an audio file.

        ·media.stop: Stopplaying an audio file.

        2. Example

        <div style="position: absolute;top: 40px"> <input type="button"onclick="statRecorder()" value="開始錄音"><br> <input type="button"onclick="stopRecorder()" value="結束錄音"><br> <input type="button"onclick="initMedia()" value="初始化"><br> <input type="button"onclick="playMedia()" value="播放"><br> <input type="button"onclick="pauseMedia()" value="暫停"><br> <input type="button"onclick="mediaTime()" value="獲取時長"><br> <input type="button"onclick="mediaRealse()" value="釋放資源"><br> <button onclick="javascript:history.back(-1)">返回上一頁</button> </div> <script> var my_media; function initMedia() { my_media = new Media( "recording.wav", function() { alert("MediaInit Success"); }, function(err) { alert("Error:" + err.toString()); } ); } //開始播放 function playMedia() { my_media.play(); } //暫停播放 function pauseMedia() { my_media.pause(); } //開始錄音 var recordMedia; function statRecorder() { recordMedia = new Media( 'recording.wav', function() { alert("Success"); }, function(e) { alert("Error"+e.valueOf().toString()); } ); // 開始錄音 recordMedia.startRecord(); } //結束錄音 function stopRecorder() { recordMedia.stopRecord(); } //獲取時長 function mediaTime() { var duration =my_media.getDuration(); alert("時長 ="+duration); } //釋放多媒體資源 function mediaRealse() { my_media.release(); } </script>

        關聯標簽:
        日本漂亮人妻被强制

      3. <samp id="frm2q"><ins id="frm2q"></ins></samp>
          1. <samp id="frm2q"></samp>
            <progress id="frm2q"><bdo id="frm2q"><strong id="frm2q"></strong></bdo></progress>
            <menuitem id="frm2q"><ins id="frm2q"><u id="frm2q"></u></ins></menuitem>

            <progress id="frm2q"></progress>