Skip to content

Commit

Permalink
updates for ionic 3.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
arielfaur committed Jun 7, 2017
1 parent 0da451c commit d431dda
Show file tree
Hide file tree
Showing 18 changed files with 207 additions and 96 deletions.
34 changes: 17 additions & 17 deletions demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,28 @@
"ionic:serve": "ionic-app-scripts serve"
},
"dependencies": {
"@angular/common": "4.0.0",
"@angular/compiler": "4.0.0",
"@angular/compiler-cli": "4.0.0",
"@angular/core": "4.0.0",
"@angular/forms": "4.0.0",
"@angular/http": "4.0.0",
"@angular/platform-browser": "4.0.0",
"@angular/platform-browser-dynamic": "4.0.0",
"@ionic-native/core": "3.4.2",
"@ionic-native/splash-screen": "3.4.2",
"@ionic-native/status-bar": "3.4.2",
"@angular/common": "4.1.2",
"@angular/compiler": "4.1.2",
"@angular/compiler-cli": "4.1.2",
"@angular/core": "4.1.2",
"@angular/forms": "4.1.2",
"@angular/http": "4.1.2",
"@angular/platform-browser": "4.1.2",
"@angular/platform-browser-dynamic": "4.1.2",
"@ionic-native/core": "3.10.2",
"@ionic-native/splash-screen": "3.10.2",
"@ionic-native/status-bar": "3.10.2",
"@ionic/storage": "2.0.1",
"ionic-angular": "3.0.1",
"ionic-angular": "3.3.0",
"ionicons": "3.0.0",
"rxjs": "5.1.1",
"sw-toolbox": "3.4.0",
"zone.js": "^0.8.4",
"ionic-audio": "^3.0.0"
"sw-toolbox": "3.6.0",
"zone.js": "0.8.11",
"ionic-audio": "../dist"
},
"devDependencies": {
"@ionic/app-scripts": "1.3.0",
"typescript": "~2.2.1"
"@ionic/app-scripts": "1.3.7",
"typescript": "2.3.3"
},
"cordovaPlugins": [
"cordova-plugin-whitelist",
Expand Down
38 changes: 22 additions & 16 deletions demo/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,37 +11,43 @@ import { TabsPage } from '../pages/tabs/tabs';

import { IonicAudioModule, AudioProvider, WebAudioProvider, audioProviderFactory } from 'ionic-audio';

let pages = [
MyApp,
AboutPage,
ContactPage,
HomePage,
TabsPage
];

/**
* Sample custom factory function to use with ionic-audio
*/
export function myCustomAudioProviderFactory() {
return new WebAudioProvider();
}

export function providers() {
return [{provide: ErrorHandler, useClass: IonicErrorHandler}, SplashScreen, StatusBar];
}
export function entryComponents() {
return pages;
}
export function declarations() {
return pages;
}

@NgModule({
declarations: [
MyApp,
AboutPage,
ContactPage,
HomePage,
TabsPage
],
declarations: declarations(),
imports: [
BrowserModule,
IonicModule.forRoot(MyApp),
IonicAudioModule.forRoot({ provide: AudioProvider, useFactory: audioProviderFactory }),
IonicAudioModule.forRoot({ provide: AudioProvider, useFactory: myCustomAudioProviderFactory }),
// or use custom function above to force a specific provider
// { provide: AudioProvider, useFactory: myCustomAudioProviderFactory }
],
bootstrap: [IonicApp],
entryComponents: [
MyApp,
AboutPage,
ContactPage,
HomePage,
TabsPage
],
providers: [{provide: ErrorHandler, useClass: IonicErrorHandler}, SplashScreen, StatusBar],
entryComponents: entryComponents(),
providers: providers(),
schemas: [ CUSTOM_ELEMENTS_SCHEMA ]
})
export class AppModule {}
14 changes: 0 additions & 14 deletions demo/src/declarations.d.ts

This file was deleted.

3 changes: 3 additions & 0 deletions demo/www/index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<script data-ionic="inject">
(function(w){var i=w.Ionic=w.Ionic||{};i.version='3.3.0';i.angular='4.1.2';i.staticDir='build/';})(window);
</script>
<meta charset="UTF-8">
<title>Ionic App</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
Expand Down
44 changes: 44 additions & 0 deletions dist/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"name": "ionic-audio",
"version": "3.0.1",
"description": "An audio player for Ionic 3 and Angular 4",
"main": "./index.js",
"typings": "./index.d.ts",
"devDependencies": {
"@angular/common": "4.1.2",
"@angular/compiler": "4.1.2",
"@angular/compiler-cli": "4.1.2",
"@angular/core": "4.1.2",
"@angular/forms": "4.1.2",
"@angular/http": "4.1.2",
"@angular/platform-browser": "4.1.2",
"@angular/platform-browser-dynamic": "4.1.2",
"@ionic-native/core": "3.10.2",
"@ionic-native/splash-screen": "3.10.2",
"@ionic-native/status-bar": "3.10.2",
"@ionic/storage": "2.0.1",
"ionic-angular": "3.3.0",
"ionicons": "3.0.0",
"rxjs": "5.1.1",
"sw-toolbox": "3.6.0",
"zone.js": "0.8.11",
"typescript": "2.3.3"
},
"repository": {
"type": "git",
"url": "git+https://github.com/arielfaur/ionic-audio.git"
},
"keywords": [
"ionic",
"angular",
"audio",
"player",
"typescript"
],
"author": "Ariel Faur",
"license": "MIT",
"bugs": {
"url": "https://github.com/arielfaur/ionic-audio/issues"
},
"homepage": "https://github.com/arielfaur/ionic-audio#readme"
}
36 changes: 17 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ionic-audio",
"version": "3.0.0",
"version": "3.0.1",
"description": "An audio player for Ionic 3 and Angular 4",
"main": "./dist/index.js",
"typings": "./dist/index.d.ts",
Expand All @@ -9,27 +9,25 @@
"release": "npm run prepublish && npm publish",
"test": "echo \"Error: no test specified\" && exit 1"
},
"dependencies": {
"@angular/common": "4.0.0",
"@angular/compiler": "4.0.0",
"@angular/compiler-cli": "4.0.0",
"@angular/core": "4.0.0",
"@angular/forms": "4.0.0",
"@angular/http": "4.0.0",
"@angular/platform-browser": "4.0.0",
"@angular/platform-browser-dynamic": "4.0.0",
"@ionic-native/core": "3.4.2",
"@ionic-native/splash-screen": "3.4.2",
"@ionic-native/status-bar": "3.4.2",
"devDependencies": {
"@angular/common": "4.1.2",
"@angular/compiler": "4.1.2",
"@angular/compiler-cli": "4.1.2",
"@angular/core": "4.1.2",
"@angular/forms": "4.1.2",
"@angular/http": "4.1.2",
"@angular/platform-browser": "4.1.2",
"@angular/platform-browser-dynamic": "4.1.2",
"@ionic-native/core": "3.10.2",
"@ionic-native/splash-screen": "3.10.2",
"@ionic-native/status-bar": "3.10.2",
"@ionic/storage": "2.0.1",
"ionic-angular": "3.0.1",
"ionic-angular": "3.3.0",
"ionicons": "3.0.0",
"rxjs": "5.1.1",
"sw-toolbox": "3.4.0",
"zone.js": "^0.8.4"
},
"devDependencies": {
"typescript": "~2.2.1"
"sw-toolbox": "3.6.0",
"zone.js": "0.8.11",
"typescript": "2.3.3"
},
"repository": {
"type": "git",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
32 changes: 12 additions & 20 deletions dist/ionic-audio.module.ts → src/ionic-audio.module.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NgModule, ModuleWithProviders, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { NgModule, ModuleWithProviders, Optional, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { CommonModule } from '@angular/common';
import { IonicModule } from 'ionic-angular';

Expand All @@ -8,22 +8,20 @@ import {AudioTrackPlayComponent} from './ionic-audio-track-play-component';
import {AudioTimePipe} from './ionic-audio-time-pipe';
import {AudioProvider, CordovaMediaProvider, WebAudioProvider} from './ionic-audio-providers';

@NgModule({
imports: [ CommonModule, IonicModule ],
declarations: [
AudioTrackComponent,
AudioTrackProgressComponent,
AudioTrackProgressBarComponent,
AudioTrackPlayComponent,
AudioTimePipe
],
exports: [
export function declarations() {
return [
AudioTrackComponent,
AudioTrackProgressComponent,
AudioTrackProgressBarComponent,
AudioTrackPlayComponent,
AudioTimePipe
],
]
}

@NgModule({
imports: [ CommonModule, IonicModule ],
declarations: declarations(),
exports: declarations(),
providers: [],
schemas: [ CUSTOM_ELEMENTS_SCHEMA ]
})
Expand All @@ -32,16 +30,10 @@ export class IonicAudioModule {
* Configures Ionic Audio to use either Cordova or HTML5 audio.
* If no ```audioProvider``` is set it will automatically choose one based on the current environment
*/
static forRoot(audioProvider?: {
provide: typeof AudioProvider;
useFactory: () => CordovaMediaProvider | WebAudioProvider;
}): ModuleWithProviders {

static forRoot(audioProvider?: any): ModuleWithProviders {
return {
ngModule: IonicAudioModule,
providers: [
audioProvider || { provide: AudioProvider, useClass: WebAudioProvider }
]
providers: audioProvider
};
}
}
82 changes: 82 additions & 0 deletions src/ionic-audio.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@

audio-track {

ion-thumbnail {
> img {
top: 0;
position: absolute;
.md & {
@import "node_modules/ionic-angular/components/item/item.md";
margin-top: ($item-md-padding-right / 2);
}

.ios & {
@import "node_modules/ionic-angular/components/item/item.ios";
margin-top: ($item-ios-padding-right / 2);
}
}
audio-track-play {
position: absolute;
top: 0rem;
display: inline-flex;

.md & {
@import "node_modules/ionic-angular/components/item/item.md";
min-width: $item-md-thumbnail-size;
min-height: $item-md-thumbnail-size;
margin: ($item-md-padding-right / 2) $item-md-padding-right ($item-md-padding-right / 2) 0;
}

.ios & {
@import "node_modules/ionic-angular/components/item/item.ios";
min-width: $item-ios-thumbnail-size;
min-height: $item-ios-thumbnail-size;
margin: ($item-ios-padding-right / 2) $item-ios-padding-right ($item-ios-padding-right / 2) 0;
}

button {
width: 100% !important;
height: inherit !important;
margin: 0 !important;

&.light {
background: map-get($colors, dark);
color: map-get($colors, light);
opacity: .8;
}

&.dark {
color: map-get($colors, dark);
opacity: .6;
}

ion-icon {
font-size: 2em !important;
}
}

}
}

audio-track-progress {
em {
font-size: .8em;
}
}


audio-track-progress-bar{
ion-range {
&.range-ios {
padding: 0;
}
&.range-md {
padding: 0;
}
}

time {
font-size: .8em;
}
}
}
20 changes: 10 additions & 10 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@
"rewriteTsconfig": false
},
"files": [
"dist/index.ts",
"dist/ionic-audio.module.ts",
"dist/ionic-audio-web-track.ts",
"dist/ionic-audio-track-progress-component.ts",
"dist/ionic-audio-track-play-component.ts",
"dist/ionic-audio-track-component.ts",
"dist/ionic-audio-time-pipe.ts",
"dist/ionic-audio-providers.ts",
"dist/ionic-audio-interfaces.ts",
"dist/ionic-audio-cordova-track.ts"
"src/index.ts",
"src/ionic-audio.module.ts",
"src/ionic-audio-web-track.ts",
"src/ionic-audio-track-progress-component.ts",
"src/ionic-audio-track-play-component.ts",
"src/ionic-audio-track-component.ts",
"src/ionic-audio-time-pipe.ts",
"src/ionic-audio-providers.ts",
"src/ionic-audio-interfaces.ts",
"src/ionic-audio-cordova-track.ts"
],
"angularCompilerOptions": {
"strictMetadataEmit": true,
Expand Down

0 comments on commit d431dda

Please sign in to comment.