Videoplayer is not working

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Blanke
Posts: 8
Joined: Thu Apr 18, 2019 10:05 pm

Videoplayer is not working

Post 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 :)
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Videoplayer is not working

Post 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
Blanke
Posts: 8
Joined: Thu Apr 18, 2019 10:05 pm

Re: Videoplayer is not working

Post 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
SparkOut
Posts: 2984
Joined: Sun Sep 23, 2007 4:58 pm

Re: Videoplayer is not working

Post by SparkOut »

Are you using Windows?
If so, this thread could shed some light
viewtopic.php?p=172384#p172384
Blanke
Posts: 8
Joined: Thu Apr 18, 2019 10:05 pm

Re: Videoplayer is not working

Post by Blanke »

Yes, I'm using windows...I installed it, anything else I need to do?
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Videoplayer is not working

Post 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?
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Videoplayer is not working

Post by Klaus »

And please explain what you mean with:
"Something is quite not working..."
8)
Blanke
Posts: 8
Joined: Thu Apr 18, 2019 10:05 pm

Re: Videoplayer is not working

Post 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.
Blanke
Posts: 8
Joined: Thu Apr 18, 2019 10:05 pm

Re: Videoplayer is not working

Post by Blanke »

Thanks Sparkout!
I tried it again, this time I was able to load this as a player object! :)
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Videoplayer is not working

Post by Klaus »

We still don't know what format the video has! 8)

Please always supply as much info as possible, so we can help.
Guessing is highly ineffective! :D
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Videoplayer is not working

Post by Klaus »

Blanke wrote: Fri Apr 19, 2019 2:47 pmI 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!
Blanke
Posts: 8
Joined: Thu Apr 18, 2019 10:05 pm

Re: Videoplayer is not working

Post 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?
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Videoplayer is not working

Post by Klaus »

Blanke wrote: Fri Apr 19, 2019 2:59 pmOkay, 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 pmWhere 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
Blanke
Posts: 8
Joined: Thu Apr 18, 2019 10:05 pm

Re: Videoplayer is not working

Post 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 : )
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Videoplayer is not working

Post by Klaus »

Blanke wrote: Fri Apr 19, 2019 3:42 pmYeah, 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.
Post Reply