You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "orlyapps (JIRA)" <ji...@apache.org> on 2017/04/04 08:45:41 UTC

[jira] [Commented] (CB-12356) cdvfile:// not working in html5 video tag

    [ https://issues.apache.org/jira/browse/CB-12356?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15954831#comment-15954831 ] 

orlyapps commented on CB-12356:
-------------------------------

Found a solution:
Use the newsst crosswalk webview: cordova plugins add cordova-plugin-crosswalk-webview
use this config.xml
 <plugin name="cordova-plugin-crosswalk-webview" spec="~2.3.0">
    <variable name="XWALK_VERSION" value="23+"/>
    <variable name="XWALK_LITEVERSION" value="xwalk_core_library_canary:17+"/>
    <variable name="XWALK_COMMANDLINE" value="--disable-pull-to-refresh-effect --allow-file-access-from-files"/>
    <variable name="XWALK_MODE" value="embedded"/>
    <variable name="XWALK_MULTIPLEAPK" value="true"/>
  </plugin>

"--allow-file-access-from-files" is the important part.

And now i load html videos from file:// and not cdvfile

> cdvfile:// not working in html5 video tag
> -----------------------------------------
>
>                 Key: CB-12356
>                 URL: https://issues.apache.org/jira/browse/CB-12356
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android
>         Environment: Android version : 4.4.2
> Model : HTC 
> cordova-plugin-file@4.3.1
> Meteor : 1.4
>            Reporter: harish
>              Labels: plugin-file, video
>
> I have a file downloaded to sdCard.
> I can play it in media player.So file is not corrupted.
> As per documentation to use 'cdvfile://..' in html tag two settings have to be set.
> # I set the Content-Security-Policy with
> {code}
>     <meta http-equiv="Content-Security-Policy" content="default-src cdvfile: 'self' https: data: ; style-src 'self' https: 'unsafe-inline' ; img-src * data: ;connect-src * ; script-src 'self' * 'unsafe-eval' 'unsafe-inline' ">
> {code}
> # I set origin access with
> {code}
> App.accessRule('cdvfile://*'); in mobile-config.js
> {code}
> Html :
> {code}
> <video>
>   <source src="cdvfile://localhost/files-external/ksnYb8A3bBr5BnSbT-aK2xDY3_460sv.mp4">
> </video>
> {code}
> Expected: 
> video tag should play the video.
> Actual:
> A black screen appears without any error.No playback.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org