Hello everyone,
I only have sound unfortunately!
mp4 playback is fine.
What can I do?
Is it possible to convert to mp4 with xojo?
Thank you for your help.
Does the video work on other playback applications on your machine? For example on Mac there is a quicktime player. If the video plays in that then it should play in MoviePlayer. If it doesnāt then you likely need a codec for the video to work.
To give some background MP4 is a container file format. Within it you can have a video stream and multiple audio streams. Each of these can be in all one of many of formats and each has its own codec to enabled playback. Some codecs are provided as standard, such as the generic mp4 video codec.
You can either obtain the correct codec or convert the video to use a new format. There is a program called Handbrake which can handle most video conversions required. It is free and available on Mac, Windows and Linux.
Loading the MP4 file into Handbrake will also tell you which codecs are being used. Most modern versions of each OS comes with stock MP4 codec. There are others like VOB and ORBIS which arenāt as common but liked by the free somewhere advocates. These typically need to be installed on each platform you are going to play the video on.
Oui la vidƩo est lue sur mon mac avec quicktime player
La vidéo uploadée doit être lue juste après par mon appli xojo
Je ne peux pas faire une conversion manuelle
Quel moyen existe t il ? soit pour une conversion en interne avec une classe ou autre moyen�
Merci.
Standard Xojo will not do video conversion. There could be an MBS or other 3rd party solution. However, video conversion is a slow process, it can take more time to convert than the duration of the video. For example a 1 hour video can take longer than 1 hour to convert.
Is this a web project or a desktop one. With you saying upload it makes me think it is Web. If it is web then does the video play if you drop it on your web browser?
The video is saved in a .mov directory and my desktop app will immediately play this videoā¦
Iām looking at MBS to see if thereās a way with one of their classes.
Xojoās movie player control should play the video.
But mov is a container, which can have video streams of different codecs. If you have a codec in the file, which your computer doesnāt have, you canāt play it.
Our AVPlayerViewControlMBS control may help as an alternative for macOS.
Thank you very much Christian for your quick feedback
Your example works, which allows me to play my video in .MOV
I try to put it in my code but I get an error, I donāt know why!
Looks like you didnāt copy PlayerWindow.
Yes! hereās the right code
But how can I start playing the video automatically and wait until the end of the video to exit the condition? Thanks for your help.
Iāve noticed that it deletes all canvas on the same window!
If picFolder <> Nil Then
Dim p As Picture
If nb > picFolder.Count-1 Then nb=0nb = nb+1
Window2.Label2PhotosTotal.Text=picFolder.Count.ToStringf = picFolder.Item(nb)
dim player as new AVPlayerMBS(f )
dim w as new Window1If f.Name.Right(5)=ā.jpegā or f.Name.Right(4)=ā.jpgā or f.Name.Right(4)=ā.pngā Then
Var p2 As Picture = ProportionalScale(Picture.Open(f),Canvas1.Width,Canvas1.Height) Canvas1.Backdrop=p2 Var P4 As Picture = ProportionalScale(Picture.Open(f),Window2.Diapo.Width,Window2.Diapo.Height) Window2.Diapo.Backdrop=P4 Label1.text="PHOTO"
else
If f.Name.Right(4)=ā.MOVā or f.Name.Right(4)=ā.mp4ā thenw.player = player w.AVPlayerView.player = player Label1.text="VIDEO" End If
End If
end if
Timer2.Enabled=True
Well, you could read documentation to find the player and a play method.
Then you may check addBoundaryTimeObserverForTime method to add a callback for timer.
And you check BoundaryTimeObserver event in your AVFoundationMBS subclass to catch the event.
However, it opens a new window every time thereās a video in the loop!
I found it! Hereās the modified code
If f.Name.Right(4)=ā.MOVā or f.Name.Right(4)=ā.mp4ā then
dim player as new AVPlayerMBS(f )
'dim w as new Window1
'w.player = player
AVPlayerView.player = player
Label1.text=āVIDEOā
End If
I canāt read the total length of the video and delay the loop accordingly. Iām sorry, Iām a beginner, but Iām looking at the examples and Iām still lost!
Please help me!