Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/76.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/gwt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 吕震中本:声音不是在移动吗?_Html_Gwt_Audio - Fatal编程技术网

Html 吕震中本:声音不是在移动吗?

Html 吕震中本:声音不是在移动吗?,html,gwt,audio,Html,Gwt,Audio,我尝试了gwt-语音库和音频。 但两者都不起作用。。。它们可以在我的Pc上使用,但不能在我的移动浏览器上使用: IIRC,mobile Safari仅在播放声音作为对用户事件的反应时才启用声音。因此,您可能希望播放一些声音,作为对某些触摸事件的反应,以启用声音 SoundController soundController2 = new SoundController(); final Sound sound2 = s

我尝试了gwt-语音库和音频。 但两者都不起作用。。。它们可以在我的Pc上使用,但不能在我的移动浏览器上使用:


IIRC,mobile Safari仅在播放声音作为对用户事件的反应时才启用声音。因此,您可能希望播放一些声音,作为对某些触摸事件的反应,以启用声音

                   SoundController soundController2 = new SoundController();
                    final Sound sound2 = soundController2.createSound(Sound.MIME_TYPE_AUDIO_MPEG_MP3,
                        "Powerup.mp3");


                    sound2.addEventHandler(new SoundHandler() {

                        @Override
                        public void onPlaybackComplete(
                                PlaybackCompleteEvent event) {
                            // TODO Auto-generated method stub
                        }

                        @Override
                        public void onSoundLoadStateChange(
                                SoundLoadStateChangeEvent event) {
                            // TODO Auto-generated method stub
                            if(event.getLoadState().toString().equals("LOAD_STATE_SUPPORTED_AND_READY")){
                                sound2.play();
                            }

                        }

                    });