VideoIO.jl
VideoIO.jl copied to clipboard
`play` instead of `playvideo`
In the spirit of generic function names for generic functionality and leveraging dispatch, might I suggest play instead of playvideo for playing a video object?
Currently that's what I use in AudioIO, so if you play an audio object it gets played over the default audio stream. That would keep the general interface the same:
using AudioIO
song = AudioIO.open("my_favorite_song.wav")
play(song)
and
using VideoIO
vid = VideoIO.open("my_favorite_cat_video.mov")
play(vid)
Also note that in AudioIO play returns an AudioPlayer object so you can do playback control:
x = play(song)
sleep(1)
stop(x)
Excellent idea! Right now, we have no audio, no control, and the command just blocks, so we have a little work to do.
I'll be traveling today, so not sure if I'll get to this doon. PRs welcome.
Gotcha. Do you have a preference between blocking/asynchronous play? One thing that I've found handy is to add a wait implementation so that you can easily simulate blocking behavior from the nonblocking API:
x = play(vid)
wait(x) # blocks until the video is complete
No preference. Asynchronous with wait does seem like a nice interface.
On Wednesday, August 13, 2014, Spencer Russell [email protected] wrote:
Gotcha. Do you have a preference between blocking/asynchronous play? One thing that I've found handy is to add a wait implementation so that you can easily simulate blocking behavior from the nonblocking API:
x = play(vid)wait(x) # blocks until the video is complete
— Reply to this email directly or view it on GitHub https://github.com/kmsquire/VideoIO.jl/issues/15#issuecomment-52068861.