1

我正在尝试使用 trigger.io 播放视频。代码如下:

    var urlString = "....mp4";
forge.tools.getURL(urlString, function (myUrl) {
    forge.media.videoPlay(
        myUrl,
        function() {
            alert("ok");
        },
        function(content) {
            alert(content)
        }
    );
});

当我使用 IOS 模拟器启动此应用程序时,它可以工作。但是当我在 Android 模拟器上尝试时,我收到以下错误:

[WARNING] Error while executing API method: media.videoPlay
[DEBUG] Returned: {"content":{"message":"Forge Java error: ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat={link}https://s3-eu-west-1.amazonaws.com/braingasm-video/6bPLY7orbVY.mp4{/link} typ=video/* }","type":"UNEXPECTED_FAILURE","subtype":null,"full_error":"android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat={link}https://s3-eu-west-1.amazonaws.com/braingasm-video/6bPLY7orbVY.mp4{/link} typ=video/* }
at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1408)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1378)
at android.app.Activity.startActivityForResult(Activity.java:2817)
at android.app.Activity.startActivity(Activity.java:2923)
at io.trigger.forge.android.modules.media.API.videoPlay(API.java:13)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at io.trigger.forge.android.core.ForgeApp.callJavaFromJavaScript(ForgeApp.java:247)
at io.trigger.forge.android.core.ForgeJSBridge$1.run(ForgeJSBridge.java:17)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561)
at java.lang.Thread.run(Thread.java:1096)

"},"callid":"BB45C58C-BE4B-42A0-B76A-4EC6B388B850","status":"错误"}

4

1 回答 1

2

我不确定您是否可以在 Android 模拟器上播放视频,此错误意味着没有可用于播放视频的应用程序。如果您在设备上运行相同的代码,它应该使用内置的视频播放器。

于 2013-01-28T17:52:45.310 回答