0

i am getting error on logcat "mediaplayer error (-1,2147483648)" while trying to play a video on android using phonegap. i am using cordova videoplayer plugin. so why i am getting this error while testing it on android emulator api v14? am i missing something?? please help me out. here i am pesting my entire code.


<!DOCTYPE html>
<html>
<head>
<script src="js/cordova-2.7.0.js" type="text/javascript"></script>
<script src="js/video.js" type="text/javascript"></script>
<link rel="stylesheet" href="js/video-js.css" type="text/css">

<meta charset="utf-8">
<title>HTML5 Video Player</title>
<style>
    body {
            font-family: sans-serif;
            border: 0;
            margin: 0;
            padding: 0;
    }
    header {
            text-align: center;
    }
    #player {
            display: table;
            width: 100%;
            padding: 4px;
    }

</style>
<script type="text/javascript">

 $( document ).ready(function() {
 //This is on load , You can also use 'example_video_1' click event
 var video = $('#example_video_1').get(0);
 video.load();
 video.play();
 });
 </script>
</head>
<body>
<header>
    <h1>HTML5 Video Player</h1>
</header>
 <div>
<section id="player">
<video id="example_video_1" class="video-js vjs-default-skin" controls            autobuffer height="430" width="400">
<source src="/playvideo/res/raw/asd.mp4">
<source src="mrbeancart_c5bplN27.mp4">
</video>
</section>
</div>
</body>
</html>

thank you for any kind of help....

Nabarag Paul
  • 319
  • 5
  • 19

1 Answers1

0

Maybe not the answer you are lookig for, but, there's no need to use a plugin, at least for me. My workaround is to save the files locally and bind them from the root directory, into a html5 video tag, as I stated here

Hope this helps. Also, this will cause the error you write about on emulator, so the video never plays but it is confirmed in real devices. I have tested this approach in several models of android 4.0

Community
  • 1
  • 1
Puma
  • 126
  • 5