• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
This question was closed Mar 30, 2015 at 09:44 AM by clunk47 for the following reason:

Problem is not reproducible or outdated

avatar image
1
Question by adrianrdzv · Aug 10, 2011 at 09:18 AM · androidvideomovieplayback

Android video playback

I'm having problems with video playback in Android.

There is not much documentation on this, Unity docs only say to use iPhoneUtils.PlayMovie()

Is this line of code supposed to work in Android?

iPhoneUtils.PlayMovie("video.mp4",Color.black, iPhoneMovieControlMode.Hidden);

I installed Quicktime and I have Android Pro. When I deploy the application to my tablet and reach the point to play the video the screens turns black and that's it. I tried with different versions of the video (mp4 and 3gp).

The log shows:

VERBOSE/MediaPlayer-JNI(8664): native_setup VERBOSE/MediaPlayer(8664): constructor VERBOSE/MediaPlayer(8664): setListener VERBOSE/MediaPlayer-JNI(8664): seekTo: 0(msec) VERBOSE/MediaPlayer(8664): seekTo 0 ERROR/MediaPlayer(8664): Attempt to perform seekTo in wrong state: mPlayer=0x0, mCurrentState=1 ERROR/MediaPlayer(8664): message received msg=100, ext1=-38, ext2=0 VERBOSE/MediaPlayer(8664): notify(100, -38, 0) callback on disconnected mediaplayer INFO/ActivityManager(2488): Displayed activity com.qualcomm.QCARUnityPlayer/com.unity3d.player.VideoPlayer: 70 ms (total 70 ms)

Is there any working sample code using unity video playback in Android?

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image tonyarabish · Oct 25, 2018 at 06:27 AM 0
Share

Avdshare Video Converter is the most professional video to Android converter with which any unsupported video can be easily converted to Android products supported video formats. See the guide:https://www.avdshare.com/convert-avi-to-android-supported-video-formats

2 Replies

  • Sort: 
avatar image
3
Best Answer

Answer by adrianrdzv · Aug 10, 2011 at 01:11 PM

I found the problem.

I knew that the video should be placed in the Streaming Assets folder, what I didn't know is that if you place it in another folder within Streaming Assets, you should include the folder name in the iPhoneUtils.PlayMovie() call.

 iPhoneUtils.PlayMovie("Movies/video.mp4",Color.black, iPhoneMovieControlMode.Hidden);

Hope this helps to anyone making this silly mistake.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image cregox · Oct 18, 2011 at 05:38 PM 0
Share

somewhat related links: http://answers.unity3d.com/questions/18503/how-integrate-video-before-menu-in-unity-iphone-ga.html and http://forum.unity3d.com/threads/80109-Does-iPhoneUtils.Play$$anonymous$$ovie-work-on-Android-devices in my case the issue was the codec somehow. Videos would play on Android but not inside Unity.

avatar image
3

Answer by aubreuil56 · Mar 30, 2015 at 09:26 AM

This issue is fixed with Unity 5, Handheld class now works if you had normal license, no need for Android Pro with Unity 5, thanks all

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to check if Handheld.PlayFullScreenMovie has stopped playing 2 Answers

How to play a video clip on android device 1 Answer

Access Native Video files from Unity on Android / iOS 0 Answers

why cannot build movie texture on android? 4 Answers

Android MP4 Video Playback 2 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges