当前位置: 首页>>代码示例>>Java>>正文


Java AudioElement类代码示例

本文整理汇总了Java中com.google.gwt.dom.client.AudioElement的典型用法代码示例。如果您正苦于以下问题:Java AudioElement类的具体用法?Java AudioElement怎么用?Java AudioElement使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


AudioElement类属于com.google.gwt.dom.client包,在下文中一共展示了AudioElement类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: isSupported

import com.google.gwt.dom.client.AudioElement; //导入依赖的package包/类
public static boolean isSupported(FileFormat format)
{
    if (tempAudioElement == null)
        tempAudioElement = Document.get().createAudioElement();

    switch (format)
    {
        case MP3:
            return !tempAudioElement.canPlayType(AudioElement.TYPE_MP3).equals(MediaElement.CANNOT_PLAY);

        case WAV:
            return !tempAudioElement.canPlayType(AudioElement.TYPE_WAV).equals(MediaElement.CANNOT_PLAY);

        case OGG:
            return !tempAudioElement.canPlayType(AudioElement.TYPE_OGG).equals(MediaElement.CANNOT_PLAY);

        case WEBM:
            return !tempAudioElement.canPlayType("audio/webm").equals(MediaElement.CANNOT_PLAY);
    }

    return false;
}
 
开发者ID:sriharshachilakapati,项目名称:GWT-AL,代码行数:23,代码来源:AudioDecoder.java

示例2: setUp

import com.google.gwt.dom.client.AudioElement; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
    util = new ReAttachAudioUtilMock();
    audioMock = mock(Audio.class);
    when(audioMock.getAudioElement()).thenReturn(mock(AudioElement.class));
    when(audioMock.getParent()).thenReturn(mock(FlowPanel.class));
}
 
开发者ID:YoungDigitalPlanet,项目名称:empiria.player,代码行数:8,代码来源:ReAttachAudioUtilTest.java

示例3: loadDiceAudio

import com.google.gwt.dom.client.AudioElement; //导入依赖的package包/类
private void loadDiceAudio() {
  diceAudio = Audio.createIfSupported();
  if (diceAudio != null) {
    diceAudio.addSource(gameSounds.diceRollMp3().getSafeUri().asString(), AudioElement.TYPE_MP3);
    diceAudio.addSource(gameSounds.diceRollOgg().getSafeUri().asString(), AudioElement.TYPE_OGG);
    diceAudio.addSource(gameSounds.diceRollWav().getSafeUri().asString(), AudioElement.TYPE_WAV);
    diceAudio.load();
  }
}
 
开发者ID:spk83,项目名称:risk,代码行数:10,代码来源:SoundResource.java

示例4: loadDeployAudio

import com.google.gwt.dom.client.AudioElement; //导入依赖的package包/类
private void loadDeployAudio() {
  deployAudio = Audio.createIfSupported();
  if (deployAudio != null) {
    deployAudio.addSource(gameSounds.deployMp3().getSafeUri().asString(), AudioElement.TYPE_MP3);
    deployAudio.addSource(gameSounds.deployOgg().getSafeUri().asString(), AudioElement.TYPE_OGG);
    deployAudio.addSource(gameSounds.deployWav().getSafeUri().asString(), AudioElement.TYPE_WAV);
    deployAudio.load();
  }
}
 
开发者ID:spk83,项目名称:risk,代码行数:10,代码来源:SoundResource.java

示例5: loadAttackAudio

import com.google.gwt.dom.client.AudioElement; //导入依赖的package包/类
private void loadAttackAudio() {
  attackAudio = Audio.createIfSupported();
  if (attackAudio != null) {
    attackAudio.addSource(gameSounds.attackMp3().getSafeUri().asString(), AudioElement.TYPE_MP3);
    attackAudio.addSource(gameSounds.attackOgg().getSafeUri().asString(), AudioElement.TYPE_OGG);
    attackAudio.addSource(gameSounds.attackWav().getSafeUri().asString(), AudioElement.TYPE_WAV);
    attackAudio.load();
  }
}
 
开发者ID:spk83,项目名称:risk,代码行数:10,代码来源:SoundResource.java

示例6: loadCardAudio

import com.google.gwt.dom.client.AudioElement; //导入依赖的package包/类
private void loadCardAudio() {
  cardAudio = Audio.createIfSupported();
  if (cardAudio != null) {
    cardAudio.addSource(gameSounds.cardMp3().getSafeUri().asString(), AudioElement.TYPE_MP3);
    cardAudio.addSource(gameSounds.cardOgg().getSafeUri().asString(), AudioElement.TYPE_OGG);
    cardAudio.addSource(gameSounds.cardWav().getSafeUri().asString(), AudioElement.TYPE_WAV);
    cardAudio.load();
  }
}
 
开发者ID:spk83,项目名称:risk,代码行数:10,代码来源:SoundResource.java

示例7: loadAttackWonAudio

import com.google.gwt.dom.client.AudioElement; //导入依赖的package包/类
private void loadAttackWonAudio() {
  attackWonAudio = Audio.createIfSupported();
  if (attackWonAudio != null) {
    attackWonAudio.addSource(gameSounds.attackWonMp3().getSafeUri().asString(), 
        AudioElement.TYPE_MP3);
    attackWonAudio.addSource(gameSounds.attackWonOgg().getSafeUri().asString(), 
        AudioElement.TYPE_OGG);
    attackWonAudio.addSource(gameSounds.attackWonWav().getSafeUri().asString(), 
        AudioElement.TYPE_WAV);
    attackWonAudio.load();
  }
}
 
开发者ID:spk83,项目名称:risk,代码行数:13,代码来源:SoundResource.java

示例8: loadAttackLostAudio

import com.google.gwt.dom.client.AudioElement; //导入依赖的package包/类
private void loadAttackLostAudio() {
  attackLostAudio = Audio.createIfSupported();
  if (attackLostAudio != null) {
    attackLostAudio.addSource(gameSounds.attackLostMp3().getSafeUri().asString(), 
        AudioElement.TYPE_MP3);
    attackLostAudio.addSource(gameSounds.attackLostOgg().getSafeUri().asString(), 
        AudioElement.TYPE_OGG);
    attackLostAudio.addSource(gameSounds.attackLostWav().getSafeUri().asString(), 
        AudioElement.TYPE_WAV);
    attackLostAudio.load();
  }
}
 
开发者ID:spk83,项目名称:risk,代码行数:13,代码来源:SoundResource.java

示例9: loadGameWonAudio

import com.google.gwt.dom.client.AudioElement; //导入依赖的package包/类
private void loadGameWonAudio() {
  gameWonAudio = Audio.createIfSupported();
  if (gameWonAudio != null) {
    gameWonAudio.addSource(gameSounds.gameWonMp3().getSafeUri().asString(), 
        AudioElement.TYPE_MP3);
    gameWonAudio.addSource(gameSounds.gameWonOgg().getSafeUri().asString(), 
        AudioElement.TYPE_OGG);
    gameWonAudio.addSource(gameSounds.gameWonWav().getSafeUri().asString(), 
        AudioElement.TYPE_WAV);
    gameWonAudio.load();
  }
}
 
开发者ID:spk83,项目名称:risk,代码行数:13,代码来源:SoundResource.java

示例10: loadAddUnitsAudio

import com.google.gwt.dom.client.AudioElement; //导入依赖的package包/类
private void loadAddUnitsAudio() {
  addUnitsAudio = Audio.createIfSupported();
  if (addUnitsAudio != null) {
    addUnitsAudio.addSource(gameSounds.addUnitsMp3().getSafeUri().asString(), 
        AudioElement.TYPE_MP3);
    addUnitsAudio.addSource(gameSounds.addUnitsOgg().getSafeUri().asString(), 
        AudioElement.TYPE_OGG);
    addUnitsAudio.addSource(gameSounds.addUnitsWav().getSafeUri().asString(), 
        AudioElement.TYPE_WAV);
    addUnitsAudio.load();
  }
}
 
开发者ID:spk83,项目名称:risk,代码行数:13,代码来源:SoundResource.java

示例11: createPlayer

import com.google.gwt.dom.client.AudioElement; //导入依赖的package包/类
private void createPlayer() throws AudioException {
    audioPlayer = Audio.createIfSupported();
    if (audioPlayer == null) {
        throw new AudioException("audio not supportered");
    }
    final AudioElement audioElement = audioPlayer.getAudioElement();
    onEndedSetup(audioElement);
}
 
开发者ID:languageininteraction,项目名称:LanguageMemoryApp,代码行数:9,代码来源:AudioPlayer.java

示例12: prefetchError

import com.google.gwt.dom.client.AudioElement; //导入依赖的package包/类
/**
 * Prefetch the error sound.
 */
public void prefetchError() {
  if (isSupported && error == null) {
    error = Audio.createIfSupported();
    error.addSource("audio/error.ogg", AudioElement.TYPE_OGG);
    error.addSource("audio/error.mp3", AudioElement.TYPE_MP3);
    error.addSource("audio/error.wav", AudioElement.TYPE_WAV);
    prefetchAudio(error);
  }
}
 
开发者ID:Peergos,项目名称:Peergos,代码行数:13,代码来源:SoundEffects.java

示例13: getSourceNodes

import com.google.gwt.dom.client.AudioElement; //导入依赖的package包/类
private NodeList<Node> getSourceNodes(Audio audio) {
    AudioElement audioElement = audio.getAudioElement();
    return audioElement.getChildNodes();
}
 
开发者ID:YoungDigitalPlanet,项目名称:empiria.player,代码行数:5,代码来源:ReAttachAudioUtil.java

示例14: bufferData

import com.google.gwt.dom.client.AudioElement; //导入依赖的package包/类
public native void bufferData(WebALBuffer buffer, AudioElement audio, boolean streaming) /*-{
	this.bufferData(buffer, audio, streaming);
}-*/;
 
开发者ID:npedotnet,项目名称:GwtAL,代码行数:4,代码来源:WebALContext.java

示例15: onEndedSetup

import com.google.gwt.dom.client.AudioElement; //导入依赖的package包/类
private native void onEndedSetup(final AudioElement audioElement) /*-{
var audioPlayer = this;
audioElement.addEventListener("ended", function(){
[email protected].AudioPlayer::onEndedAction()();
}, false);
}-*/;
 
开发者ID:languageininteraction,项目名称:LanguageMemoryApp,代码行数:7,代码来源:AudioPlayer.java


注:本文中的com.google.gwt.dom.client.AudioElement类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。