Unity3d Android play video instead of video textures

Source: Internet
Author: User

Export APK, can not use the film texture, so we can only use this method

This one

Handheld.playfullscreenmovie ();

or This function
Iphoneutils.playmovie ();

 voidOngui () {if(GUI. Button (NewRect (Screen.width/2-Ten, Screen.height/2-Ten, -, -),"(h) Cancelontouch") {Handheld.playfullscreenmovie ("123.mp4", Color.Black, fullscreenmoviecontrolmode.canceloninput); }        if(GUI. Button (NewRect (Screen.width/2-Ten, Screen.height/2+Ten, -, -),"(h) full") {Handheld.playfullscreenmovie ("123.mp4", Color.Black, fullscreenmoviecontrolmode.full); }        if(GUI. Button (NewRect (Screen.width/2-Ten, Screen.height/2+ -, -, -),"(h) Hidden") {Handheld.playfullscreenmovie ("123.mp4", Color.Black, Fullscreenmoviecontrolmode.hidden); }        if(GUI. Button (NewRect (Screen.width/2-Ten, Screen.height/2+ -, -, -),"(h) Minimal") {Handheld.playfullscreenmovie ("123.mp4", Color.Black, fullscreenmoviecontrolmode.minimal); }          }  
There are four modes of Fullscreenmoviecontrolmode ,

1. Touch screen video off during video playback

2. When the video player pops up the iOS advanced control, controls the video pause to play fullscreen, and so on.

3. The video cannot be stopped when it plays, and automatically shuts down when it plays

4. When the video is playing, the iOS advanced control is ejected to control the playback progress.

Four types of modes

Iphoneutils.playmovie ();

is the same

 voidOngui () {if(GUI. Button (NewRect (Screen.width/2- the, Screen.height/2-Ten, -, -),"(i) Cancelontouch") {Iphoneutils.playmovie ("123.mp4", Color.Black, Iphonemoviecontrolmode.cancelontouch, Iphonemoviescalingmode.aspectfit); }        if(GUI. Button (NewRect (Screen.width/2- the, Screen.height/2+Ten, -, -),"(i) full") {Iphoneutils.playmovie ("123.mp4", Color.Black, Iphonemoviecontrolmode.full, Iphonemoviescalingmode.aspectfit); }        if(GUI. Button (NewRect (Screen.width/2- the, Screen.height/2+ -, -, -),"(i) Hidden") {Iphoneutils.playmovie ("123.mp4", Color.Black, Iphonemoviecontrolmode.hidden, Iphonemoviescalingmode.aspectfit); }        if(GUI. Button (NewRect (Screen.width/2- the, Screen.height/2+ -, -, -),"(i) Minimal") {Iphoneutils.playmovie ("123.mp4", Color.Black, Iphonemoviecontrolmode.minimal, Iphonemoviescalingmode.aspectfit); }    }  

Iphonemoviecontrolmode 's method is obsolete and can be replaced by Fullscreenmoviecontrolmode

Iphonemoviescalingmode is the mode of scale adjustment, which is set to null on the line.
It's common sense to play it,


But another problem came up.
Don't play the video, it's dark, but it shows the final time
This is the phone resolution problem, remember that the resolution (game panel) must be the same as the phone settings, otherwise it will not play


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.