GithubHelp home page GithubHelp logo

clj-vlc's Introduction

Clj-vlc

Summary

clj-vlc is a simple wrapper for VLC media player that works over TCP.

How to use

  1. to start a VLC server on localhost:2150 use
    (def c (start-vlc-server 2150))
        
  2. to list the commands available use
    (map println (run-vlc-cmd c :help))
        
  3. any of the command on the list can be used with the specified input by making it a keyword: for example, we can use
    (run-vlc-cmds 
     c
     :add 
       "https://youtu.be/ecIWPzGEbFc"
       "http://cdn.media.ccc.de/congress/2016/h264-hd/33c3-8369-eng-Machine_Dreams.mp4"
     :play 
     )
        

Complete example

; start vlc on port 2150 of localhost
(def c (start-vlc-server 2150))
; print help with available commands on REPL
(map println (run-vlc-cmd c :help))
; let's watch some cool videos
(run-vlc-cmds c
      :add 
       "https://youtu.be/ecIWPzGEbFc"
       "http://cdn.media.ccc.de/congress/2016/h264-hd/33c3-8369-eng-Machine_Dreams.mp4"
     :play)
; maybe just listen
(run-vlc-cmd c :vtrack "-1")
; let's stop here
(run-vlc-cmd c :stop)
; let's stop VLC from running
(end-vlc-server c)

Requirements

  • A version of VLC is installed in the system
  • clj-tcp >= 1.0.1

Todos

Return map instead of string

I may want to know when VLC could not run a result:

this test case should pass:

(def r (run-vlc-cmds c :add "my-invented-file"))

(deftest better-return-test
  (testing "We want a map instead of a string"
    (is (= r '(#{:res "> " :err "VLC-error-here"})))))

Manage errors without exceptions

License

Basically every one can use this software as they like with a look to the restrictions of the LGPL (https://www.gnu.org/licenses/lgpl-3.0.txt) (thanks FSF people for all your efforts!).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.