开发者

media player screen rotation issue

开发者 https://www.devze.com 2023-03-01 21:08 出处:网络
i have made a media player and have called setDataSource(), setDisplay() and prepare() methods in onSurfaceCreated() method. Everything works fine when the view is rendered for the first time, if i ro

i have made a media player and have called setDataSource(), setDisplay() and prepare() methods in onSurfaceCreated() method. Everything works fine when the view is rendered for the first time, if i rotate the screen, display disappears and only audio is availaible.How would I get it working? I have used video view for displaying video. P开发者_开发问答lease help me with this issue.


From your question I can see that you are using a surface view which will re initiate when you rotate your screen. so you must set your screen mode to either landscape or portrait based on your requirement. Else you must figure out some other way other than using surface view.


When you rotate the screen, Activity gets destroyed and a new one is created with a different configuration. If something doesn't work, it means that you should test your application in the landscape mode.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号