Video inside ScrollView Mask BUG

Hello I noticed anytime you insert a video into a scrollView it will ignore the Graphics 2.0 scrollView masking…

The code below shows the example

local widget=require("widget") local dw=display.contentWidth local dh=display.contentHeight local spacer=0 local scrollView=widget.newScrollView{top=0,left=0,width=dw,height=dh-100} scrollView.anchorY=1 scrollView.x,scrollView.y=dw/2,dh for i=1,10 do local video=native.newVideo(dw/2,spacer,320,320) video.anchorY=0 video:load("http://files.parse.com/0524e7f8-43ae-4631-af91-3153c56ca2f9/2b24b0da-816f-46be-9656-1aa918247b51-video.mov",media.RemoteSource) scrollView:insert(video) spacer=spacer+370 end

It’s not a bug.  A mask can only mask content that is rendered within the OpenGL view.  A native video view is not rendered within OpenGL view.  The video is a view that is display on top of the OpenGL view, just like how a web view or text field view is always on top and is outside of the rendering system.

The only possible solution to this is to render a video to an OpenGL texture, which Corona does not support.  Even then, who knows if the operating system will still allow you to mask the video or not.  Video rendering tends to have special handling/limitations on different operating systems.

My suggestion is to change your design.  Most apps typically display a thumbnail of each video in a scroll view.

Thank you for your reply Joshua, I really appreciate it! I’ll take your advice.

Happy to help!

I also have one more bit of advise.  You might want to consider using our media.playVideo() instead of native.newVideo().  The reason is because the media.playVideo() will all the video to support all orientations (portrait and landscape) and ignores the orientation settings of your app.  This preferred if your app is locked to portrait, but needs to display landscape videos.  Versus the native.newVideo() API always displays videos locked to your app’s orientation because it is embedded within your main view… and while iOS supports rotating video views, Android does not (it’s an Android OS limitation).

It’s not a bug.  A mask can only mask content that is rendered within the OpenGL view.  A native video view is not rendered within OpenGL view.  The video is a view that is display on top of the OpenGL view, just like how a web view or text field view is always on top and is outside of the rendering system.

The only possible solution to this is to render a video to an OpenGL texture, which Corona does not support.  Even then, who knows if the operating system will still allow you to mask the video or not.  Video rendering tends to have special handling/limitations on different operating systems.

My suggestion is to change your design.  Most apps typically display a thumbnail of each video in a scroll view.

Thank you for your reply Joshua, I really appreciate it! I’ll take your advice.

Happy to help!

I also have one more bit of advise.  You might want to consider using our media.playVideo() instead of native.newVideo().  The reason is because the media.playVideo() will all the video to support all orientations (portrait and landscape) and ignores the orientation settings of your app.  This preferred if your app is locked to portrait, but needs to display landscape videos.  Versus the native.newVideo() API always displays videos locked to your app’s orientation because it is embedded within your main view… and while iOS supports rotating video views, Android does not (it’s an Android OS limitation).