Page 3 of 3

Re: LoveVideo - LÖVE module for playing video

Posted: Tue Oct 07, 2014 1:31 pm
by jjmafiae
bartbes wrote:
slime wrote: Causing a real love.video to break when this one is used is an odd way to encourage me. :P
I don't know, you do love breaking things.
Ouch, shots fired.

Re: LoveVideo - LÖVE module for playing video

Posted: Tue Oct 07, 2014 1:46 pm
by josefnpat
slime wrote:
josefnpat wrote:

Code: Select all

cool_joe = love.video.newVideo('cool_joe')
function love.graphics.draw()
  love.video.draw( cool_joe )
  drawFractal() -- Draw a crazy fractal on top of your video!
end
You should update the code to make it use something other than love's namespace – it's bad practice in general to do that, plus if/when a real love.video module gets added to LÖVE then any code that overwrites love.video for its own purposes (such as the above snippet) will cause the real love.video to break horribly.
Haha, sorry, the previous examples in this thread are totally bogus;

It's not actually in love's namespace, it's just put there in the examples. Here is an example from the readme.md;

Code: Select all

LoveVideo = require "LoveVideo.lovevideo"

bunny = LoveVideo.newVideo("big_buck_bunny")

function love.draw()
  bunny:draw(0,0,
    love.graphics.getWidth()/bunny:getWidth(), -- x scale
    love.graphics.getHeight()/bunny:getHeight() -- y scale
  )
end

function love.update(dt)
  bunny:update(dt)
end
So s/love\.video/not_love_video/gc?
Zilarrezko wrote:Maybe it's a hint that he wants you to implement his library, slime. :awesome:

Cool stuff though, I wish I had the brain capacity to use magic and threads like that. :o
Honestly, just the example is kind of a joke; I think we should have a video decoder in love. While many may see it as superfluous and useless, it does hamper creativity in some ways. I saw PewDiePie playing the game Roundabout, and I realized that while the example is very silly, it's a very good example of storytelling by cutscenes. I'd be happy to change the example if a love.video emerges in the 0.10+ branch! I by no means want to create a library that would screw with the blessed' namespace.
bartbes wrote:
slime wrote: Causing a real love.video to break when this one is used is an odd way to encourage me. :P
I don't know, you do love breaking things.
Breaking things is what FOSS is all about! I suppose this module is a challenge for the love team to make love.video a real decoder.
Shell32 wrote:https://www.youtube.com/watch?v=9sG6eBYT_Ts

My video conversion went bad when I sent it in youtube, btw the second video playing is 1280x720
That's fantastic! Did you find any part of the API lacking? I was hoping someone would make a video player like thing out of this.

Re: LoveVideo - LÖVE module for playing video

Posted: Tue Oct 07, 2014 3:41 pm
by Shell32
josefnpat wrote: That's fantastic! Did you find any part of the API lacking? I was hoping someone would make a video player like thing out of this.
Heres my version of lovevideo:
http://hastebin.com/xazuxobidu.lua

And the thread thing:
http://hastebin.com/otewulasog.coffee

I refactored your code and did other stuff (out of standard), I added a setSpeed (setPlaybackSpeed), and made your thing to call a function in audio object audio.onDone(), so I can know that the video finished and has stopped, otherwise I need to keep checking isDone everytime.

I optimized some stuff, I really don't remember which, both in thread and loveaudio..

Re: LoveVideo - LÖVE module for playing video

Posted: Tue Oct 07, 2014 4:04 pm
by slime
josefnpat wrote:It's not actually in love's namespace, it's just put there in the examples.
I know. That doesn't make it any better... all of the example code in this thread and on the Github repository will eventually make LÖVE break. :/

Re: LoveVideo - LÖVE module for playing video

Posted: Tue Oct 07, 2014 10:13 pm
by davisdude
love.video confirmed! ;)

Re: LoveVideo - LÖVE module for playing video

Posted: Wed Oct 08, 2014 12:14 am
by Zilarrezko
iphone 7 confirmed.

Re: LoveVideo - LÖVE module for playing video

Posted: Wed Oct 08, 2014 1:30 am
by slime
josefnpat wrote:I'd be happy to change the example if a love.video emerges
Like this? (note the commit dates): https://bitbucket.org/bartbes/love-expe ... deo.theora :P

Re: LoveVideo - LÖVE module for playing video

Posted: Wed Oct 08, 2014 5:32 am
by jjmafiae
Zilarrezko wrote:iphone 7 confirmed.
now with 30% more bend.

Re: LoveVideo - LÖVE module for playing video

Posted: Wed Oct 08, 2014 1:07 pm
by josefnpat
slime wrote:
josefnpat wrote:I'd be happy to change the example if a love.video emerges
Like this? (note the commit dates): https://bitbucket.org/bartbes/love-expe ... deo.theora :P
Woooo! Didn't even see this until today!