How to set rect on using a native video player when set fullscreenmode to “exactFit” in Livecode?

老子叫甜甜 提交于 2019-12-14 03:59:26

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!