0

I am trying to use vitamio to play stream hls. it contained error when i play stream

03-11 16:12:25.836: E/Vitamio[Player](344): isNativeLibsInited
03-11 16:12:25.836: E/Vitamio[Player](344): java.io.FileNotFoundException: /data/data/com.example.esporttv/libs/.lock (No such file or directory)
03-11 16:12:25.836: E/Vitamio[Player](344):     at org.apache.harmony.luni.platform.OSFileSystem.open(Native Method)
03-11 16:12:25.836: E/Vitamio[Player](344):     at dalvik.system.BlockGuard$WrappedFileSystem.open(BlockGuard.java:232)
03-11 16:12:25.836: E/Vitamio[Player](344):     at java.io.FileInputStream.<init>(FileInputStream.java:80)
03-11 16:12:25.836: E/Vitamio[Player](344):     at java.io.FileReader.<init>(FileReader.java:42)
03-11 16:12:25.836: E/Vitamio[Player](344):     at io.vov.vitamio.Vitamio.isInitialized(Vitamio.java:128)
03-11 16:12:25.836: E/Vitamio[Player](344):     at io.vov.vitamio.LibsChecker.checkVitamioLibs(LibsChecker.java:40)
03-11 16:12:25.836: E/Vitamio[Player](344):     at com.example.esporttv.Player$2.onClick(Player.java:97)
03-11 16:12:25.836: E/Vitamio[Player](344):     at android.view.View.performClick(View.java:2485)
03-11 16:12:25.836: E/Vitamio[Player](344):     at android.view.View$PerformClick.run(View.java:9080)
03-11 16:12:25.836: E/Vitamio[Player](344):     at android.os.Handler.handleCallback(Handler.java:587)
03-11 16:12:25.836: E/Vitamio[Player](344):     at android.os.Handler.dispatchMessage(Handler.java:92)
03-11 16:12:25.836: E/Vitamio[Player](344):     at android.os.Looper.loop(Looper.java:123)
03-11 16:12:25.836: E/Vitamio[Player](344):     at android.app.ActivityThread.main(ActivityThread.java:3683)
03-11 16:12:25.836: E/Vitamio[Player](344):     at java.lang.reflect.Method.invokeNative(Native Method)
03-11 16:12:25.836: E/Vitamio[Player](344):     at java.lang.reflect.Method.invoke(Method.java:507)
03-11 16:12:25.836: E/Vitamio[Player](344):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
03-11 16:12:25.836: E/Vitamio[Player](344):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
03-11 16:12:25.836: E/Vitamio[Player](344):     at dalvik.system.NativeStart.main(Native Method)
03-11 16:12:26.166: E/Vitamio[Player](344): isNativeLibsInited
03-11 16:12:26.166: E/Vitamio[Player](344): java.io.FileNotFoundException: /data/data/com.example.esporttv/libs/.lock (No such file or directory)
03-11 16:12:26.166: E/Vitamio[Player](344):     at org.apache.harmony.luni.platform.OSFileSystem.open(Native Method)
03-11 16:12:26.166: E/Vitamio[Player](344):     at dalvik.system.BlockGuard$WrappedFileSystem.open(BlockGuard.java:232)
03-11 16:12:26.166: E/Vitamio[Player](344):     at java.io.FileInputStream.<init>(FileInputStream.java:80)
03-11 16:12:26.166: E/Vitamio[Player](344):     at java.io.FileReader.<init>(FileReader.java:42)
03-11 16:12:26.166: E/Vitamio[Player](344):     at io.vov.vitamio.Vitamio.isInitialized(Vitamio.java:128)
03-11 16:12:26.166: E/Vitamio[Player](344):     at io.vov.vitamio.Vitamio.initialize(Vitamio.java:102)
03-11 16:12:26.166: E/Vitamio[Player](344):     at io.vov.vitamio.activity.InitActivity$1.doInBackground(InitActivity.java:55)
03-11 16:12:26.166: E/Vitamio[Player](344):     at io.vov.vitamio.activity.InitActivity$1.doInBackground(InitActivity.java:1)
03-11 16:12:26.166: E/Vitamio[Player](344):     at android.os.AsyncTask$2.call(AsyncTask.java:185)
03-11 16:12:26.166: E/Vitamio[Player](344):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306)
03-11 16:12:26.166: E/Vitamio[Player](344):     at java.util.concurrent.FutureTask.run(FutureTask.java:138)
03-11 16:12:26.166: E/Vitamio[Player](344):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
03-11 16:12:26.166: E/Vitamio[Player](344):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
03-11 16:12:26.166: E/Vitamio[Player](344):     at java.lang.Thread.run(Thread.java:1019)

please help me. thanks

Selvin
  • 6,598
  • 3
  • 37
  • 43
tony
  • 1

2 Answers2

0

You are giving the file

/data/data/com.example.esporttv/libs/.lock

as a streaming source. You should always check if the file exists using file.exists() function.

Can you also post the lines where you initializee the player?

tasomaniac
  • 10,234
  • 6
  • 52
  • 84
  • i impliment in button onclick: if (!io.vov.vitamio.LibsChecker.checkVitamioLibs(Player.this)) return; mVideoView = new VideoView(Player.this); mVideoView.setVideoPath(video.getLiveUrl()+"/hls"); mVideoView.setMediaController(new MediaController(Player.this)); mVideoView.requestFocus(); mVideoView.start(); mVideoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() { @Override public void onPrepared(MediaPlayer mediaPlayer) { // optional need Vitamio 4.0 mediaPlayer.setPlaybackSpeed(1.0f); } }); – tony Mar 13 '14 at 04:46
  • As far as I understand, the problem is not with the videoPath or the video at all. It is with the checkVitamioLibs() function. As stated in here: https://github.com/yixia/VitamioBundle/wiki/Getting-Started , you should call this method in your onCreate method. Not in onClick() function. – tasomaniac Mar 13 '14 at 08:29
0

If you are using Android Studio, here is the solution, original article here:

  • Create a folder called “lib” (must be exactly this name)
  • Create subfolders in lib with desired architecture name such as “armeabi-v7a”, “armeabi” etc.
  • Put all your *.so file in the just created folder. Now your folder structure should be like this:

    lib\armeabi-v7a

    ...

    lib\armeabi

  • Zip the lib folder into a file, e.g. abc.zip;
  • Rename this abc.zip –> abc.jar
  • Copy this abc.jar to your project subfolder, anywhere should do, but I would typically put it in the app\libs\abc.jar
  • In the build.gradle, add below line.

That is it!

dependencies {
    compile files(‘libs/abc.jar’)
     …
}
David
  • 15,894
  • 22
  • 55
  • 66