npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

live4api

v3.6.3

Published

LIVE4 API

Readme

live4api

LIVE4 Public API

With Maven:

<dependency>
    <groupId>io.live4</groupId>
    <artifactId>live4api3</artifactId>
    <version>3.1.26</version>
</dependency>

With Gradle:

repositories {
    maven {
        url "http://kote.videogorillas.com/m2repo/"
    }
}

dependencies {
    compile 'io.live4:live4api3:3.1.26'
}

Command line tools

Print stream updates

java -cp live4api3-3.1.26-uberjar.jar io.live4.apiclient.StreamUpdatesMain http://$USER:[email protected]/

Usage

NOTE: Live4 public API is based on ReactiveX library. You can find ReactiveX docs here.

  1. Create RxApiClient instance:

    String url = "http://1.1.1.1:8042";
    RxApiClient rxApiClient = new RxApiClient(url);
  2. Log in:

    String email = "[email protected]";
    String password = "123";
    Observable<User> userRx = rxApiClient.login(email, password);
    userRx.subscribe(user -> {
        // Do something with your user here
    });
  3. Select organisation:

    // This will list all user profiles:
    Map<String, UserProfile> profiles = user.profiles;
    for (String orgId : profiles) {
        // Chose the organisation here
    }
    // Alternatively, you can just select the first organization available for streaming:
    String orgId = user.getFirstOrgId();
  4. Select mission or create a new one:

    // This will list all available missions in this organization:
    Observable<Mission> missionsRx = rxApiClient.listMissions(orgId);
    missionsRx.subscribe(mission -> {
        // select mission here
    });
    // Alternatively, you can create a new mission:
    Mission mission = new Mission();
    mission.createdByUserId = user.id;
    mission.startTime = new org.stjs.javascript.Date();
    long oneDay = 24 * 60 * 60 * 1000;
    mission.endTime = new org.stjs.javascript.Date(mission.startTime.getTime() + oneDay);
    mission.hardware = $array();
    mission.joined = $map();
    mission.name = missionName;
    mission.orgId = orgId;
    mission.state = Mission.State.PENDING;
    mission.streamIds = $array();
    mission.addUser(user, MissionRole.OWNER);
    
    Observable<Mission> missionRx = rxApiClient.createMission(mission);
    missionRx.subscribe(newMission -> {
        // newMission object contains newly created mission
    });
  5. Create a hardware instance:

    Hardware hw = Hardware.drone("MyDrone");
  6. Create a stream:

    StreamResponse sr = new StreamResponse();
    sr.title = "Stream from " + user.getName();
    sr.hardwareId = hw.getId();
    Observable<StreamResponse> newStreamRx = rxApiClient.createStream(sr).replay().autoConnect();
  7. Add stream to mission:

    mission.addStream(stream.streamId);
    mission.addHardware(hw);
    rxApiClient.updateMission(m).subscribe(m -> {
        // mission updated
    }, e -> {
        e.printStackTrace();
    });
  8. Get mission share token:

    Observable<Mission.ShareToken> shareTokenRx = rxApiClient.getShareToken(mission.getId());
  9. Stream uploads:

    Stream uploads include uploading initial json metadata, video data, metadata (stream locations), and "end of stream" data.

    Json metadata:

    StreamId sid = stream.sid();
       
    DebugJs noStripAacDebugJs = new DebugJs();
    noStripAacDebugJs.stripaac = false;
           
    Observable<Request> debugjs = Observable.just(rxApiClient.uploadJsonRequest(sid, DebugJs.DEBUG_JS, noStripAacDebugJs));

    Video data:

    // You should actually set up your video stream here:
    Observable<Request> videoUploadsRx = ...

    Stream locations metadata:

    // The next code fakes stream locations for demo purposes. In the real life, you would take these locations from drone data, mobile data, etc.:
    StreamLocation loc = StreamLocation.latLng(sdf.format(new Date()), 42, 42);
    loc.altitude = new Double(42);
    loc.course = new Double(42);
    loc.horizontalAccuracy = new Double(42);
    loc.verticalAccuracy = new Double(42);
    loc.speed = new Double(42);
       
    Observable<StreamLocation> locationsRx = Observable.just(loc).repeat();
    
        Observable<List<StreamLocation>> chunks = locationsRx.buffer(2, SECONDS).filter(list -> !list.isEmpty());
    
        Observable<Pair<Integer, List<StreamLocation>>> numberedChunks = chunks.zipWith(
                Observable.range(0, MAX_VALUE), (locations, mseq) -> new Pair(mseq, locations));
        numberedChunks = numberedChunks.onBackpressureBuffer();
           
    Observable<Request> locationUploads = numberedChunks.map(p -> {
            int mseq = p.left;
            List<StreamLocation> locations = p.right;
            String filename = locationsFilename(mseq);
            return rxApiClient.uploadJsonRequest(sid, filename, Collections.singletonMap("locations", locations));
        });

    Video data and stream locations metadata is then merged (we don't care about the order here):

    Observable<Request> uploadRequests = Observable.merge(videoUploadsRx, locationsRx);

    End of stream data:

    // End of stream data holds information about all uploaded chunks:
    Observable<Request> eosUploadsRx = ...

    Json metadata, video data, locations metadata, and eos streams are concatenated then:

    Observable<Response> uploads = Observable.concat(debugjs, uploadRequests, eosUploadsRx)
        .onBackpressureBuffer()
        .concatMap(request -> {
        return uploadWithRetry(client, request);
        });

Release snapshots && npm

  1. npm install
  2. Make sure that pom.xml & package.json versions are the same;

IMPORTANT

# package.json
  "version": "3.5.0-betaX",

# pom.xml
<version>3.5.0-betaX-SNAPSHOT</version>
  1. mvn clean package
  2. grunt
  3. git commit
  4. mvn release:prepare 5.1. Agree with questions
  5. git push
  6. npm login
  7. npm publish