Android Question FFMpegVideoView1 XmlLayoutBuilder

ronovar

Active Member
Licensed User
Longtime User
I definex ffmpeg in xml:

B4X:
<RelativeLayout
         android:layout_width="589dp"
         android:layout_height="340dp"
         android:layout_alignParentTop="true"
         android:layout_alignParentRight="true"
         android:paddingTop="100dp"
         android:paddingRight="71dp" >
    
         <ImageView
              android:id="@+id/imgPreview"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:src="@drawable/preview" />
            
         <tv.danmaku.ijk.media.widget.VideoView
              android:id="@+id/videoViewRelative"
              android:layout_width="fill_parent"
              android:layout_height="fill_parent">
          </tv.danmaku.ijk.media.widget.VideoView>
     </RelativeLayout>

And Calling view using XmlLayoutBuilder

B4X:
'DEFINE - FFMpegVideoViews
Dim FFMpegVideoView1 As FFMpegVideoView

'GET - FFMpegVideoViews
FFMpegVideoView1 = Xml.GetView("videoViewRelative")

And i im getting error:

B4X:
FFMpegVideoView1 = Xml.GetView(\
javac 1.8.0_66
src\com\project\tv.java:389: error: cannot find symbol
mostCurrent._ffmpegvideoview1.setObject((tv.danmaku.ijk.media.widget.VideoView)(mostCurrent._xml.GetView(mostCurrent.activityBA,"videoViewRelative")));
                                           ^
  symbol:   class danmaku
  location: class tv
 

ronovar

Active Member
Licensed User
Longtime User
i im using ffmpeg for b4a library and this is strange when i run in debug mode i first need to:

B4X:
'GET - FFMpegVideoViews
    Xml.GetView("videoViewRelative")
    'FFMpegVideoView1 = Xml.GetView("videoViewRelative")

Then i need to Press Restart (F11) in B4A with this code then it works:

B4X:
'GET - FFMpegVideoViews
    Xml.GetView("videoViewRelative")
    FFMpegVideoView1 = Xml.GetView("videoViewRelative")


Then after i press restart or compile again i got above error....is this bug in B4A or i need to declare it another way?

I im using this excellent library that have wrapper:

https://www.b4x.com/android/forum/t...peg-library-for-b4a-decoding-streaming.44476/
 
Upvote 0

ronovar

Active Member
Licensed User
Longtime User
I get the point...if i save xml file and run debug it will compile fine....and if i don't change xml and run debug and release mode it will compile fine and run. I must not modify xml after first debug run or i will get above error...i think this is reading privileges from windows.
 
Upvote 0

ronovar

Active Member
Licensed User
Longtime User
Erel..i can't use FFMpeg wrapper in B4A designer...and using code...i don't get video scalled when i switch fullscreen and small screen...and my apk does not looks same on all android boxes runing different version of android os...so this way i decided to use xml as i test three devices it looks same...previus apk that uses B4A code to add elements programatically looks different on all three boxes...this is the reason for using XML layout...and Android Studio uses XML layouts..so that apk looks same on all android devices.
 
Upvote 0
Top