Page 1 of 2
Videoplayer is not working
Posted: Fri Apr 19, 2019 1:40 pm
by Blanke
Hi together.
I'm new to LiveCode, but lately I was trying to import a video, as a background for my application.
But everytime I'm importing a new video to the player the timebar goes to the very end, the play button does not work and the video isn't displayed either.
Does anyone know how fix this?
Or are there maybe better ways of importing videos as a background?
I'm using Live Code Community 9.0.3
Thank you in advance :)
Re: Videoplayer is not working
Posted: Fri Apr 19, 2019 1:53 pm
by Klaus
Hi Blanke,
welcome to the forum!
LC is very picky when it comes to PLAY imported video files!
Only a very limited number of videoformats can be PLAYed this way, so I guess this is the case here.
Advice:
Don't import the video, just put the file into the folder with your stack and use it into a player object,
then you can refer to it like this:
Code: Select all
...
put specialfolderpath("resources") & "/your video here.mp4" into tVideoFile
set the filename of player "your player here" to tVideoFile
start player "your player here"
...
This will work in the IDE AND in a standalone, as long as you add the vieo via
the "Copy files" tab in the "Standalone Application Settings".
Best
Klaus
Re: Videoplayer is not working
Posted: Fri Apr 19, 2019 2:19 pm
by Blanke
First...thanks for your incredibly fast answer.
Something is quite not working, but probably it's only me implementing your solution not correctly.
Could you maybe describe your way of using the video a bit more detailed...I'm not only new to LC, but also to developing in general, so I'm a bit confused xD
Re: Videoplayer is not working
Posted: Fri Apr 19, 2019 2:25 pm
by SparkOut
Are you using Windows?
If so, this thread could shed some light
viewtopic.php?p=172384#p172384
Re: Videoplayer is not working
Posted: Fri Apr 19, 2019 2:36 pm
by Blanke
Yes, I'm using windows...I installed it, anything else I need to do?
Re: Videoplayer is not working
Posted: Fri Apr 19, 2019 2:37 pm
by Klaus
Are you really using an IMPORTED video?
Menu -> File -> Import as control -> Video file...
?
Or are you setting the filename of a player object?
What format is the video file?
Re: Videoplayer is not working
Posted: Fri Apr 19, 2019 2:44 pm
by Klaus
And please explain what you mean with:
"Something is quite not working..."

Re: Videoplayer is not working
Posted: Fri Apr 19, 2019 2:47 pm
by Blanke
I tried importing the video as control, but since this didn't work, because the video was simply not shown, I switched to setting the filename of a playerobject and this is where the problem I described in my first entry occured.
Re: Videoplayer is not working
Posted: Fri Apr 19, 2019 2:48 pm
by Blanke
Thanks Sparkout!
I tried it again, this time I was able to load this as a player object!

Re: Videoplayer is not working
Posted: Fri Apr 19, 2019 2:52 pm
by Klaus
We still don't know what format the video has!
Please always supply as much info as possible, so we can help.
Guessing is highly ineffective!

Re: Videoplayer is not working
Posted: Fri Apr 19, 2019 2:54 pm
by Klaus
Blanke wrote: ↑Fri Apr 19, 2019 2:47 pm
I tried importing the video as control, but since this didn't work, because the video was simply not shown, I switched to setting the filename of a playerobject and this is where the problem I described in my first entry occured.
Importing a video file as control does NOTHING but saving a COPY of that file in the stack.
You need to:
Code: Select all
...
play videoclip "Your video here.xyz"
...
to make it appear on screen!
Re: Videoplayer is not working
Posted: Fri Apr 19, 2019 2:59 pm
by Blanke
Sorry, forgot about that one xD
It's a mp4 file.
Okay, didn't know, that this does nothing, because when I imported images as control they've always shown up.
Where do I need to put the code?
Re: Videoplayer is not working
Posted: Fri Apr 19, 2019 3:30 pm
by Klaus
Blanke wrote: ↑Fri Apr 19, 2019 2:59 pm
Okay, didn't know, that this does nothing, because when I imported images as control they've always shown up.
Yep, that is the difference.
But using a player object is much more flexible!
Blanke wrote: ↑Fri Apr 19, 2019 2:59 pm
Where do I need to put the code?
When you want to play the video, maybe in a button "Play video"?
BTW, "Blanke" sounds german, if you are german, there is in fact a german LC forum:
http://www.livecode-blog.de
Re: Videoplayer is not working
Posted: Fri Apr 19, 2019 3:42 pm
by Blanke
Yeah, I thought about using a button too, but actually I want it to play, as soon as the app launches, because its the background.
And yes I'm german, but my name has nothing to do with, actually it's just an anime reference and is
pronounced in an English way,but nevermind xD
I tried using the german forum before, but since I've never got my confirmation email, I considered using this forum, which has worked out for me pretty well too, thanks to you both : )
Re: Videoplayer is not working
Posted: Fri Apr 19, 2019 3:44 pm
by Klaus
Blanke wrote: ↑Fri Apr 19, 2019 3:42 pm
Yeah, I thought about using a button too, but actually I want it to play, as soon as the app launches, because its the background.
Then "on openstack" (or "on opencard" of the first card) would be the ideal place(s) for this.