Search code examples
htmlangularjsionic-frameworkcrosswalk

Ionic app video does not play in mobile


I am trying to have a video as a background mask in my ionic app.

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

This is the code I am using to do so. It works on web browser but sadly not on mobile.

I did some research on it and added crosswalk plugin to my project but even after that I am getting following error when I am building my .apk file

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"

This is my ionic version info

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

Solution

  • Firstly, please make sure you can visit the link below by your browser and also configure the proxy if you're using.

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

    If your network connection is okay and the problem still exists. Please try to modify the config.xml in the root directory of your project. You can see the configuration about the version of Crosswalk.

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

    change it to:

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