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 🙏

© 2024 – Pkg Stats / Ryan Hefner

haluk

v3.0.0

Published

vlc wnyc

Downloads

1

Readme

VLC Audio Player PhoneGap/Cordova Plugin

Platform Support

This plugin supports PhoneGap/Cordova apps running on both iOS (Android support planned).

Version Requirements

This plugin is meant to work with Cordova 4.0+ and the VLC library for iOS.

At this time, only iOS is supported.

VLC references:
https://wiki.videolan.org/VLCKit/
https://wiki.videolan.org/IOSCompile/
https://wiki.videolan.org/VLC_command-line_help
https://wiki.videolan.org/AndroidCompile (for future reference)

Installation

Automatic Installation using PhoneGap/Cordova CLI (iOS)

  1. Make sure you update your projects to Cordova iOS version 4.0+ before installing this plugin.

     cordova platform update ios
  2. Install this plugin using PhoneGap/Cordova cli (requires the VLC_FRAMEWORK_LOCATION environment variable to load VLC framework from local file system):

     VLC_FRAMEWORK_LOCATION="~/MobileVLCKit.framework" cordova plugin add https://github.com/wnyc/cordova-plugin-vlc.git

Usage

// all responses from the audio player are channeled through successCallback and errorCallback

// initialize the audio player - call after 'deviceready' event is fired 
window.audioplayer.configure( successCallback, failureCallback);

// play a stream
window.audioplayer.playstream( successCallback,
                               failureCallback,
                               // stream urls to play on android/ios
                               {
                                 android: "http://fm939.wnyc.org/wnycfm-app.aac",
                                 ios: "http://fm939.wnyc.org/wnycfm-app.aac"}
                               },
                               // metadata used for iOS lock screen, Android 'Now Playing' notification
                               {
                                 "title": "Cuomo; NJ Candidates; and Candy Etiquette",
                                 "artist": "The Brian Lehrer Show",
                                 "image": {
                                   "url": "https://media2.wnyc.org/i/300/300/l/80/1/governor_andrew_cuomo.jpg"
                                 },
                                 "imageThumbnail": {
                                   "url": "https://media2.wnyc.org/i/60/60/l/80/1/governor_andrew_cuomo.jpg"
                                 },
                                 "name": "WNYC 93.9 FM",
                                 "description": "News, Culture & Talk"
                               },
                               // javascript-specific json represenation of audio to be played, which will be passed back to 
                               // javascript via successCallback when a stream is launched from a local notification (eg, the
                               // alarm clock
                               extra
                             );

// play a file
window.audioplayer.playfile( successCallback,
                             failureCallback,
                             "http://www.podtrac.com/pts/redirect.mp3/audio.wnyc.org/moneytalking/moneytalking20141031pod.mp3",
                             10, // position in track 10=10 seconds
                             // metadata used for iOS lock screen, Android 'Now Playing' notification
                             {
                               "title": "The Myth of the Self-Driving Car",
                               "artist": "Money Talking",
                               "image": {
                                 "url": "https://media2.wnyc.org/i/1500/1208/c/80/1/google_self_driving_car_1.jpg"
                               },
                               "imageThumbnail": {}
                             },
                             extra // not currently used
                           );

// pause audio playback
window.audioplayer.pause( successCallback, failureCallback);

// pause audio playback
window.audioplayer.stop( successCallback, failureCallback);

// seek forward in on-demand track
window.audioplayer.seek( successCallback, failureCallback, 10 ); // 10=10 seconds (verify this...)

// seek backward in on-demand track
window.audioplayer.seek( successCallback, failureCallback, -10 ); // -10=-10 seconds

// seek to a specific position in on-demand track
window.audioplayer.seekto( successCallback, failureCallback, 20 ); // 20=20 seconds

// request state of audio player
window.audioplayer.getaudiostate( successCallback, failureCallback ); // state returned via successCallback

// set audio player meta data (for lock screen on iOS) -- call this to change metadata for currently playing audio
window.audioplayer.setaudioinfo( successCallback,
                                 failureCallback,
                                 // metadata used for iOS lock screen, Android 'Now Playing' notification
                                 {
                                   "title": "Cuomo; NJ Candidates; and Candy Etiquette",
                                   "artist": "The Brian Lehrer Show",
                                   "image": {
                                     "url": "https://media2.wnyc.org/i/300/300/l/80/1/governor_andrew_cuomo.jpg"
                                   },
                                   "imageThumbnail": {
                                     "url": "https://media2.wnyc.org/i/60/60/l/80/1/governor_andrew_cuomo.jpg"
                                   },
                                   "name": "WNYC 93.9 FM",
                                   "description": "News, Culture & Talk"
                                 }, 
                               );

// callback method
var successCallback = function(result) {
  console.log('audio callback ' + JSON.stringify(result));
  if (result.type==='progress') {
    console.log('progress/duration/available - ' + result.progress + '/' + result.duration + '/' + result.available); // available not currently supported
  } else if (result.type==='state') {
    console.log('status - ' + result.state + '/' + result.description);
  } else if (result.type==='error') {
    console.log('error - ' + result.reason);
  } else if (result.type==='current') {
    console.log('current audio ' + JSON.stringify(result.audio));
  } else if (result.type==='next') {
    console.log('skip to next audio track'); // typically fired by remote control/lock screen controls
  } else if (result.type==='previous') {
    console.log('skip to previous track'); // typically fired by remote/control/lock screen controls
  } else {
    console.log('AudioCallback unhandled type (' + result.type + ')');
  }
};

// audio states
MEDIA_NONE      : 0
MEDIA_STARTING  : 1
MEDIA_RUNNING   : 2
MEDIA_PAUSED    : 3
MEDIA_STOPPED   : 4
MEDIA_LOADING   : 5 (deprecated)
MEDIA_COMPLETED : 6

Building the VLC framework

To build the VLC framework for iOS, execute ./build_vlc_ios.sh