离子应用视频无法在移动设备中播放

时间:2016-05-27 10:43:01

标签: html angularjs ionic-framework crosswalk

我正在尝试在我的离子应用中将视频作为背景蒙版。

<video autoplay loop poster="oceans.jpg" id="bgvid">
    <source src="/asset/www/img/oceans.webm" type="video/webm">
</video>

这是我用来执行此操作的代码。它适用于网络浏览器,但遗憾的是不适用于移动设备。

我对它进行了一些研究,并在我的项目中添加了 crosswalk 插件,但即使在此之后,我在构建我的.apk 文件时出现错误

C:\Users\sif-\Desktop\vConnect_project\vConnect>ionic build android
Running command: "C:\Program Files\nodejs\node.exe" C:\Users\sif-\Desktop\vConne
ct_project\vConnect\hooks\after_prepare\010_add_platform_class.js C:\Users\sif-\
Desktop\vConnect_project\vConnect
add to body class: platform-android
ANDROID_HOME=D:\Android\sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_91
null
org.xwalk:xwalk_core_library_beta:18+

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all dependencies for configuration ':_armv7DebugCompile'.
   > Could not resolve org.xwalk:xwalk_core_library_beta:18+.
     Required by:
         :android:unspecified
      > Failed to list versions for org.xwalk:xwalk_core_library_beta.
         > Unable to load Maven meta-data from https://repo1.maven.org/maven2/or
g/xwalk/xwalk_core_library_beta/maven-metadata.xml.
            > Could not GET 'https://repo1.maven.org/maven2/org/xwalk/xwalk_core
_library_beta/maven-metadata.xml'.
               > repo1.maven.org
      > Failed to list versions for org.xwalk:xwalk_core_library_beta.
         > Unable to load Maven meta-data from https://download.01.org/crosswalk
/releases/crosswalk/android/maven2/org/xwalk/xwalk_core_library_beta/maven-metad
ata.xml.
            > Could not GET 'https://download.01.org/crosswalk/releases/crosswal
k/android/maven2/org/xwalk/xwalk_core_library_beta/maven-metadata.xml'.

BUILD FAILED

Total time: 6.916 secs
               > download.01.org

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug
option to get more log output.
Error: Error code 1 for command: cmd with args: /s,/c,"C:\Users\sif-\Desktop\vCo
nnect_project\vConnect\platforms\android\gradlew cdvBuildDebug -b C:\Users\sif-\
Desktop\vConnect_project\vConnect\platforms\android\build.gradle -Dorg.gradle.da
emon=true -Pandroid.useDeprecatedNdk=true"

这是我的离子版信息

C:\Users\sif-\Desktop\vConnect_project\vConnect>ionic info

Your system information:

Cordova CLI: 6.1.1
Gulp version:  CLI version 3.9.1
Gulp local:
Ionic Framework Version: 1.2.4
Ionic CLI Version: 1.7.15
Ionic App Lib Version: 0.7.2
OS: Windows 7 SP1
Node Version: v4.4.4

1 个答案:

答案 0 :(得分:1)

首先,请确保您可以通过浏览器访问以下链接,并在您使用时配置代理。

https://download.01.org/crosswalk/releases/crosswalk/android/maven2/org/xwalk/xwalk_core_library_beta/maven-metadata.xml

如果您的网络连接正常,问题仍然存在。请尝试修改项目根目录中的user。您可以看到有关Crosswalk版本的配置。

config.xml

将其更改为:

<preference name="xwalkVersion" value="xwalk_core_library_beta:18+" />