12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- -- love.video
- --------------------------------------------------------------------------------
- --------------------------------------------------------------------------------
- ----------------------------------OBJECTS---------------------------------------
- --------------------------------------------------------------------------------
- --------------------------------------------------------------------------------
- -- VideoStream (love.thread.newVideoStream)
- love.test.video.VideoStream = function(test)
- -- create obj
- local video = love.video.newVideoStream('resources/sample.ogv')
- test:assertObject(video)
- -- check def properties
- test:assertEquals('resources/sample.ogv', video:getFilename(), 'check filename')
- test:assertFalse(video:isPlaying(), 'check not playing by def')
- -- check playing and pausing states
- video:play()
- test:assertTrue(video:isPlaying(), 'check now playing')
- video:seek(0.3)
- test:assertRange(video:tell(), 0.3, 0.4, 'check seek/tell')
- video:rewind()
- test:assertRange(video:tell(), 0, 0.1, 'check rewind')
- video:pause()
- test:assertFalse(video:isPlaying(), 'check paused')
- end
- --------------------------------------------------------------------------------
- --------------------------------------------------------------------------------
- ----------------------------------METHODS---------------------------------------
- --------------------------------------------------------------------------------
- --------------------------------------------------------------------------------
- -- love.video.newVideoStream
- -- @NOTE this is just basic nil checking, objs have their own test method
- love.test.video.newVideoStream = function(test)
- test:assertObject(love.video.newVideoStream('resources/sample.ogv'))
- end
|