Giter VIP home page Giter VIP logo

cordova-plugin-videoplayer's People

Contributors

abhijeetbhanjadeo avatar moust avatar stevenpalmaers avatar tonyawad88 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cordova-plugin-videoplayer's Issues

FAILED pluginJSON loading remote content

Hi,

I'm getting this error. I'm loading a remote video:

FAILED pluginJSON = ["VideoPlayer1323011964","VideoPlayer","play",["http://192.168.1.10:8081/aaa12.mov",{"scalingMode":2,"volume":0.5}]]

No way to install plugin with ionic / Cordova

ionic cordova plugin add https://github.com/moust/cordova-plugin-videoplayer.git

cordova plugin add https://github.com/moust/cordova-plugin-videoplayer.git --save
✖ Running command - failed!
[ERROR] An error occurred while running cordova plugin add https://github.com/moust/cordova-plugin-videoplayer.git

    --sav... (exit code 1):

    Error: Failed to fetch plugin https://github.com/moust/cordova-plugin-videoplayer.git via registry.
    Probably this is either a connection problem, or plugin spec is incorrect.
    Check your connection and plugin name/version/URL.
    Failed to get absolute path to installed module

VideoPlayer is not defined

I'm running cordova-plugin-videoplayer on Ionic and is not working:

HTML file:

<button class="button button-block button-energized" ng-click="abrir()">Play</button>

Controllers.js

            $scope.abrir = function() {
                VideoPlayer.play(
                    "http://techslides.com/demos/sample-videos/small.mp4",
                    {
                        volume: 0.5,
                        scalingMode: VideoPlayer.SCALING_MODE.SCALE_TO_FIT_WITH_CROPPING
                    },
                    function () {
                        console.log("video completed");
                    },
                    function (err) {
                        console.log(err);
                    }
                );
            };

Error:

0     564830   error    ReferenceError: VideoPlayer is not defined
    at Scope.$scope.abrir (http://192.168.0.8:8100/js/controllers.js:485:17)
    at fn (eval at compile (http://192.168.0.8:8100/lib/ionic/js/ionic.bundle.js:27638:15), <anonymous>:4:206)
    at http://192.168.0.8:8100/lib/ionic/js/ionic.bundle.js:65427:9
    at Scope.$eval (http://192.168.0.8:8100/lib/ionic/js/ionic.bundle.js:30395:28)
    at Scope.$apply (http://192.168.0.8:8100/lib/ionic/js/ionic.bundle.js:30495:25)
    at HTMLButtonElement.<anonymous> (http://192.168.0.8:8100/lib/ionic/js/ionic.bundle.js:65426:13)
    at defaultHandlerWrapper (http://192.168.0.8:8100/lib/ionic/js/ionic.bundle.js:16787:11)
    at HTMLButtonElement.eventHandler (http://192.168.0.8:8100/lib/ionic/js/ionic.bundle.js:16775:9)
    at triggerMouseEvent (http://192.168.0.8:8100/lib/ionic/js/ionic.bundle.js:2953:7)
    at tapClick (http://192.168.0.8:8100/lib/ionic/js/ionic.bundle.js:2942:3)

Ionic: 2.1.4
Cordova: 6.4.0

Video player does not show up nor play video

I am using ionic framework. I used this plugin and tried playing a local video with path
file:///storage/2179-1C04/DCIM/Camera/20170816_143027.mp4 but its not playing it gives exception
"Unhandled Promise rejection:", source: file:///android_asset/www/build/polyfills.js
"Error: Uncaught (in promise): Prepare failed.: status=0x1", source: file:///android_asset/www/build/polyfills.js
What's the problem?
I want to be able to play video on both iOS and android. how can i achieve it?

Video Controls?

Hi,

Thanks for the plugin!

I'm testing on an android emulator and don't seem to get native controls (play/pause/scrub etc.). Should these be visible? If not is there any way to make them visible?

Many Thanks,

Dan

Plugin fires completeCallback instead of errorCallback

The plugin fires the completeCallbackeven when the device was not capable of playing the file.
In my app, I play a 4k video file. Some older devices can't decode 4k, and the video player opens and closes immediately. The completeCallback is then called, when it should be the errorCallback.

I want to know if the device was capable of playing the 4k file, so I can try playing a 1080p file instead, but since it always says "video completed" I can't make the distinction.

Video does not appear

NEVER MIND! IT WORKS NOW!
Video does not play. This is my index.html. Is it correct?

< !DOCTYPE html>

< html>
< head>
< meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap: https://ssl.gstatic.com 'unsafe-eval' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; media-src *">
< meta name="format-detection" content="telephone=no">
< meta name="msapplication-tap-highlight" content="no">
< meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width">
< title>Hello World</title>
< script type="text/javascript" src="cordova.js"></script>
< script type="text/javascript" charset="utf-8">

// Wait for device API libraries to load
document.addEventListener("deviceready", onDeviceReady, false);

// device APIs are available
function onDeviceReady() {
}
</script>
</head>
< body>
< div style="margin: 20px;">
< button onclick="play">PLAY VIDEO</button>
</div>

    < script>
    function play() {

        VideoPlayer.play(
            "file:///android_asset/www/videos/myvideo-h264.mp4",
            {
                volume: 0.5,
                scalingMode: VideoPlayer.SCALING_MODE.SCALE_TO_FIT
                // scalingMode: VideoPlayer.SCALING_MODE.SCALE_TO_FIT_WITH_CROPPING
            },
            function () {
                console.log("video completed");
            },
            function (err) {
                console.log(err);
            }
        );
        alert(VideoPlayer);
    }
    </script>
    < script type="text/javascript" src="js/videoplayer.js"></script>
</body>

Set oriantion

My app is locked into portrait mode but the video is landscaped how can I set this fix in the play options?

not working

hi, I am using cordova 6.0.0 CLI and I have installed this plugin to my project through terminal from this source:
https://github.com/moust/cordova-plugin-videoplayer.git
I am calling the videoplayer.play() method on the onclick event listener of a button for test, but nothing happens.
<button onClick="VideoPlayer.play("https://www.youtube.com/watch?v=H-30B0cqh88");">Play me</button>
any help ?

Video height

This is a great Cordova plugin thanks for building it!

I'm just trying to get the video to play full width, but not full height, so it's not so stretched. Is this possible?

I've tried both of the scallingMode options, but they still keep the video 100% height and width

Incorrect method description in README.md

The method description on line 21 in README.md uses .get() is this correct? It doesn't look like this method exists. Shouldn't it be .play()?

VideoPlayer.get(path, [options], [completeCallback], [errorCallback]);

The video does not appear

Hello,

I tried to use this plugin with an Android 6.0 phone but the video is not displayed, although controls of my app such as button, inputs, ... becomes inactive till I click on the 'back button'. It is like the video is transparent.

My video is located on my server and I call the plugin through this command:

VideoPlayer.play('https://myserver.com/files/index.php?type=attachment&line='+$(this).data('id'));

Also I have added <script type="text/javascript" src="js/videoplayer.js"></script> at the end of my index.html. Lastly, videos are either 3gp or mp4.

What can I do to make it working?

Thanks!

Ionic 3 - Playing same video 2nd time breaks when attempting to close it

Hello,

When playing a video for the first time, everything works great. when calling .close() function the video closes great. 2nd time around, the .play() is called the same way as the first time. The video plays fine for the second time. Now when trying to close it before the video ends, the app fatally crash.

Any idea why?
Thank you!

Video not showing

I am having problem, video plays and I can hear audio, but screen is just blank? What could be the problem ?

doesn't work in PGB 3.4

I am using PGB 3.4 with your plugin 1.0.0
this is my code

VideoPlayer.play("https://www.youtube.com/watch?v=jHc3mdIG2AY");

or

VideoPlayer.play(
    "https://www.youtube.com/watch?v=jHc3mdIG2AY",
    {
        volume: 0.5,
        scalingMode: VideoPlayer.SCALING_MODE.SCALE_TO_FIT_WITH_CROPPING
    },
    function (err) {
        alert(err); //no alert window appear
    }

but no any feedback response...

Video Path for videos in project code directory not in emulator or device

Hello,
This plugin is useful to play videos saved locally to device / emulator.

My question is i am testing in emulator and my video is in assets/video folder and code is at src/pages folder as per ionic project directory. so what should be path i write in this.videoPlayer.play("HERE",{})
'assets/video/video_0.mp4' is not working.

Thank you

Build error with CLI 6.2.0

When I am trying to build the apps, I got the following -
Error - The following plugin, plugin version or a dependancy of this plugin is not on npm: [email protected]

Here is my log -
Build Date: 2018-03-10 08:56:34 +0000

PLUGIN OUTPUT

Fetching plugin "[email protected]" via npm
Installing "cordova-plugin-statusbar" at "2.1.3" for android
Fetching plugin "[email protected]" via npm
Installing "cordova-plugin-device" at "1.1.2" for android
Fetching plugin "[email protected]" via npm
Installing "cordova-plugin-splashscreen" at "2.1.0" for android
Fetching plugin "[email protected]" via npm
Installing "cordova-plugin-compat" at "1.0.0" for android
Fetching plugin "[email protected]" via npm
Installing "cordova-plugin-file" at "4.2.0" for android
Plugin dependency "[email protected]" already fetched, using that version.
Dependent plugin "cordova-plugin-compat" already installed on android.

The Android Persistent storage location now defaults to "Internal". Please check this plugins README to see if you application needs any changes in its config.xml.

If this is a new application no changes are required.

If this is an update to an existing application that did not specify an "AndroidPersistentFileLocation" you may need to add:

  "<preference name="AndroidPersistentFileLocation" value="Compatibility" />"

to config.xml in order for the application to find previously stored files.
Fetching plugin "[email protected]" via npm
Installing "cordova-plugin-file-transfer" at "1.5.1" for android
Plugin dependency "[email protected]" already fetched, using that version.
Dependent plugin "cordova-plugin-file" already installed on android.
Fetching plugin "[email protected]" via npm
Installing "cordova-plugin-camera" at "2.2.0" for android
Plugin dependency "[email protected]" already fetched, using that version.
Dependent plugin "cordova-plugin-compat" already installed on android.
Fetching plugin "[email protected]" via npm
Installing "cordova-plugin-dialogs" at "1.2.1" for android
Fetching plugin "https://github.com/tanelih/phonegap-bluetooth-plugin.git" via git clone
Using shallow clone
Repository "https://github.com/tanelih/phonegap-bluetooth-plugin.git" checked out to git ref "master" at "b63bb9e".
Installing "com.phonegap.plugins.bluetooth" at "0.9" for android
Fetching plugin "[email protected]" via npm
Installing "cordova-plugin-media" at "2.3.0" for android
Plugin dependency "[email protected]" already fetched, using that version.
Dependent plugin "cordova-plugin-file" already installed on android.
Plugin dependency "[email protected]" already fetched, using that version.
Dependent plugin "cordova-plugin-compat" already installed on android.
"plugman-151 install --platform android --project /project --plugin [email protected] --nohooks=.": Fetching plugin "[email protected]" via npm
Failed to fetch plugin [email protected] via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Error: Registry returned 404 for GET on https://registry.npmjs.org/com.moust.cordova.videoplayer

Failed to restore plugin

When i try install this plugin, this error appear:

Failed to restore plugin "com.moust.cordova.videoplayer" from config.xml. You might need to try adding it again. Error: Failed to fetch plugin com.moust.cordova.videoplayer@https://github.com/moust/cordova-plugin-videoplayer via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Failed to get absolute path to installed module

Can you help me ?

info:

node : v6.10.3
cordova: 7.0.1
ionic: 3.2.0
OS: MACOSX

Doesn't install

Trying to install, this error happens:

Error: Failed to fetch plugin com.moust.cordova.videoplayer via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Error: Registry returned 404 for GET on https://registry.npmjs.org/com.moust.cordova.videoplayer

cordova version 6.0.0
xcode 7.2.1
mac os x el capitan

Title & Menu bar

First of all thanks for your greate work!

When the video starts out of my phonegap app the title and menu bar appear and on end they disappear.

Is it possible to hide them by default?

Not Work, in my device

i trying to view a video use my device (Specs: Android 7), i was config all, but to click in the button for play video nothing happens.

in what android version you was testing plugin?

thanks and regards!

Does not work with rtsp streams!

In VLC I write this URL rtsp://--login--:[email protected]:554 and everything appears fine, but when I write in my code
document.addEventListener('deviceready', function() { VideoPlayer.play( "rtsp://--login--:[email protected]:554", { volume: 0.5 }, function () { alert("video completed"); }, function (err) { alert(err); } ); ... }
alert tells me "Prepare failed: status = 0x1". Does the plugin RTSP?

cordova plugin add com.moust.cordova.videoplayer bad version

Hi there !

Thank's for you usefull plugin.
I installed it with the following command line

cordova plugin add com.moust.cordova.videoplayer

and unfortunately ran into some issue trying to call VideoPlayer.close().

Finally I figured out that the version installed via the latter command line wasn't featuring the close() method.
I reinstalled it via

cordova plugin add https://github.com/moust/cordova-plugin-videoplayer.git

an it solved my issue.

Preloading during wait ?

Hello,

Is it possible to add preloading dialog before function is done ? I try many ways but still not success.

Please suggest.

Thank you,
Umpol

Property 'SCALING_MODE' does not exist on type 'typeof VideoPlayer'.

Hello,

I like your plugin but I stuck while using SCALING_MODE option.

I tried following code:

import { VideoPlayer } from '@ionic-native/video-player'; . . . this.videoPlayer.play("https://www.quirksmode.org/html5/videos/big_buck_bunny.mp4",{ scalingMode: VideoPlayer.SCALING_MODE.SCALE_TO_FIT_WITH_CROPPING }).then(() => { console.log('video completed'); this.videoPlayer.close(); }).catch(err => { console.log(err); });

but I got error:

Property 'SCALING_MODE' does not exist on type 'typeof VideoPlayer'.

I can play video without providing any option though.

Thanks,
Bhavin

there isn't proxy?

I make sure that I add the plugin in my program. but when I start it on browser, there is a error :Error: exec proxy not found for :: VideoPlayer :: play. Can you help me?

Unhandled Promise Rejection Warning

I ran the command " cordova plugin add cordova-plugin-video-player " and gives me the following error:

(node:4008) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejec
tion id: 1): Error: cmd: Command failed with exit code ENOENT
(node:4008) [DEP0018] DeprecationWarning: Unhandled promise rejections are depre
cated. In the future, promise rejections that are not handled will terminate the
Node.js process with a non-zero exit code.

command " ionic info " shows :

cli packages: (C:\Users\shweta\AppData\Roaming\npm\node_modules)

@ionic/cli-utils  : 1.19.2
ionic (Ionic CLI) : 3.20.0

global packages:

cordova (Cordova CLI) : 8.0.0

local packages:

@ionic/app-scripts : 3.1.8
Cordova Platforms  : none
Ionic Framework    : ionic-angular 3.9.2

System:

Android SDK Tools : 26.0.1
Node              : v9.2.0
npm               : 5.8.0
OS                : Windows 8.1

Environment Variables:

ANDROID_HOME : C:\Users\shweta\AppData\Local\Android\sdk

Misc:

backend : pro

Please help me out.

VideoPlayer not Defined

"Uncaught ReferenceError: VideoPlayer is not defined", source: file:///android_asset/www/js/videos.js (9)

After integration into project i am getting this error.

is this a fork one plugin ?

hi @moust
I saw your plugin under PGB
https://build.phonegap.com/plugins/813
https://github.com/moust/cordova-plugin-videoplayer/blob/7129007f4f6361412cf8a0aa5412885c6478dab8/README.md

Q1
is this plugin a fork one ? because of your plugin is almost similar like this...
https://build.phonegap.com/plugins/391
https://github.com/dawsonloudon/VideoPlayer

Q2
what's the difference between by yours and the orginal,I think is,that you add two attribute,"volume" and "scalingMode"
https://github.com/moust/cordova-plugin-videoplayer/blob/7129007f4f6361412cf8a0aa5412885c6478dab8/README.md
well~
is the volume value set in this Range (0.0 to 1.0)?
is the scalingMode's value only set in this ?
VideoPlayer.SCALING_MODE.SCALE_TO_FIT_WITH_CROPPING
or any other value can be set ?

Error 404

When I try to execute:
cordova plugin add com.moust.cordova.videoplayer
It returns the following error:
Error: 404 Not Found: com.moust.cordova.videoplayer

Any ideas?

Add an image on top of playing video

How can i show overlay image on top of playing video which is playing full screen. I would also like to know how can i change size of player because currently it only plays fullscreen

Need both nofullscreen and fullscreen.

this plugin is supporting both no-fullscreen and fullscreen?
I need video playing as no-fullscreen when portrait mode and full screen when rotate as landscape mode like youtube/vimeo player.
Regards

MediaPlayer: error (1, -1021)

I'm trying to use this plugin but I keep getting this error seemingly randomly. I have 7 videos I need to play in a row and some will play with no error and others will have this error. Its not the same videos either. Sometimes the first video plays sometimes it doesn't. What I find from Googling is that its a generic error that is thrown when an unknown error occurred. Any ideas on what could be causing this?

03-27 13:55:38.440 31798-31811/com.tsi.fitpro V/MediaPlayer: New video size 1920 x 1080
03-27 13:55:38.440 31798-31811/com.tsi.fitpro V/MediaPlayer: callback application
03-27 13:55:38.440 31798-31811/com.tsi.fitpro V/MediaPlayer: back from callback
03-27 13:55:38.440 31798-31808/com.tsi.fitpro V/MediaPlayer: message received msg=1, ext1=0, ext2=0
03-27 13:55:38.440 31798-31808/com.tsi.fitpro V/MediaPlayer: prepared
03-27 13:55:38.440 31798-31808/com.tsi.fitpro V/MediaPlayer: callback application
03-27 13:55:38.440 31798-31808/com.tsi.fitpro V/MediaPlayer: back from callback
03-27 13:55:38.500 31798-31798/com.tsi.fitpro V/MediaPlayer: setVideoSurfaceTexture
03-27 13:55:38.560 31798-31798/com.tsi.fitpro E/MediaPlayer: Should have subtitle controller already set
03-27 13:55:38.560 31798-31798/com.tsi.fitpro W/MediaPlayer: this is IMEDIA_PLAYER_VIDEO_EXIST
03-27 13:55:38.560 31798-31798/com.tsi.fitpro I/MediaPlayer: sendBroadcast android.media.IMediaPlayer.videoexist
03-27 13:55:38.570 31798-31798/com.tsi.fitpro V/MediaPlayer-JNI: start
03-27 13:55:38.570 31798-31798/com.tsi.fitpro V/MediaPlayer: start
03-27 13:55:38.590 31798-31811/com.tsi.fitpro V/MediaPlayer: message received msg=100, ext1=1, ext2=-1021
03-27 13:55:38.590 31798-31811/com.tsi.fitpro E/MediaPlayer: error (1, -1021)
03-27 13:55:38.590 31798-31811/com.tsi.fitpro V/MediaPlayer: callback application
03-27 13:55:38.590 31798-31811/com.tsi.fitpro V/MediaPlayer: back from callback
03-27 13:55:38.600 31798-31808/com.tsi.fitpro V/MediaPlayer: message received msg=6, ext1=0, ext2=0
03-27 13:55:38.600 31798-31808/com.tsi.fitpro V/MediaPlayer: Received MEDIA_STARTED
03-27 13:55:38.600 31798-31808/com.tsi.fitpro V/MediaPlayer: callback application
03-27 13:55:38.600 31798-31808/com.tsi.fitpro V/MediaPlayer: back from callback
03-27 13:55:38.620 31798-31798/com.tsi.fitpro E/MediaPlayer: Error (1,-1021)
03-27 13:55:38.620 31798-31798/com.tsi.fitpro E/VideoPlayer: MediaPlayer.onError(1, -1021)

npm install error

Hi,
I have getting following error with "npm install"

npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install"
npm ERR! node v6.11.0
npm ERR! npm v3.10.10
npm ERR! code E404

npm ERR! 404 Registry returned 404 for GET on https://registry.npmjs.org/com.moust.cordova.videoplayer
npm ERR! 404
npm ERR! 404 'com.moust.cordova.videoplayer' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 It was specified as a dependency of 'MUS_Video'
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

FR: Support live videostreams like rtsp

Hi, this plugin is very nice. Showing your plugin until now you support only playing a file, do you think you could supporting also playing a live stream like an rtsp stream?

Platforms available ?

Hello,

Just discovered this plugin ! Please could you tell me which platforms are supported ?

(i'm interested in IOS and Android)

Thank !

Frédéric

Youtube Video support

The readme did not state if it supports YouTube video streaming. I would like to confirm that.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.