Code Monkey home page Code Monkey logo

go-vlc-ctrl's Introduction

logo

go-vlc-ctrl : Control VLC with Go

go.dev reference godoc reference go report card GitHub license release

A simple yet powerful module that allows you to control VLC instances over the VLC Web API.

Installation

Make sure you have Go installed and just open up a terminal window and run:

go get github.com/CedArctic/go-vlc-ctrl

Example

To run this example, enable the VLC Web Interface (View > Add Interface > Web) and make sure it has a password set to "password" (Preferences > All > Main interfaces > Lua > Lua HTTP > Password).

Alternatively you can launch VLC with a Web Interface from the command prompt / terminal (use macosx instead of qt if on macOS):

vlc --intf http --extraintf qt --http-password password
package main

import (
	"github.com/CedArctic/go-vlc-ctrl"
	"time"
)

func main(){
	// Declare a local VLC instance on port 8080 with password "password"
	myVLC, _ := vlcctrl.NewVLC("127.0.0.1", 8080, "password")

	// Add items to playlist. Note URIs are URL percent-encoded 
	// Warning: YouTube URLs have a = that needs to be changed to %3D (percent-encoding)
	myVLC.Add("file:///C:/Users/Jose/Music/Back%%20In%%20Black.mp3")
	myVLC.Add("https://www.youtube.com/watch?v%3DdQw4w9WgXcQ")

	// Play first item and wait for 10 seconds
	myVLC.Play()
	time.Sleep(10 * time.Second)
	
	// Skip to next item, toggle full screen and pause after 30s
	myVLC.Next()
	myVLC.ToggleFullscreen()
	time.Sleep(30 * time.Second)
	myVLC.Pause()
}

Documentation

You can find documentation of all functions on GoDoc or Go.dev.

The module fully covers the VLC Web API as documented here.

Contributing

Contributions to the project in any way are welcome

Resources

License

Copyright (c) 2020 CedArctic. This project is licensed under the MIT license.

go-vlc-ctrl's People

Contributors

cedarctic avatar lgiki avatar

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.