Bug? B4i v2.0, Find VideoView with Page1.RootPanel.GetAllViewsRecursive

Discussion in 'iOS Bugs & Wishlist' started by Pendrush, Jul 9, 2015.

  1. Pendrush

    Pendrush Well-Known Member Licensed User

    If v Is VideoView is always false.


    Code:
    'Code module
    #Region  Project Attributes
        
    #ApplicationLabel: B4i Example
        
    #Version: 1.0.0
        
    'Orientation possible values: Portrait, LandscapeLeft, LandscapeRight and PortraitUpsideDown
        #iPhoneOrientations: Portrait, LandscapeLeft, LandscapeRight
        
    #iPadOrientations: Portrait, LandscapeLeft, LandscapeRight, PortraitUpsideDown
    #End Region

    Sub Process_Globals
        
    'These global variables will be declared once when the application starts.
        'Public variables can be accessed from all modules.
        Public App As Application
        
    Public NavControl As NavigationController
        
    Private Page1 As Page

        
    Private VideoV As VideoView
        
    Private btnFindView As Button

       
    End Sub

    Private Sub Application_Start (Nav As NavigationController)
       
        NavControl = Nav
        Page1.Initialize(
    "Page1")
        Page1.Title = 
    "Page 1"
        Page1.RootPanel.Color = 
    Colors.White
        
    'NavControl.ShowPage(Page1)
       
               
        VideoV.Initialize(
    "VideoV")
        btnFindView.Initialize(
    "btnFindView", btnFindView.STYLE_SYSTEM)

        Page1.RootPanel.AddView(btnFindView, 
    0010050)
        Page1.RootPanel.AddView(VideoV.View, 
    00100%x100%y)
       
        btnFindView.Text = 
    "Find VV"
        btnFindView.Color = 
    Colors.LightGray
       
        VideoV.ShowControls = 
    False
                   
        NavControl.ShowPage(Page1)
       
        CallSubDelayed(Me, 
    "PlayVideo")
       
       
    End Sub

    Private Sub Page1_Resize(Width As Int, Height As Int)
       
        VideoV.View.Height = Height
        VideoV.View.Width = Width
       
        btnFindView.Top = Height - btnFindView.Height
        btnFindView.Left = Width - btnFindView.Width
       
        btnFindView.BringToFront
           
    End Sub

    Private Sub Application_Background
       
    End Sub

    Public Sub PlayVideo
       
        VideoV.Stop
        VideoV.LoadVideoUrl(
    "https://devimages.apple.com.edgekey.net/iphone/samples/bipbop/bipbopall.m3u8")
       
    End Sub


    Private Sub VideoV_Ready
       
        VideoV.Play
       
    End Sub


    Private Sub btnFindView_Click
       
        
    For Each v As View In Page1.RootPanel.GetAllViewsRecursive
       
            
    If v Is VideoView Then
                
    Log("Found: " & v) '< This line is not executed
            End If
            
    'Log (v)
        Next
       
    End Sub

    As a workaround I use panel and add VideoView in panel, then remove all views from panel, that is only way to remove VideoView from page.
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    This is the expected result as VideoView itself is not a view.
     
    Pendrush likes this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice