Cordova Media插件

时间:2016-04-05 23:55:00

标签: ios cordova

我正在尝试设置cordova-media-plugin,但不播放媒体文件。日志说:

import java.util.Map;

public class CoffeeShopMap {
    private Map<Integer,String> CoffeeShopWaiterMap;

    public void mapExample(){
        for (Map.Entry<Integer,String> entry : CoffeeShopWaiterMap) {
            Integer key = entry.getKey();
            String value = entry.getValue();

        }
    }

}

<bean id="coffeeBean3" class="com.cavalier.springcore.CoffeeShopMap">
    <property name="CoffeeShopWaitersMap">
        <map>
            <entry key="1" value="Michael" />
            <entry key="2" value="Peter" />
            <entry key="3" value="Steve"/>
        </map>
    </property>
    </bean>

所以,只有一个警告,但根本没有声音。我试过wav和mp3文件。

我添加了插件:

THREAD WARNING: ['Media'] took '22.759277' ms. Plugin should use a background thread.
Found resource '/var/mobile/Containers/Bundle/Application/xxx/MySound.app/www/res/snd/_beep.wav' in the web folder.
Playing audio sample 'res/snd/_beep.wav' 
Playing stream with AVPlayer & custom rate

我还尝试卸载并重新安装插件

我发起了声音调用,如:

cordova plugin add cordova-plugin-media

代码运行没有问题但是从不调用successFn。我尝试了一切,没有找到任何可以解决这个问题的东西。

thx任何提示

1 个答案:

答案 0 :(得分:0)

有一个iOS Bug版本的cordova 4.x和媒体插件2.2.0:

https://issues.apache.org/jira/browse/CB-10849