question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Streaming files on mobile application (cordova)

See original GitHub issue

Hello, I am trying to get video playback work with Meteor 1.8.0.1 and Cordova on Android and IOS devices. I’m currently trying to stream my file with simple HTML5 video tag. My video file is an .mp4 in h264 codec. We used meteor package file : ostrio:files (VeliovGroup/Meteor-Files) verison 1.9.11. Notice that we generate custom URL instead of use file.link(), that can be used with --mobile-server in Cordova (see in the #597 issue). Example of custom URL that we use for stream file in classic browser.

https://domain.com/cdn/storage/Filesupload/cFPNcK5K5bFpcc/original/c2pcatHFPK5bFc.mp4 

The stream is working perfectly on the web app, but once I go to the mobile app the playback could not launch.

First of all when i start my mobile application i get this error multiples times (but the application work perfectly) :

Failed to load http://192.168.17.3:3000/_timesync: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:12768' is therefore not allowed access.

And when i’m trying to stream my file i get two errors :

Refused to load the image 'android-webview-video-poster:default_video_poster/-2094984208415350593' because it violates the following Content Security Policy directive: "default-src * gap: data: blob: 'unsafe-inline' 'unsafe-eval' ws: wss:". Note that 'img-src' was not explicitly set, so 'default-src' is used as a fallback.

Related to SCP meteor/meteor#8965 i think 😕 but even after a long search that I couldn’t fix this bug.

And the last error related to my link stream :

GET https://domain.com/cdn/storage/Filesupload/2Nc2YatHFPK5bFpcc/original/2Nc2YatHFPK5bFpcc.mp4  net::ERR_CONNECTION_REFUSED

But when I click on the link to open it in the browser the link works perfectly. The HTML video player launch perfectly in mobile too but the video can’t be load.

Have you ever experienced this kind of problems before ? and is there any known issue ?

Permission on android maybe ? I don’t really know where to look if this is Cordova , ostrio:files, Content Security Policy or Meteor related ?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jankapunktcommented, May 24, 2019

I will close this for now as it is not related to any further features of this package so far. Feel free to reopen if an issue comes up that is related to this and specific parts of this package.

0reactions
dr-dimitrucommented, Dec 20, 2018

You’ve got the idea of this package wrong.

All features is related only to files upload. Download (e.g. play, stream) is always done via HTTP (TCP/IP). And yes, it wouldn’t ever work in Cordova as you will need to use native WebRTC package, and this branch is far away from implementing this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

cordova-plugin-file-transfer
cordova -plugin-file-transfer. This plugin allows you to upload and download files. This plugin defines global FileTransfer , FileUploadOptions constructors.
Read more >
Cordova Plugin for Streaming Media Player Apps
The Cordova Streaming Media Plugin allows you to stream audio and video in a fullscreen, native player on iOS and Android app devices....
Read more >
How to create a live broadcasting app using Cordova and ...
Learn how to integrate live video streaming in your Cordova/Ionic app. Bambuser's broadcast SDK and platform equips any app with live streaming abilities....
Read more >
Stream file to server from Cordova app - amazon s3
I have cordova app where the user must be able to select an image off their phone and upload it to AWS S3....
Read more >
cordova-plugin-streaming-media - NPM Package Overview
Start using Socket to analyze cordova-plugin-streaming-media and its 0 dependencies to secure your app from supply chain attacks.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found