The smallest media player in the world

BlaBla

As I was showing here now Plasma in trunk can also play video/audio files, so what will be there in KDE 4.3? Basically two components:

The first is a media player widget (or applet, or whatever…). It will be the basis for a future media center written totally with Plasma technologies (one of the exciting discussions we had at Tokamak2 🙂 as today it’s in playground and plays video files dropped in plasma, can open arbitrary audio/video files, has some usual control buttons and exposes the standard org.mpris D-bus interface used to control media applications, can be controlled for instance from the now playing widget, as shown here.

The most central component is in libplasma right now and instead is well, a media player widget :p
The difference is that it is a widget in the sense of reusable control to be used in the applets/widgets/plasmoids you write (so, wanna for instance make a youtube browser?:), it uses various components of Phonon, like Videowidget, MediaObject and AudioOutput and has a default set of control buttons that do a nice slide in/slide out on mouse over, and the reallt cool thing is that using it from the javascript bindings is ridicolously easy.
This is a complete plasmoid written in javascript in the minboggling amount of 6 lines of code:

layout = new LinearLayout(plasmoid);
video = new VideoWidget();
video.usedControls = DefaultControls;
layout.addItem(video);
video.url = startupArguments[0];
video.play();

All it does in sequence is: make a layout, make a video widget, enable a default set of buttons, add the widget in the layout, load the argument as the video if any (i.e, the file that was dag and dropped on the desktop), and finally, play.
This thing is in kdebase in the tests folder of the javascript based plasmoids.

Now, switching for a moment in hype-machine mode, think about putting together media content distribution, javascript, plasma, browsers and the not really happy state of these things in Linux right now, really far fetched for now and not for the immediate future, but good things can happen 😀

4 thoughts on “The smallest media player in the world

  1. fish

    Is there an option to right-click on the video and use it as a fullscreen wallpaper? That would be awesome! 😉

  2. Thorsten Schnebeck

    a little OT but as you are a plasmoid master 🙂
    I have to set-up a POI barebone with very low specs as presenter.
    The presenter shows a web-site. I thought about using plasma.
    Konqi has not kiosk mode as you can not disable the status bar in full screen. OTOH the plasma web browser has auto update.
    It would be nice if the plasmoid has a config option to go fullscreen (no URL or stus bar)

    Thanks

    Thorsten

  3. Marco Martin

    video wallpaper: a real wallpaper for the default plasma desktop plugin seem to have some problems, btw it’s possible to write a containment that has the video widget as background

    presenter: what you probably want is a scripted applet (rougly the same length of this javascript videoplayer) that has a WebView widget in it and nothing else

  4. klenn

    When I try to get this to run I always get

    ReferenceError: Can’t find variable: DefaultControls

    Do you have any idea what the problem is?

Comments are closed.