forked from trevorf/ti-android-streamer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
234 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions
1
dist/modules/android/com.woohoo.androidaudiostreamer/1.7.3/LICENSE
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
TODO: place your license here and we'll include it in the module distribution |
Binary file added
BIN
+8.08 KB
dist/modules/android/com.woohoo.androidaudiostreamer/1.7.3/androidaudiostreamer.jar
Binary file not shown.
23 changes: 23 additions & 0 deletions
23
dist/modules/android/com.woohoo.androidaudiostreamer/1.7.3/documentation/index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<h1>androidaudiostreamer Module</h1> | ||
<h2>Description</h2> | ||
<p>TODO: Enter your module description here</p> | ||
<h2>Accessing the androidaudiostreamer Module</h2> | ||
<p>To access this module from JavaScript, you would do the following:</p> | ||
<pre><code>var androidaudiostreamer = require("com.woohoo.androidaudiostreamer"); | ||
</code></pre> | ||
<p>The androidaudiostreamer variable is a reference to the Module object.<br /> | ||
</p> | ||
<h2>Reference</h2> | ||
<p>TODO: If your module has an API, you should document | ||
the reference here.</p> | ||
<h3><strong>_PROJECTNAMEASIDENTIFIER</strong>.function</h3> | ||
<p>TODO: This is an example of a module function.</p> | ||
<h3><strong>_PROJECTNAMEASIDENTIFIER</strong>.property</h3> | ||
<p>TODO: This is an example of a module property.</p> | ||
<h2>Usage</h2> | ||
<p>TODO: Enter your usage example here</p> | ||
<h2>Author</h2> | ||
<p>TODO: Enter your author name, email and other contact | ||
details you want to share here. </p> | ||
<h2>License</h2> | ||
<p>TODO: Enter your license/legal information here.</p> |
176 changes: 176 additions & 0 deletions
176
dist/modules/android/com.woohoo.androidaudiostreamer/1.7.3/example/app.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,176 @@ | ||
// Require the Audio Streamer module | ||
var streamer = require('com.woohoo.androidaudiostreamer'); | ||
|
||
var isPlaying = false; | ||
|
||
// Create a window | ||
var window = Ti.UI.createWindow({ | ||
backgroundColor : 'black', | ||
exitOnClose : true | ||
}); | ||
|
||
// Create a play button and add it to the window | ||
var playButton = Ti.UI.createButton({ | ||
title : 'Play', | ||
top : 100, | ||
left : 100 | ||
}); | ||
window.add(playButton); | ||
|
||
// Create a play button 'click' listener - this will play the stream (MP3, AAC & AAC+ streams are supported) | ||
playButton.addEventListener('click', function(e){ | ||
isPlaying = true; | ||
streamer.play('http://209.85.88.199:8080'); // this is an AAC stream http://198.144.148.12:9002/ | ||
|
||
|
||
/* | ||
* STREAM STATUS CHANGE LISTENER | ||
* | ||
* This listener provides the stream status in real time | ||
*/ | ||
var status; | ||
streamer.addEventListener('change', function(e) { | ||
switch (e.status) { | ||
case 0 : | ||
status = 'STOPPED'; | ||
break; | ||
case 1 : | ||
status = 'BUFFERING/CONNECTING'; | ||
break; | ||
case 2 : | ||
status = 'PLAYING'; | ||
break; | ||
case 3 : | ||
status = 'STREAM CONNECTION ERROR'; | ||
break; | ||
} | ||
|
||
// Output the status to the console log | ||
Ti.API.log(status); | ||
}); | ||
|
||
/* | ||
* METADATA CHANGE LISTENER | ||
* | ||
* This listener is useful when streams provide playlists via stream metadata - the values | ||
* returned are dependent on what the stream provided. | ||
* If any values are returned as undefined this means the stream does not provide them. | ||
*/ | ||
streamer.addEventListener('metadata', function(e) { | ||
Ti.API.log(e.title); | ||
Ti.API.log(e.url); | ||
Ti.API.log(e.genre); | ||
}); | ||
|
||
}); | ||
|
||
// Create a stop button and add it to the window | ||
var stopButton = Ti.UI.createButton({ | ||
title : 'Stop', | ||
top : 100, | ||
right : 100 | ||
}); | ||
window.add(stopButton); | ||
|
||
// Create a stop button 'click' listener - this will stop the stream if it is playing | ||
stopButton.addEventListener('click', function(e){ | ||
isPlaying = false; | ||
streamer.stop(); | ||
}); | ||
|
||
/* Create some variables for the volume | ||
* currentVolume - get the volume level that the device is currently set at | ||
* maxVolume - get the maximum volume for the device (different Android devices have different maximum volume levels) | ||
*/ | ||
var currentVolume = 5; | ||
var maxVolume = streamer.getMaxVolume(); | ||
|
||
// You could use the getCurrentVolume() method to return the device's currently set volume | ||
// streamer.getCurrentVolume() | ||
|
||
// Add a volume label to the window | ||
var volumeLabel = Ti.UI.createLabel({ | ||
text : 'Volume', | ||
font : { | ||
fontSize : '12pt' | ||
}, | ||
textAlign : 'center', | ||
top : 250, | ||
left : 50 | ||
}); | ||
window.add(volumeLabel); | ||
|
||
// Create a 'volume down' button and add it to the window - this will decrease the volume of the stream | ||
var volumeDownButton = Ti.UI.createButton({ | ||
title : '-', | ||
top : 300, | ||
left : '40%' | ||
}); | ||
window.add(volumeDownButton); | ||
|
||
/* Create a 'click' listener on the volume button to decrease the volume - this uses the volume() method of the module to set the volume | ||
* The volume() method take a Number parameter from 0 to 10, where 10 is the maximum volume level | ||
*/ | ||
volumeDownButton.addEventListener('click', function(e){ | ||
var volume = currentVolume - 1; // decrease the current volume setting | ||
currentVolume = volume; // set the currentVolume variable to the current volume setting | ||
streamer.volume(volume); // set the streamer volume | ||
}); | ||
|
||
// Create a 'volume up' button and add it to the window - this will increase the volume of the stream | ||
var volumeUpButton = Ti.UI.createButton({ | ||
title : '+', | ||
top : 300, | ||
right : '40%' | ||
}); | ||
window.add(volumeUpButton); | ||
|
||
/* Create a 'click' listener on the volume button to increase the volume - this uses the volume() method of the module to set the volume | ||
* The volume() method take a Number parameter from 0 to 10, where 10 is the maximum volume level | ||
*/ | ||
volumeUpButton.addEventListener('click', function(e){ | ||
var volume = currentVolume + 1; | ||
currentVolume = volume; | ||
streamer.volume(volume); | ||
}); | ||
|
||
// Create a label to display the device's maximum volume level | ||
var maxVolumeLabel = Ti.UI.createLabel({ | ||
text : 'The maximum volume level for this device is ' + maxVolume.toString(), | ||
font : { | ||
fontSize : '12pt' | ||
}, | ||
textAlign : 'center', | ||
bottom : 200 | ||
}); | ||
window.add(maxVolumeLabel); | ||
|
||
var metadataLabel = Ti.UI.createLabel({ | ||
font : { | ||
fontSize : '12pt' | ||
}, | ||
textAlign : 'center', | ||
bottom : '40%' | ||
}); | ||
window.add(metadataLabel); | ||
|
||
var getMetadataBtn = Ti.UI.createButton({ | ||
title : 'Get Metadata', | ||
top : 460 | ||
}); | ||
window.add(getMetadataBtn); | ||
|
||
// Retrieve the stream metadata - | ||
// getMetaTitle() retrieves the current song or the stream title/description if this is not available | ||
// getMetaGenre() retrieves the stream genre | ||
// and getMetaUrl() retrieves the URL of the stream | ||
getMetadataBtn.addEventListener('click', function(e) { | ||
metadataLabel.text = 'Current Song/Title: ' + streamer.getMetaTitle() + '\nGenre: ' + streamer.getMetaGenre() + '\nURL: ' + streamer.getMetaUrl(); | ||
}); | ||
|
||
// Open the window | ||
window.open(); | ||
|
||
|
||
|
||
|
Binary file added
BIN
+30.1 KB
dist/modules/android/com.woohoo.androidaudiostreamer/1.7.3/lib/aacdecoder-android-0.8.jar
Binary file not shown.
Binary file added
BIN
+30 KB
....woohoo.androidaudiostreamer/1.7.3/libs/armeabi-v7a/libcom.woohoo.androidaudiostreamer.so
Binary file not shown.
Binary file added
BIN
+30 KB
.../com.woohoo.androidaudiostreamer/1.7.3/libs/armeabi/libcom.woohoo.androidaudiostreamer.so
Binary file not shown.
Binary file added
BIN
+33.8 KB
...roid/com.woohoo.androidaudiostreamer/1.7.3/libs/x86/libcom.woohoo.androidaudiostreamer.so
Binary file not shown.
18 changes: 18 additions & 0 deletions
18
dist/modules/android/com.woohoo.androidaudiostreamer/1.7.3/manifest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# | ||
# this is your module manifest and used by Titanium | ||
# during compilation, packaging, distribution, etc. | ||
# | ||
version: 1.7.3 | ||
apiversion: 2 | ||
description: MP3, AAC & AAC+ Audio Streamer for Android. | ||
author: Trevor Fifield | ||
license: Use permitted through purchase or permission given. | ||
copyright: (c) 2012-2014 Trevelyn Ltd (Woohoo Studios) | ||
architectures: armeabi armeabi-v7a x86 | ||
|
||
# these should not be edited | ||
name: androidaudiostreamer | ||
moduleid: com.woohoo.androidaudiostreamer | ||
guid: 1f81e1bf-afd5-4075-a219-d2c51accde23 | ||
platform: android | ||
minsdk: 5.1.2.GA |
16 changes: 16 additions & 0 deletions
16
dist/modules/android/com.woohoo.androidaudiostreamer/1.7.3/timodule.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ti:module xmlns:ti="http://ti.appcelerator.org" xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<!-- | ||
Similar to tiapp.xml, but contains module/platform specific | ||
configuration in <iphone>, <android>, and <mobileweb> sections | ||
--> | ||
<iphone> | ||
</iphone> | ||
<android xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<manifest> | ||
<uses-permission android:name="android.permission.READ_PHONE_STATE" /> | ||
</manifest> | ||
</android> | ||
<mobileweb> | ||
</mobileweb> | ||
</ti:module> |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.