Media control buttons in 360 Video player made using google cardboard and rajawali - google-cardboard

I have created a VR video player using Google Cardboard Android SDK and Rajawali VR.
I want to add control buttons like play, pause, stream like a normal video player.
How can I implement this?

Create a button UI inside the Sphere where your 360 video is textured.
Try this code:
Material playBtnM = new Material();
playBtnM.setColorInfluence(0);
try {
//place the button picture in "res/drawable-nodpi/"
playBtnM.addTexture(new Texture("playBtn", R.drawable.play));
} catch(TextureException e) {
e.printStackTrace();
}
Plane playBtn;
playBtn = new Plane(1, 1, 8, 8);
playBtn.setScale(-1);
playBtn.setMaterial(playBtnMaterial);
playBtn.setPosition(0, 0, -2);
playBtn.setAlpha(0);
this.getCurrentScene().addChild(playBtn);
You can use Cube or other primitves rather than Plane in Rajawali to map your texture to.
Create your own way to trigger the button. For example, using a focus point at the center. If the focus point is inside the button, then the button is triggered.
Notify the video player. Call start(), pause() or stop() method of MediaPlayer to control playback when the button is triggered.

Related

custom seekbar/scrubber on a media player UWP

So I'm coding a music player and don't want to use their defualt mediaplayer control panel.
I have a slider object (SeekBar) and I know I can update it to display the postion i am in a current song as such:
SeekBar.Value = (int)PlayMusic.Position.TotalMilliseconds;
So when I call the above the bar move to the exact position I need it to be
So how can I start a thread (async method?) that calls a function that loops the above every millisecond. I'm pretty new and have been trying this for a while.

is there a way to keep updating GL contents with paintGL in QT?

I'm writing a video player with two QGLWidgets -- a controller(a menu with buttons like select, play) and a viewer(where the video actually gets played). For the viewer, I have the paintGL function calling the display function I implemented to update each frame. But unless I resize the viewer window or switch between the two windows, the viewer doesn't update itself and just stops on the third frame.
In other post, I found that I have very little control over when paintGL gets called (resizing is one of the cases where it gets called). Is there a way to work around the this?
Thanks!
Edited:
So I have two classes: Player and Viewer (both QGLWidgets)
When running the program, a player (the controller) will be displayed, and users can choose a video and hit the play button. The player handles the play button in the way that it creates a Viewer which plays the selected video.
def handlePlayButton(self):
self.viewer = Viewer(self.filepath)
self.viewer.show()
And the Viewer is initialized and updated as following
def paintGL(self):
self.display() //update the window with the current frame
glViewport(0, 0, self.vid.getWidth(), self.vid.getHeight())
def resizeGL(self, w, h):
glMatrixMode(GL_PROJECTION)
glLoadIdentity()
def initializeGL(self):
//initialize the shaders with other libraries

Simple UIWebView

I'm making a tab bar app and one of the tabs is a youtube channel. It works fine and is perfect but the one problem is when i click on the video it plays but only in the standard view and not in Landscape. Any ideas on how to fix. Im sure its really simple but i've been having no luck.
This question probably answers what you are trying to do:
Webview resizes automatically to portrait and landscape view in iphone
The key thing to take away from it is that you need your view controller to tell the app that it supports the other orientations, not just portait.
- (BOOL) shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation) orientation
{
return YES;
}

J2ME - changing views in game

I am currently writing a J2ME app for a card game which begins at a menu screen which gives the option to select a number of different card games to play.
This menu screen is a form and I need to know how to navigate to the new form for the games.
public void commandAction(Command c, Displayable s) {
if(c.equals(exitComm)){
}
else if(c.equals(gameComm))
{
//start the queen game...create instance of QueensForm
QueensForm form = new QueensForm(null, "Queens");
display.setCurrent(form);
System.out.println("pressed play");
}
As it stands the app compiles and runs, however when the play button is clicked an error occurs and it says the problem is on the line display.setCurrent(form); I am unsure of the problem and was wondering if anybody could help me to sort this out or suggest a better way to navigate throughout the forms in the app.

iPhone - iOS4 - Movie Player - Fullscreen does not work

I have implemented MPMoviePlayer functionality to play in landscape mode in iOS4- by reading information on other posts - thanks stackoverflow!
Basically I have a list of videos in tabular view and from that I can navigate to each video.
Problem I am facing is the video does play in fullscreen (landscape) however the top title bar and bottom navigation bars continue to be visible above the movie. I have tried to hide the bottom tabbar
[self.navigationController setHidesBottomBarWhenPushed:YES];
[self.navigationController pushViewController:MstvideoplayerView animated:YES];
as well as tried to bring the movie subview to front
[[mpMoviePlayerControllerObj view] setFrame:CGRectMake(0, 0, 480, 320)];
[[self view] bringSubviewToFront:[mpMoviePlayerControllerObj view]];
mpMoviePlayerControllerObj.controlStyle = MPMovieControlStyleFullscreen;
However the top title bar (from movie list view) and bottom navigation bar still remain - on top of the movie player window.
How do I hide/get rid of these 2?
If you call the UIViewControllers method
presentModalViewController:(UIViewController *)modalViewController animated:(BOOL)animatedwith the MPMoviePlayerViewControllerinstance, it should present the movie player fullscreen

Resources