I found myslf unable to add an ExoPlayer to my project so I went back to the simplest example, found at the end of the ExoPlayer Library post, to try to duplicate the problem. ExoPlayerExample as downloaded there compiles and runs perfectly on my device.
I then did a Save As on layout "1" and saved it as layout "2." I changed one line of code to "2" to use layout "2" instead of the original "1" :
This also ran perfectly. No problem.
Then I created a third layout from scratch, without duplicating the original one. I placed a SimpleExoPlayer view onto a new layout. I kept the name at the default, the same as views "1" and "2". I changed the line of code to "3" to load the new layout instead of layout "2":
This time, the project crashes. The layout is unable to load, with the following error message at the end of the debugger:
This looks like it explains why I can't add an ExoPlayer to my project. Am I missing a step somewhere, or is this a bug that has appeared recently? Library versions are the latest ones.
I then did a Save As on layout "1" and saved it as layout "2." I changed one line of code to "2" to use layout "2" instead of the original "1" :
ExoPlayer Example Code:
Sub Activity_Create(FirstTime As Boolean)
If FirstTime Then
player1.Initialize("player")
Dim sources As List
sources.Initialize
sources.Add(player1.CreateUriSource("https://html5demos.com/assets/dizzy.mp4"))
player1.Prepare(player1.CreateListSource(sources))
End If
' Activity.LoadLayout("1")
Activity.LoadLayout("2")
SimpleExoPlayerView1.Player = player1
player1.Play
End Sub
This also ran perfectly. No problem.
Then I created a third layout from scratch, without duplicating the original one. I placed a SimpleExoPlayer view onto a new layout. I kept the name at the default, the same as views "1" and "2". I changed the line of code to "3" to load the new layout instead of layout "2":
ExoPlayer Example Code:
Sub Activity_Create(FirstTime As Boolean)
If FirstTime Then
player1.Initialize("player")
Dim sources As List
sources.Initialize
sources.Add(player1.CreateUriSource("https://html5demos.com/assets/dizzy.mp4"))
player1.Prepare(player1.CreateListSource(sources))
End If
' Activity.LoadLayout("1")
' Activity.LoadLayout("2")
Activity.LoadLayout("3")
SimpleExoPlayerView1.Player = player1
player1.Play
End Sub
This time, the project crashes. The layout is unable to load, with the following error message at the end of the debugger:
Caused by: java.lang.NoSuchFieldException: RESIZE_MODE_null
at java.lang.Class.getField(Class.java:1604)
at anywheresoftware.b4a.objects.SimpleExoPlayerViewWrapper.setResizeMode(SimpleExoPlayerViewWrapper.java:69)
This looks like it explains why I can't add an ExoPlayer to my project. Am I missing a step somewhere, or is this a bug that has appeared recently? Library versions are the latest ones.