Log in or register to post comments

Videoplayback vertical video

November 19, 2012 - 11:04am #1

Hi guys i am trying to play vertical video on target. 

   // Get the video width and height
                    int videoWidth = mVideoPlayer.GetVideoWidth();
                    int videoHeight = mVideoPlayer.GetVideoHeight();

                    if (videoWidth > 0 && videoHeight > 0)
                    {
                        // Scale the video plane to match the video aspect ratio
                        float aspect = videoHeight / (float) videoWidth;

                        // Flip the plane as the video texture is mirrored on the horizontal
                        transform.localScale = new Vector3(-0.1f, 0.1f, 0.1f * aspect);
                    }

This is part of code to change. Anyone help me pls ?

 

Videoplayback vertical video

November 20, 2012 - 7:44pm #9

Hi david

I want play video on target. and thats working but not full screen.

my problem is http://s10.postimage.org/8ma5tqint/sssadsda.png 

 

Thank you again david.

 

Videoplayback vertical video

November 20, 2012 - 10:54am #8

Have you added a VideoPlaybackController to your ARCamera?

if you want to force the player to always play fullscreen, revise line 147 to..

video.VideoPlayer.Play(true, video.VideoPlayer.GetCurrentPosition())

 

Is that what you're trying to do?

Videoplayback vertical video

November 19, 2012 - 9:43pm #7

Hi David thanks again to help me. 

I actually found my mistake. My video wasnt in streamingassets thats why doesnt play video.

But my video still doenst play full screen. I mean not fixed scale on target. 

when i remove that code                         transform.localScale = new Vector3(-0.1f, 0.1f, 0.1f * aspect);

it doesnt change anything..
 

Videoplayback vertical video

November 19, 2012 - 4:17pm #6

hmm.. Have you been able to play this video using Video Playback previously - do you see any errors in your log?

Videoplayback vertical video

November 19, 2012 - 1:54pm #5

Thank you david,  I removed that code                         "transform.localScale = new Vector3(-0.1f, 0.1f, 0.1f * aspect);"

But video doesnt play. loading and black screen for 1 sec and then camera is coming back.


 

Videoplayback vertical video

November 19, 2012 - 1:22pm #4

I've seen your example. Set your video window to the desired size in the Unity editor and remove the line that sets transform.localScale. That should preserve your video size.

Videoplayback vertical video

November 19, 2012 - 1:18pm #3

i couldnt it  :( could you explain more ?

Videoplayback vertical video

November 19, 2012 - 12:09pm #2

By 'vertical' do you mean that you want the video height to be greater than it's width? Try authoring the video to the dimensions you want in the Editor and comment out the transform.localScale = ... statement (i.e. //transform.localScale = ..)

Log in or register to post comments