Bugs with videos??? (solved)
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Bugs with videos??? (solved)
Hello. Me again.
I have written a video app that allows users to open a video and play it.
I managed to get it all to work, kept writing code elsewhere within the app, got a few more features in it, and now, the open function just doesn't work. I haven't altered the code that originally worked (Klaus wrote it), and I can't think of why it did work, but now doesn't.
I took the code and put it into a new stack with player and open button, and it works.
Why would it work in one and not in another? Why would it work to start off with, and now not work at all?
I even tried to manually change the path of the video to a video that I know works, and it refuses to play the video. I used the same video in my simple test app, and it works.
For a while, I couldn't even change the manual path of a player to the sample video. I needed to delete the player and make a new one with the sample movie path in order for the sample movie to play. If I then open another video, no video, and no way of opening the sample video again- not by button, not by manual code.
Is this a known bug?
If I were to strip out the Intellectual property from the app, would someone be willing to test the stack to see if it's just my computer/ version of LiveCode? (I am using Community 9.0 if that makes a difference)
XdM
I have written a video app that allows users to open a video and play it.
I managed to get it all to work, kept writing code elsewhere within the app, got a few more features in it, and now, the open function just doesn't work. I haven't altered the code that originally worked (Klaus wrote it), and I can't think of why it did work, but now doesn't.
I took the code and put it into a new stack with player and open button, and it works.
Why would it work in one and not in another? Why would it work to start off with, and now not work at all?
I even tried to manually change the path of the video to a video that I know works, and it refuses to play the video. I used the same video in my simple test app, and it works.
For a while, I couldn't even change the manual path of a player to the sample video. I needed to delete the player and make a new one with the sample movie path in order for the sample movie to play. If I then open another video, no video, and no way of opening the sample video again- not by button, not by manual code.
Is this a known bug?
If I were to strip out the Intellectual property from the app, would someone be willing to test the stack to see if it's just my computer/ version of LiveCode? (I am using Community 9.0 if that makes a difference)
XdM
Last edited by Xero on Thu Jul 12, 2018 8:38 am, edited 1 time in total.
Re: Bugs with videos???
Hi,
is this only in the IDE? or in standalone?
Win / Mac / iOs / Android?
If for example you exported to Android you need to enable Hardware Acceleration.
Please provide some more details.
Thanks.
is this only in the IDE? or in standalone?
Win / Mac / iOs / Android?
If for example you exported to Android you need to enable Hardware Acceleration.
Please provide some more details.
Thanks.
Re: Bugs with videos???
Thanks for the reply sphere.
Windows (W10... crap I know!)
IDE and Standalone. They both act exactly the same. When I wrote the code, they both worked, now, neither do. If I can get the video to load in IDE, I can get it to load in standalone.
I'd be interested to see if another Livecode program has the same issues with the broken stack. That way I could work out if it's Livecode or the app...
Anything else you would like to know about it?
XdM
Windows (W10... crap I know!)
IDE and Standalone. They both act exactly the same. When I wrote the code, they both worked, now, neither do. If I can get the video to load in IDE, I can get it to load in standalone.
I'd be interested to see if another Livecode program has the same issues with the broken stack. That way I could work out if it's Livecode or the app...
Anything else you would like to know about it?
XdM
Re: Bugs with videos???
Hi Xero,
I can offer to take a look at your (stripped down) stack if you like.
Send it to: klaus AT major-k.de with instructions what to do to see the inconvenience.
Best
Klaus
I can offer to take a look at your (stripped down) stack if you like.
Send it to: klaus AT major-k.de with instructions what to do to see the inconvenience.
Best
Klaus
Re: Bugs with videos???
Thank you Klaus.
I have sent through some files that work and don't work, and a little explanation in an email to you.
Thank you very much for having a look at this.
XdM
I have sent through some files that work and don't work, and a little explanation in an email to you.
Thank you very much for having a look at this.
XdM
Re: Bugs with videos???
Great! you've got help from Klaus, so you will succeed with it.
My URL's (youtube) can be picked from a menu button or mobilepick and then i use:
set the URL of widget"clipinbrows" to tClipUrl
Tip: there is a bug with some devices using this browser widget and Android versions below Oreo which is confirmed by Panos, that causes the audio/video to not stop when power is pressed, this will cause that Google will reject your app from the playstore. I hope it will be fixed in the near future.
I did not yet re-submit when build for that Android version. (Funny thing is that Spotify does also not stop playing when power is pressed, but that is not rejected by Google...probably a money thing or so)
My URL's (youtube) can be picked from a menu button or mobilepick and then i use:
set the URL of widget"clipinbrows" to tClipUrl
Tip: there is a bug with some devices using this browser widget and Android versions below Oreo which is confirmed by Panos, that causes the audio/video to not stop when power is pressed, this will cause that Google will reject your app from the playstore. I hope it will be fixed in the near future.
I did not yet re-submit when build for that Android version. (Funny thing is that Spotify does also not stop playing when power is pressed, but that is not rejected by Google...probably a money thing or so)
Re: Bugs with videos???
So, we've decided that the fault is not with the stack per se. Klaus can get it to work, and I did a standalone and got it on to another computer, and it worked.
There is an issue with file types, but the loading does work.
Solution may be to uninstall LiveCode and reinstall, and see if there is a glitch in the program.
Or... I throw this piece of S4!t computer and it's Windows 10 out in the trash and buy a decent computer and OS.
We'll see...
XdM
There is an issue with file types, but the loading does work.
Solution may be to uninstall LiveCode and reinstall, and see if there is a glitch in the program.
Or... I throw this piece of S4!t computer and it's Windows 10 out in the trash and buy a decent computer and OS.
We'll see...
XdM
Re: Bugs with videos???
With strange behaviours, first try to rename your preferences file. Then restart LC, it will create a new one. Then check again.
Sometimes it helps.
Sometimes it helps.
Re: Bugs with videos???
Hey...
I've been playing with the file, reconstructing it and copying in code from previous file (the one that was giving me the problem). To find the point where the livecode file stops working for me in the IDE...
It seems to be when I add a second video player on to the screen using code...
If I add another player by dragging the player on to the screen from the tool palette and have no code attached to the new player, the load a file function (the "+" symbol) for the first player still works.
When I press the 2 screen button and get it to create a new player, the loading of the videos on either player goes kaput. When I use the 2 screen button, the load button will load a video, but it wont play from then on ever again in either player.
This seems to only be a problem in my LiveCode, not in others'... Klaus has checked it and it works there, and I did a standalone from a broken file and used it on another computer and it worked. Same stand alone did not work on my computer...???)
In short... I think it's in this code somewhere:
I can't see anything in there that should stop a video from playing after it is loaded...
Can you?
The problem only starts after the button with this code is pressed.
Thoughts?
I have attached the stack for inspection if people want to see what's going on.
B
I've been playing with the file, reconstructing it and copying in code from previous file (the one that was giving me the problem). To find the point where the livecode file stops working for me in the IDE...
It seems to be when I add a second video player on to the screen using code...
If I add another player by dragging the player on to the screen from the tool palette and have no code attached to the new player, the load a file function (the "+" symbol) for the first player still works.
When I press the 2 screen button and get it to create a new player, the loading of the videos on either player goes kaput. When I use the 2 screen button, the load button will load a video, but it wont play from then on ever again in either player.
This seems to only be a problem in my LiveCode, not in others'... Klaus has checked it and it works there, and I did a standalone from a broken file and used it on another computer and it worked. Same stand alone did not work on my computer...???)
In short... I think it's in this code somewhere:
Code: Select all
global gScreenNumber --- tells me how many screens are currently shown
local tStackHeight ---I'm doing a resize stack thing with this. Doesn't seem to be the problem
on mousedown
put the height of current stack into tStackHeight ---resize thin- no problem
if the value of gScreenNumber is 2 then ---if 2 screens are already showing, do nothing
pass mousedown
else if the value of gScreenNumber is 1 then ---if 1 screen is showing, change to show 2 screens...
move group "Dash" to 307,tStackheight -100 in 0.5 seconds ---move the buttons to show more controls for videos
set the looping of player "Movie" to true ---move video player that already exists, make sure it's looping
set the height of player "Movie" to 360 ---
set the width of player "Movie" to 360 ---
Set the left of player "Movie" to 10 ---
set the top of player "Movie" to 110 ---
set the alwaysbuffer of Player "Movie" to true --- I am hoping to be able to draw graphics over movie, not currently working
create player "Compare" --- Make a new player and call it compare
set the filename of player "Compare" to "C:/Users/B J/AppData/Roaming/RunRev/Components/LiveCode Community 9.0/Resources/Sample.mpg"
set the looping of player "Compare" to true ---set name, size and location of new player
set the height of player "Compare" to 360 ---
set the width of player "Compare" to 360 ---
set the left of player "Compare" to 370 ---
set the top of player "Compare" to 110 ---
set the alwaysbuffer of Player "Compare" to true --- as above
put 2 into gScreenNumber --- keep track of how many screens are on screen
end if
end mousedown
Can you?
The problem only starts after the button with this code is pressed.
Thoughts?
I have attached the stack for inspection if people want to see what's going on.
B
- Attachments
-
- Runity VA App 2-2.zip
- (73.4 KiB) Downloaded 144 times
Re: Bugs with videos???
Hi Xero,
if I replace this line with a video on my computer it still works even with two vido files:
And it is still unneccessary to delete and create a player, simply HIDE and SHOW it whenever neccessary.
Hints:
1. No need to check ->
...
if the value of gScreenNumber is 2
...
Just do:
...
if gScreenNumber = 2
...
2. Add a lock screen and unlock screen when updating things on the screen:
Best
Klaus
if I replace this line with a video on my computer it still works even with two vido files:
Code: Select all
...
set the filename of player "Compare" to "C:/Users/B J/AppData/Roaming/RunRev/Components/LiveCode Community 9.0/Resources/Sample.mpg"
...
Hints:
1. No need to check ->
...
if the value of gScreenNumber is 2
...
Just do:
...
if gScreenNumber = 2
...
2. Add a lock screen and unlock screen when updating things on the screen:
Code: Select all
on mousedown
lock screen
put the height of current stack into tStackHeight
##...
unlock screen
end mousedown
Klaus
Re: Bugs with videos???
Update:
Klaus gave me an idea about not creating and destroying players.
I now have 3 players. 1 that shows when the "One Movie" button is hit, and disappears when the "Two Movie" button is hit. The other two do the opposite and I cross-manage filepaths…
Everything now works.
Play, 2 screens, load one, load the other, play.
All... good!
Maybe it is something to do with creating and deleting players?
I also noticed that my buttons had the same name "add.jpg", so I changed the names so they were unique. That shouldn't make a difference because they have unique ID's, but it got done.
Thank you all for your input.
XdM
Klaus gave me an idea about not creating and destroying players.
I now have 3 players. 1 that shows when the "One Movie" button is hit, and disappears when the "Two Movie" button is hit. The other two do the opposite and I cross-manage filepaths…
Everything now works.
Play, 2 screens, load one, load the other, play.
All... good!
Maybe it is something to do with creating and deleting players?
I also noticed that my buttons had the same name "add.jpg", so I changed the names so they were unique. That shouldn't make a difference because they have unique ID's, but it got done.
Thank you all for your input.
XdM