A simple video player in Edje
Wednesday 9 May 2007, by lok
I was an happy mplayer user until I saw Nice Player for Mac OS X. No feature killer here, but a very well designed app. It only display a window playing the movie, and a basic interface appear when the cursor is at the bottom of the window. It’s dead simple but very good.
All I did after that was to use Emotion API to make a small video player. And a Edje interface to make slide a very simple GUI when the cursor go at the bottom left of the window. It was done in less than an hour. And since I’m used to mplayer default bindings. I just added the sames.
Envy is a frontend to xine so it inherit automatically a bunch of it’s features like dvd playback and menu, post-processing etc... There’s only one subtitle format supported it’s SubRip (.srt). And of course if a .srt file match with the movie filename, it’ll be automatically loaded.
I don’t exactly recall how (anyway nobody care), but I found OSDB a really nice project. It’s a huge database of subtitles in various languages and even provide a way to access it with xmlrpc. I wrote a client for that within Envy. So you can launch a movie with the "-o" parameters, and the player will go on OSDB looking for a matching subtitle. The matching is done by the moviehash, so the filename doesn’t have to be the same. If it is found, the subtitle is downloaded and write with the same filename that your movie in the same directory.
The configuration file is in a key=value format. It let you change the theme, the langage to search for a subtitle and can enable a automatic search at start time. I decided to follow the FreeDesktop specification about the configuration directory. (I was fed up with the hords of .foo in my home dir)
You’ll need xmlrpc, evas built with the gl_x11 engine, ecore-evas and emotion with his xine engine.