It won't help you much, but I asked perplexity the question. It seems there are known issues, but no solution thus far.
https://www.perplexity.ai/search/are-there-any-known-issues-rel-oapCvo1OSBa5rMnIm5ODWA
Thanks for your interest
@stevel05. I had asked ChatGPT and received a similar response, however I was somewhat cautious because just as Perplexity has done, ChatGPT has referenced other posts I've made in this Forum to validate the claim that there are known problems. So it's a bit circular. However it's pleasing that both Perplexity and ChatGPT include other references and indeed my post
JavaFX MediaView under Win11 referenced a couple to validate my claim that the underlying issue is Win10/Win11 related.
Interestingly while Perplexity refers to problems with VLCJ, I have tried the B4JVlcj library as an alternative to MediaView in an attempt to overcome the problem and under Win11 never saw any of my videos fail to play, however this was not a workable solution because there is a significant delay in the videos playing after loading, noting that as far as I can see, the load and play method is combined, ie. there is no opportunity to overcome the shortcoming by first loading and then playing.
There is another report of this bug.
note:
I've asked if a possible solution is to add third-party codecs to the JavaFX Media API, but this requires more complex modifications.
Yes
@TILogistic that bug report is one of the two references I included in my post
JavaFX MediaView under Win11. Despite the complexity to which you refer, I'd be interested where to find the details, although adding third-party codecs would certainly be straying into the great unknown for me!
@bdunkleysmith
This problem is intriguing me. From our private conversation I understand that you are running pre-match video clips, in a pre-configured sequence, for each member of your sports team from B4J program. The desired platform is Win 10.
@RichardN perhaps it's a typo in your post, but my desired target is Win11.
Firstly in regard to
This does not sound like a platform or codec issue to me but rather an issue with the Java Runtime. Have you tried reinstalling that?
I create an installer by using the inbuilt standalone package creation tool and Inno Setup and so the installed Java runtime is irrelevant as I understand it. I have created packages using Java versions 19, 21 and 24, all of which show the same problem. Going back to using a Win10 machine has been the only reliable solution.
Indeed you describe the essence of the program and here's a
YouTube video showing it in action here's some further
background.
I presume you have some interface that determines the play sequence?
Here's some more detail relating to that:
- Using a MQTT based API create:
- a B4XOrderedMap of the up to 12 players selected to play in the particular game, ordered by the playing uniform as the key mapped to the player's UUID
- an array (arrayHome(12, 5)) which initially contains the player UUID, playing uniform number and player's name, and is subsequently populated with statistics such as points scored, rebounds and assists for display on the same video screen during the game
- On clicking the play introductions button, firstly play one of several selectable club introductory videos of around 15 - 25s
- On completion of the introductory video (MediaView_Complete event), play a short video (~6s) or display an image of each player in playing uniform number order, meaning any of up to 12 of around 20 videos of registered players may be called by the app
- By iteratively working through the B4XOrderedMap and using the player UUID to look up the player's name in arrayHome, load a video file named player first initial DOT SPACE player last name DOT MP4 into MediaView, wait for the READY state and then play
If the video file does not exist or an error is thrown, then load an image file named player first initial DOT SPACE player last name DOT PNG into ImageView
- On the MediaView_Complete event, 7 second watchdog timer expiration or after a user selectable delay, nominally 4s in the case of an image being shown, continue the loop through the B4XOrderedMap until all player videos/images have been shown
- Show an image named End.PNG or play a video named Extra.MP4 if that option is selected for use when special presentations such as for milestones are made after the player introductions.
Individually the videos play OK in MediaView but when strung in a sequence you are getting unpredictable crashes.
All videos generally play OK, even under Win11. I was not immediately alerted to the problem after upgrading the production laptop from Win10 to Win11 because first use was for some teams for which we don't use player videos, but just images. But in hindsight I recall a couple of occasions where after selecting the introductory video which is played whether we subsequently show player videos or images, that the introductory video didn't play. I just thought I'd not clicked the select button correctly or something, ie. a user error. But this should have alerted me to a new problem because I'd not noticed it before. The problem only became really apparent when our teams for which we do use player videos in the introduction commenced their season some weeks later and I saw the player video failures. Ensuring there was at least an image of the player as a fallback position was the workaround, but it doesn't look very professional with some images being shown in amongst videos.
Have you built in any process delay between the videos playing? I am totally guessing here but the MediaView play process is probably asynchronous to the code. If you initialise the next video before the last clip has completed the results could be unpredictable.
Are you checking:
Sub MediaView_Complete
'Before initialising the next video ?
End Sub
Indeed the MediaView_Complete event is used as a condition before loading the next source (video) and as indicated above, I've added in waiting for the READY state before initiating play, but no discernible effect. I do not reinitialise the MediaView each time. I seem to recall reinitialising each time was more problematic when I used that method. I just use MediaView.Dispose before setting the new source. But in answer to your specific question, currently I do not have a delay as such included, but I recall trying such a thing but short delays appeared to have no effect and long delays are unacceptable as we really can't extend the player introductions. I dismissed a delay as a solution.
If you want to share the code and clips here (or privately) then I don't mind taking a look.
Because the code relies on credentials which I'm not permitted to share to access the API and in any event requires the courtside statistics collection software to be running, sharing the code as is wouldn't be usable by others, but I'd welcome another set of eyes to look at it, even though I admit it has become somewhat spaghetti code. I'll extract the relevant parts of the original code and perhaps create a variant that can reference the videos without using the API.
Again, thanks all for your interest and support.