问题
My project have video player.
First step: I create stack and input code:
on preOpenstack
set the fullScreenMode of this stack to "exactFit"
end preOpenstack
Second step: I create picture for play video. When I touch picture. The picture has hide and create native video player
here code:
on mouseUp
lock screen
set the visible of img "poster" to false
mobileControlCreate "player", "vdoplayer"
put the result into pID
mobileControlSet pID,"filename" , specialFolderpath("engine") & "/vdo.mp4"
mobileControlSet pID,"preserveAspect" , true
mobileControlSet pID,"showController" , true
mobileControlSet pID,"looping" , loop
mobileControlSet pID,"rect" , the rect of img "poster"
mobileControlSet pID,"visible" , true
mobileControlDo pID,"play"
unlock screen
end mouseUp
This stack size 1024*768. I tested on iPad. The player correct size.But when I tested on iPhone. The player incorrect size.
This picture is before touch image:
This picture is after touch image:
How do I fix this problem?
回答1:
Maybe this is what you're after...
mobileControlSet pID, "rect" , the rect of img "poster"
on second thoughts - it looks like that's already in your code - maybe try...
set the lockLoc of img "poster" to true
it could be getting resized to the images original dimensions at some point
回答2:
How about trying:
mobileControlSet pID,"rect" , the rect of this card
来源:https://stackoverflow.com/questions/24324546/how-to-set-rect-on-using-a-native-video-player-when-set-fullscreenmode-to-exact