Giter Site home page Giter Site logo

go-vlc's Introduction

Overview

go-vlc is a Go library for interacting with running VLC instances over the VLC HTTP API. This library acts as a client implementation, offering seamless integration with officially documented VLC API endpoints.

The library encompasses a range of endpoints, as outlined in the sections below:

Installation

Integrating go-vlc into your project is straightforward, execute the following command:

go get -u github.com/zivkovicmilos/go-vlc

This command ensures that you have the latest version of go-vlc in your project.

Running the VLC HTTP server

To run the VLC HTTP server, using the CLI interface, execute the following command:

vlc --extraintf http --http-port 8080 --http-password 1234

Remember, the password used here is crucial for initializing and authenticating the VLC client within the go-vlc library.

For GUI-based server initialization, please consult the official VLC documentation.

Example usage

Below is a sample Go program demonstrating how to utilize the go-vlc library:

package main

import (
	"fmt"

	"github.com/zivkovicmilos/go-vlc/client/http"
	"github.com/zivkovicmilos/go-vlc"
)

func main() {
	// Create the VLC credentials
	baseURL := "http://127.0.0.1:8080" // server IP, and the http-port value

	auth := http.RequestAuth{
		Username: "",     // the username; default empty
		Password: "1234", // the http-password value
	}

	// Create the VLC client
	client := http.NewClient(baseURL, auth)

	// Create the VLC instance
	v := vlc.NewVLC(client)

	// Call any VLC method
	status, err := v.GetStatus()
	if err != nil {
		panic(err)
	}

	fmt.Printf("%+v\n", status)
}

go-vlc's People

Contributors

zivkovicmilos avatar

Watchers

 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.