Using 3rd party video player

ericvanderhoeven

Member
Licensed User
Longtime User
Guys,

does anyone know of how to work INSIDE an app with a 3rd party video player (like e.g. Vplayer) over the default videoplayer?

The videoview wrapper that is standard in B4A only gives me limited control (especially over the video orientation) and it seems to completely ignore changes to the default app settings of Android. I can set e.g. Vplayer as the default video playing app just fine to handle video plays when started through e.g. the file browser. However, even with these settings done correctly, when I call videoview in my App, it ignores this (new) default player and still passes it to the standard android videoplayer. Arggghhhh!

Is there a way to use e.g. an intent to start a 3rd party video player to play a specified file? Can you pass arguments (this may be the wrong wording...)?

I've experimented with intent and it works fine without passing an argument/ parameter such as a filename+location. No problem starting Angry Birds from my app for example...

Obviously, if I want to play a known video file, I need to pass these details when using an intent. But how to do that?

Or better yet, if somebody can tell me how to change e.g. the playing orientation of a standard videoview, that would even be better :cool:

All I want, is to play a video ''on its side'' inside a fixed Portrait view of the device.. Which would cause it to look like it is playing landscape (and people would rotate the device). I just do not want to rotate my entire orientation (via e.g. phone.setscreenorientation) to prevent the returning of my app to Activity_Create and thus the erasing of my settings/state. I know I can use Statemanager to save and return but .... that is just such a hassle and a big patch to do something rather simple... 99% of my app is in portrait but when I play a video, I like it to play ''landscape''. Vplayer allows for that perfectly by a simple change in its internal settings. So I can hold my phone in portrait mode and when I tap a video, it plays it ''landscape''. Great!

Thanks,

Eric
 

ericvanderhoeven

Member
Licensed User
Longtime User
I did...

I don't think you can use 3rd party player INSIDE your app. However, you can use Vitamio plugin with many options/controls. Check it here:
http://www.b4x.com/forum/additional...in-advanced-videoview-library.html#post111286

Hi Susu,

thank you for your quick reply. I checked that one out earlier but the main web-page link posted at the top is dead.. Seems like they moved. I then checked the added options/controls below but none of them seem to me capable of setting the orientation of the video inside the videoview. And this is exactly just the thing I am looking for :BangHead:

Thanks,

Eric
 
Upvote 0

susu

Well-Known Member
Licensed User
Longtime User
What do you mean "the orientation of the video"? You can set VideoView position/size like another view by code.
 
Upvote 0

susu

Well-Known Member
Licensed User
Longtime User
Ok, I just read your post in another thread. How about this:
- Your main screen or list of video is portrait.
- When user taps on one video, your app will start new activity with video view but in landscape?
I did it in my video app and it worked fine.
 
Upvote 0

ericvanderhoeven

Member
Licensed User
Longtime User
Picture says it all!

Ok, I just read your post in another thread. How about this:
- Your main screen or list of video is portrait.
- When user taps on one video, your app will start new activity with video view but in landscape?
I did it in my video app and it worked fine.

Hi Susu,

sometimes a picture says it all. See attached.

This is exactly what I need doing = have the overall app (remain) in portrait and once a video requires playing, I (with code in the App) should be able to change the play back orientation to e.g. landscape (while still keeping the main app in portrait). Something the 3rd party app Vplayer does without a sweat! The picture shows how it easily handles 3 different play back orientations (while still keeping the device in portrait mode...)

I of course am very interested to hear how you have accomplished something similar.

Thanks,

Eric
 

Attachments

  • video play back modes small.jpg
    video play back modes small.jpg
    60.3 KB · Views: 273
Upvote 0

moster67

Expert
Licensed User
Longtime User
hmm...I am not really sure what you want to do..

Vitamio is as far as I know the only way you can integrate the video-player in your app. You open a new activity and then set it to landscape or portrait or whatever you prefer.

If you need to open a 3rd party video-player you can probably use Intents or you could use this wrapper-library which I wrote a long time ago:

http://www.b4x.com/forum/basic4android-updates-questions/8517-found-way-stream-video-but-will-method-waste-devices-internal-memory.html#post47646

You could use VLC as a third party video-player. It automatically adjusts the videoview according to how the device is held (and its position). Maybe this is what you want?

Ps: link for VLC is here:
https://play.google.com/store/apps/details?id=org.videolan.vlc.betav7neon
 
Upvote 0

ericvanderhoeven

Member
Licensed User
Longtime User
video view orientation

hmm...I am not really sure what you want to do..

Vitamio is as far as I know the only way you can integrate the video-player in your app. You open a new activity and then set it to landscape or portrait or whatever you prefer.

If you need to open a 3rd party video-player you can probably use Intents or you could use this wrapper-library which I wrote a long time ago:

http://www.b4x.com/forum/basic4android-updates-questions/8517-found-way-stream-video-but-will-method-waste-devices-internal-memory.html#post47646

You could use VLC as a third party video-player. It automatically adjusts the videoview according to how the device is held (and its position). Maybe this is what you want?

Ps: link for VLC is here:
https://play.google.com/store/apps/details?id=org.videolan.vlc.betav7neon

Hi Monster67,

thanks for your reply. I will surely look into it (and also give VLC a go!)
What I want to do, is CONTROL/restrict in what orientation the video plays instead of leaving it up to the user to rotate the device. Instead of them rotating it and write code to catch the rotation and play accordingly, I want to preset and FIX the video play orientation and as a result, the user will rotate the device.

2 reasons for this =

1. My custom designed tablet does not have a rotation switch in order to simplify programming (no exception to catch and write code for)

2. I want to control how the content comes across and not leave that choice to the viewer. I am building an App (for this custom device) where WE are telling a story (often cultural sites where people would use this device to learn about its history). Having the content flip on the basis of the visitor playing around with the device, is only distracting to the story to tell.

I hope this makes sense. I need a method where I can be in fullcontrol of the video play orientation instead of leaving it up to the viewer and/or the default android video player. Apparently there are no straight forward setting you can pass to the default video player that sets its orientation different to its standard (which is normally a combination of the initial orientation of the home screen of the device and normally also follows the rotation switch)

Thanks,

Eric
 
Upvote 0

ericvanderhoeven

Member
Licensed User
Longtime User
Your videoplayer library

hmm...I am not really sure what you want to do..

Vitamio is as far as I know the only way you can integrate the video-player in your app. You open a new activity and then set it to landscape or portrait or whatever you prefer.

If you need to open a 3rd party video-player you can probably use Intents or you could use this wrapper-library which I wrote a long time ago:

http://www.b4x.com/forum/basic4android-updates-questions/8517-found-way-stream-video-but-will-method-waste-devices-internal-memory.html#post47646

You could use VLC as a third party video-player. It automatically adjusts the videoview according to how the device is held (and its position). Maybe this is what you want?

Ps: link for VLC is here:
https://play.google.com/store/apps/details?id=org.videolan.vlc.betav7neon

Hi Moster67,

I have looked at your videoplayer library and it works wonders on streaming a video from a URL with a third party player (I installed VLC). I however wish to play video files from local memory. How to insert this local memory reference into the string StreamAddress in StartActivity(myVideoPlayer.PlaySelectedPlayer(StreamAddress,PackageName))

Thanks,

Eric
 
Upvote 0

moster67

Expert
Licensed User
Longtime User
see my reply to your post in this thread:

http://www.b4x.com/forum/142123-post23.html

Hi Moster67,

I have looked at your videoplayer library and it works wonders on streaming a video from a URL with a third party player (I installed VLC). I however wish to play video files from local memory. How to insert this local memory reference into the string StreamAddress in StartActivity(myVideoPlayer.PlaySelectedPlayer(StreamAddress,PackageName))

Thanks,

Eric
 
Upvote 0
Top