vv.MediaControllerEnabled=False
Activity.AddView(Panel3, 0dip, 0dip, Activity.width, Activity.height)
Panel3.AddView(vv, 0dip, 0dip, Panel3.width, Panel3.height)
vv.LoadVideo("http", "videofile location")
vv.Play
Activity.AddView(Panel2, 400dip, 400dip, 60dip, 60dip)
Panel2.AddView(ImageView3, 0dip, 0dip, 60dip, 60dip)
ImageView3.Bitmap = LoadBitmap(File.DirAssets, "ouya_o.png")
ImageView3.Gravity=Gravity.fill
Panel2.BringToFront
ImageView3.BringToFront
@drgottjr
I've now fixed the compilation problems that was causing the UnsatisfiedLinkError.
Can you download the library again and test?
Download link is the same as before: http://android.martinpearman.co.uk/b4a/temp/VitamioBundle4_library_files_20130725.zip.
Thanks.
Martin.
yesss!
sound choppy - ie, basically white noise - on emulator (to be expected, i suppose), but no errors. only friendly log posts.
deployed to device (nexus with latest 4.3). left old vitamio dll(s) in place, as i was afraid if i uninstalled even for 5 minutes, the great google would have removed vitamio from download site "for my country". even so, bundle4 example initialized and ran without errors; sound and video perfect to my ancient organs. only problem, the control thingie didn't work. i don't use the controller (i just have start and stop buttons for user), so i'm not familiar with it. anyway, on emulator, i see the controller lets you pause the video. on device i can only see the time elapsed part of the controller along bottom of screen. so no way to stop video. in any case, i wanted to report that the thing runs. others can look into the controller issue; i want to see if i can start/stop a video programatically. also, i'm going to plug in my links to live video/audio feeds, which is what my app uses. fingers crossed. and good job.
-go
quick update to previous: links to several live feeds went well. tried as best i could to compare performance between a given stream on bundle4 and "same" stream under v3 wrapper. not scientifically valid, but seemed to be fine. will add stop button and roll out my full array of feeds.
side note: i deployed bundle4 to my old winmo hd2 which now runs ics. things started off well, controller was actually visible for a second, but system starting struggling after about 30 seconds and example failed. by way of comparison, the hd2 runs v3 wrapper without problem. won't even speculate what could be going on there, except to say that v3 may be happier with less power/memory.
Activity.AddView(VitamioVideoView1, 20dip, 30dip, 100%x-40dip, 100%y-60dip)
Sub VitamioVideoView1_Prepared
Log("VitamioVideoView1_Prepared")
VitamioVideoView1.SetLayout(20dip, 30dip, 100%x-40dip, 100%y-60dip)
VitamioVideoView1.SetVideoLayout(VitamioVideoView1.VIDEO_LAYOUT_SCALE, 0)
End Sub
Hi Martin,
Can we play video with subtitle yet?
Let me start by saying i'm not a user of this library - just the developer.
Looking back through this thread i thought that others had successfully displayed the VitamioVideoView sized so that it was less than full screen.
But testing the demo code i see that once a video starts playing, the VitamioVideoView is likely to expand to fully display the video.
The VitamioVideoView Top and Left will remain as originally set but the Width and Height will adjust to the video size.
In the demo project i modified the line that adds the VitamioVideoView to the Activity:
B4X:Activity.AddView(VitamioVideoView1, 20dip, 30dip, 100%x-40dip, 100%y-60dip)
Next i modified the 'Prepared' Sub:
B4X:Sub VitamioVideoView1_Prepared Log("VitamioVideoView1_Prepared") VitamioVideoView1.SetLayout(20dip, 30dip, 100%x-40dip, 100%y-60dip) VitamioVideoView1.SetVideoLayout(VitamioVideoView1.VIDEO_LAYOUT_SCALE, 0) End Sub
Trying to call SetVideoLayout in Activity_Create caused a null pointer exception so i thought calling it once the video was 'prepared' would be enough to force it to scale it's size as desired.
But it made no difference - the video expands rather than scales down in size.
Hopefully some other members can help...
Martin.
public void setVideoLayout(int layout, float aspectRatio) {
LayoutParams lp = getLayoutParams();
DisplayMetrics disp = mContext.getResources().getDisplayMetrics();
int windowWidth = disp.widthPixels, windowHeight = disp.heightPixels;
float windowRatio = windowWidth / (float) windowHeight;
float videoRatio = aspectRatio <= 0.01f ? mVideoAspectRatio : aspectRatio;
...
Hi susu.
I'm still waiting for moster to do a bit of research and get back to me on this.
Martin.
Hi susu.
I'm still waiting for moster to do a bit of research and get back to me on this.
Martin.
VitamioVideoView1.AddTimedTextSource(File.Combine(File.DirRootExternal, "Continuum2x11.srt"))
VitamioVideoView1.SetTimedTextShown(True)
VitamioVideoView1_TextSubtitleUpdated(SubText As String)
Sub VitamioVideoView1_Prepared
Log("VitamioVideoView1_Prepared")
VitamioVideoView1.AddTimedTextSource(File.Combine(File.DirRootExternal, "Continuum2x11.srt"))
VitamioVideoView1.SetTimedTextShown(True)
End Sub
Sub VitamioVideoView1_TextSubtitleUpdated(SubText As String)
Log(SubText) 'show SubText in a label or something similar
End Sub
@drgottjr
I've now fixed the compilation problems that was causing the UnsatisfiedLinkError.
Can you download the library again and test?
Download link is the same as before: http://android.martinpearman.co.uk/b4a/temp/VitamioBundle4_library_files_20130725.zip.
Thanks.
Martin.
Could you update library to 4.1.1?
Can you download version 4.1.1 of Vitamio, rename it to VitamioBundleNative.jar and copy it to your b4a additional libraries folder - over-writing the existing (older version) VitamioBundleNative.jar?
.
The update isn't compatible with the existing b4a wrapper - i shall need to take some time this weekend to download the update and see what needs to be done to make it compatible.
I'll keep this thread updated.
Martin.
private static String copyCompressedLib(Context ctx, int rawID, String destName) {
byte[] buffer = new byte[1024];
InputStream is = null;
BufferedInputStream bis = null;
FileOutputStream fos = null;
String destPath = null;
try {
try {
String destDir = getLibraryPath();
destPath = destDir + destName;
File f = new File(destDir);
if (f.exists() && !f.isDirectory())
f.delete();
if (!f.exists())
f.mkdirs();
f = new File(destPath);
if (f.exists() && !f.isFile())
f.delete();
if (!f.exists())
f.createNewFile();
} catch (Exception fe) {
Log.e("loadLib", fe);
}
is = ctx.getResources().openRawResource(rawID);
bis = new BufferedInputStream(is);
fos = new FileOutputStream(destPath);
while (bis.read(buffer) != -1) {
fos.write(buffer);
}
} catch (Exception e) {
Log.e("loadLib", e);
return null;
} finally {
IOUtils.closeSilently(fos);
IOUtils.closeSilently(bis);
IOUtils.closeSilently(is);
}
return destPath;
}
is = ctx.getResources().openRawResource(rawID);
VitamioVideoView1.LIB_INSTALL_PATH=File.Combine(File.DirRootExternal, "libarm.so")
If VitamioVideoView1.CheckVitamioLibs Then
VitamioVideoView1.Initialize("VitamioVideoView1")
Activity.AddView(VitamioVideoView1, 0, 0, 100%x, 100%y)
VitamioMediaController1.Initialize("VitamioMediaController1")
VitamioVideoView1.SetMediaController(VitamioMediaController1)
VitamioVideoView1.SetVideoQuality(VitamioVideoView1.VIDEO_QUALITY_HIGH)
VitamioVideoView1.SetVideoPath("http://devimages.apple.com/iphone/samples/bipbop/gear1/prog_index.m3u8")
End If
I know of no other library that is similar to Vitamio.
So you have to set the path to the downloaded libarm.so file before calling CheckVitamioLibs.
The library method copyCompressedLib would fail to find libarm.so in the apk assets, and check to see if a path to libarm.so has been set.
If set it'd install libarm.so from that path, otherwise installation of the library would fail.
Sounds like a backwards step to me - reverting to how the older versions of Vitamio required a download.
What do you think?
Martin.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?