Hi,

Depending the video codec it may not work. Crosswalk pre-built binaries do
not enable proprietary codecs by default. You can try building Crosswalk
yourself to enable them.

Thanks.

On Sat, Mar 11, 2017 at 4:48 PM, iku naga <[email protected]> wrote:

> Hi,
>
> I've been trying to create the simple video app reading the crosswalk
> tutorials:
>  https://crosswalk-project.org/documentation/tutorials/webrtc.html
>  https://crosswalk-project.org/documentation/android/
> build_an_application.html
>
> When I try to run this code on my device(android4.4.2),
> I could get stream succesfully(no error) but  the video doesn't work at
> all.
> I confirmed the content of obectURL is like "blob:file://com.xwalk.trial1/
> 5ab.......384cf".
>
> Anythong wrong? Please help.
>
> My codes are as follows.
>
> --- index.html ---
>
> <!DOCTYPE html>
> <html>
>    <head>
>      <meta name="viewport" content="width=device-width, initial-scale=1.0">
>      <meta charset="utf-8">
>      <title>Crosswalk Simple</title>
>      <style>
>         #localvideo { width: 300px; }
>      </style>
>    </head>
>    <body>
>      <p><strong>LOCAL:</strong></p>
>      <video id="localvideo" autoplay></video>
> <script>
>
> document.addEventListener('DOMContentLoaded', function () {
>
> var localVideo = document.querySelector('#localvideo');
> navigator.webkitGetUserMedia(
> {
> audio: true,
> video: true
> },
>
> function (stream) {
> localVideo.src = window.URL.createObjectURL(stream);
>                                 //or localVideo.srcObject = stream;
> localVideo.play();
> localVideo.volume = 0.5;
> },
>
> function (err) {
> alert('failed to access local camera');
> }
> );
> });
> </script>
>    </body>
> </html>
>
> --- manifest.json ---
>
> {
>    "name": "Crosswalk Trial1",
>    "xwalk_app_version": "0.1",
>    "start_url": "index.html",
>    "xwalk_package_id": "com.xwalk.trial1",
>    "icons": [
>      {
>          "src": "icon.png",
>          "sizes": "72x72"
>      }
>    ]
> }
>
> --- AndroidManifest.xml ---
>
> <?xml version="1.0" encoding="utf-8"?>
>
> <manifest xmlns:android="http://schemas.android.com/apk/res/android";
>       package="com.xwalk.trial1"
>
>
> android:versionCode="1"
>       android:versionName="1.0"
>       android:installLocation="auto">
>
> <application android:name="org.xwalk.core.XWalkApplication"
>         android:hardwareAccelerated="true"
>
>
> android:label="com.xwalk.trial1"
>         android:icon="@drawable/crosswalk">
>
> <activity android:name="com.xwalk.trial1.Trial1Activity"
>                   android:theme="@style/AppTheme"
>
>
>  android:configChanges="orientation|keyboardHidden|keyboard|screenSize"
>
>
> android:screenOrientation="unspecified"
>                   android:label="com.xwalk.trial1">
>
> <intent-filter>
>
> <action android:name="android.intent.action.MAIN" />
>
> <category android:name="android.intent.category.LAUNCHER" />
>
> </intent-filter>
>
> </activity>
>
> </application>
>
> <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="21" />
>
> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
>
> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
>
> <uses-permission android:name="android.permission.CAMERA"/>
>
> <uses-permission android:name="android.permission.INTERNET"/>
>
> <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
>
> <uses-permission android:name="android.permission.RECORD_AUDIO"/>
>
> <uses-permission android:name="android.permission.WAKE_LOCK"/>
>
> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
> />
>
> </manifest>
>
> ---
>
> Regards, Iku
>
> _______________________________________________
> Crosswalk-help mailing list
> [email protected]
> https://lists.crosswalk-project.org/mailman/listinfo/crosswalk-help
>
>
_______________________________________________
Crosswalk-help mailing list
[email protected]
https://lists.crosswalk-project.org/mailman/listinfo/crosswalk-help

Reply via email to