Closed gopalaiahvinay closed 6 years ago
Are there are any errors logged in the console?
Well there are no errors, I used to get errors saying something in the lines tracks is not recognized property. But after I included
schemas: [CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA]
Errors disappeared.
@arielfaur Any update regarding this issue?
Try to remove NO_ERRORS_SCHEMA
and see what errors are logged to the console.
After removing all schemas:
ERROR Error: Uncaught (in promise): Error: Template parse errors:
Can't bind to 'track' since it isn't a known property of 'audio-track'.
1. If 'audio-track' is an Angular component and it has 'track' input, then verify that it is part of this module.
2. If 'audio-track' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component. ("
<ion-list>
<audio-track #audio *ngFor="let track of myTracks" [ERROR ->][track]="track">
<ion-item>
"): ng:///Listen2ExpertsPageModule/Listen2ExpertsPage.html@34:55
Can't bind to 'audioTrack' since it isn't a known property of 'audio-track-play'.
1. If 'audio-track-play' is an Angular component and it has 'audioTrack' input, then verify that it is part of this module.
2. If 'audio-track-play' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component. ("
<img src="{{audio.art}}">
<audio-track-play dark [ERROR ->][audioTrack]="audio">
<ion-spinner></ion-spinner>
"): ng:///Listen2ExpertsPageModule/Listen2ExpertsPage.html@42:33
'audio-track-play' is not a known element:
1. If 'audio-track-play' is an Angular component, then verify that it is part of this module.
2. If 'audio-track-play' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("
<img src="{{audio.art}}">
[ERROR ->]<audio-track-play dark [audioTrack]="audio">
<ion-spinner></ion-spinner>
"): ng:///Listen2ExpertsPageModule/Listen2ExpertsPage.html@42:10
Can't bind to 'audioTrack' since it isn't a known property of 'audio-track-progress-bar'.
1. If 'audio-track-progress-bar' is an Angular component and it has 'audioTrack' input, then verify that it is part of this module.
2. If 'audio-track-progress-bar' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component. ("rong> ⚬ <em>{{audio.artist}}</em></p>
<audio-track-progress-bar duration progress [ERROR ->][audioTrack]="audio"></audio-track-progress-bar>
<!-- <em style="font-size:.5em">Track ID:"): ng:///Listen2ExpertsPageModule/Listen2ExpertsPage.html@54:54
'audio-track-progress-bar' is not a known element:
1. If 'audio-track-progress-bar' is an Angular component, then verify that it is part of this module.
2. If 'audio-track-progress-bar' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("
<p><strong>{{audio.title}}</strong> ⚬ <em>{{audio.artist}}</em></p>
[ERROR ->]<audio-track-progress-bar duration progress [audioTrack]="audio"></audio-track-progress-bar>
"): ng:///Listen2ExpertsPageModule/Listen2ExpertsPage.html@54:10
'audio-track' is not a known element:
1. If 'audio-track' is an Angular component, then verify that it is part of this module.
2. If 'audio-track' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("
<ion-list>
[ERROR ->]<audio-track #audio *ngFor="let track of myTracks" [track]="track">
<ion-item>
"): ng:///Listen2ExpertsPageModule/Listen2ExpertsPage.html@34:4
Error: Template parse errors:
Can't bind to 'track' since it isn't a known property of 'audio-track'.
1. If 'audio-track' is an Angular component and it has 'track' input, then verify that it is part of this module.
2. If 'audio-track' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component. ("
<ion-list>
<audio-track #audio *ngFor="let track of myTracks" [ERROR ->][track]="track">
<ion-item>
"): ng:///Listen2ExpertsPageModule/Listen2ExpertsPage.html@34:55
Can't bind to 'audioTrack' since it isn't a known property of 'audio-track-play'.
1. If 'audio-track-play' is an Angular component and it has 'audioTrack' input, then verify that it is part of this module.
2. If 'audio-track-play' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component. ("
<img src="{{audio.art}}">
<audio-track-play dark [ERROR ->][audioTrack]="audio">
<ion-spinner></ion-spinner>
"): ng:///Listen2ExpertsPageModule/Listen2ExpertsPage.html@42:33
'audio-track-play' is not a known element:
1. If 'audio-track-play' is an Angular component, then verify that it is part of this module.
2. If 'audio-track-play' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("
<img src="{{audio.art}}">
[ERROR ->]<audio-track-play dark [audioTrack]="audio">
<ion-spinner></ion-spinner>
"): ng:///Listen2ExpertsPageModule/Listen2ExpertsPage.html@42:10
Can't bind to 'audioTrack' since it isn't a known property of 'audio-track-progress-bar'.
1. If 'audio-track-progress-bar' is an Angular component and it has 'audioTrack' input, then verify that it is part of this module.
2. If 'audio-track-progress-bar' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component. ("rong> ⚬ <em>{{audio.artist}}</em></p>
<audio-track-progress-bar duration progress [ERROR ->][audioTrack]="audio"></audio-track-progress-bar>
<!-- <em style="font-size:.5em">Track ID:"): ng:///Listen2ExpertsPageModule/Listen2ExpertsPage.html@54:54
'audio-track-progress-bar' is not a known element:
1. If 'audio-track-progress-bar' is an Angular component, then verify that it is part of this module.
2. If 'audio-track-progress-bar' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("
<p><strong>{{audio.title}}</strong> ⚬ <em>{{audio.artist}}</em></p>
[ERROR ->]<audio-track-progress-bar duration progress [audioTrack]="audio"></audio-track-progress-bar>
"): ng:///Listen2ExpertsPageModule/Listen2ExpertsPage.html@54:10
'audio-track' is not a known element:
1. If 'audio-track' is an Angular component, then verify that it is part of this module.
2. If 'audio-track' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("
<ion-list>
[ERROR ->]<audio-track #audio *ngFor="let track of myTracks" [track]="track">
<ion-item>
"): ng:///Listen2ExpertsPageModule/Listen2ExpertsPage.html@34:4
at syntaxError (http://localhost:8100/build/vendor.js:96485:34)
at TemplateParser.parse (http://localhost:8100/build/vendor.js:106976:19)
at JitCompiler._compileTemplate (http://localhost:8100/build/vendor.js:120727:39)
at http://localhost:8100/build/vendor.js:120651:62
at Set.forEach (native)
at JitCompiler._compileComponents (http://localhost:8100/build/vendor.js:120651:19)
at createResult (http://localhost:8100/build/vendor.js:120536:19)
at t.invoke (http://localhost:8100/build/polyfills.js:3:9283)
at Object.onInvoke (http://localhost:8100/build/vendor.js:4508:37)
at t.invoke (http://localhost:8100/build/polyfills.js:3:9223)
at syntaxError (http://localhost:8100/build/vendor.js:96485:34)
at TemplateParser.parse (http://localhost:8100/build/vendor.js:106976:19)
at JitCompiler._compileTemplate (http://localhost:8100/build/vendor.js:120727:39)
at http://localhost:8100/build/vendor.js:120651:62
at Set.forEach (native)
at JitCompiler._compileComponents (http://localhost:8100/build/vendor.js:120651:19)
at createResult (http://localhost:8100/build/vendor.js:120536:19)
at t.invoke (http://localhost:8100/build/polyfills.js:3:9283)
at Object.onInvoke (http://localhost:8100/build/vendor.js:4508:37)
at t.invoke (http://localhost:8100/build/polyfills.js:3:9223)
at c (http://localhost:8100/build/polyfills.js:3:13535)
at Object.reject (http://localhost:8100/build/polyfills.js:3:12891)
at NavControllerBase._fireError (http://localhost:8100/build/vendor.js:49982:16)
at NavControllerBase._failed (http://localhost:8100/build/vendor.js:49970:14)
at http://localhost:8100/build/vendor.js:50025:59
at t.invoke (http://localhost:8100/build/polyfills.js:3:9283)
at Object.onInvoke (http://localhost:8100/build/vendor.js:4508:37)
at t.invoke (http://localhost:8100/build/polyfills.js:3:9223)
at r.run (http://localhost:8100/build/polyfills.js:3:4452)
at http://localhost:8100/build/polyfills.js:3:14076
I meant removing NO_ERRORS_SCHEMA
only 😃
There is no error if I remove only NO_ERRORS_SCHEMA, but the result is the same as before.
If you have any demo of implementation for Ionic 3.5+, point me to that demo, I will try replicating that.
Yes, the demo project which has also a live demo: https://github.com/arielfaur/ionic-audio-demo You could try to clone the project and build to see if you have the same issues.
@arielfaur I had to remove lazy loading to get it working. With lazy loading it was throwing the errors of track not valid property.
I never tried lazy loading so I don't know how it plays with this. But I read about it and apparently it only requires changes to the pages.
Well the issue was having another ngModule declaration for each page. So importing and declaring makes it a bit confusing.
@arielfaur it works fine on android, but on ios when I press play, the audio is not starting. But the play button toggles from 'Play' icon to 'Pause' icon. And the start and end time, also does not appear. Any idea why?
I really don't know as I never tried with lazy loading
@arielfaur - Getting error while running the example into a sample project PF code snippet.
App Module -
`import { IonicAudioModule, WebAudioProvider, CordovaMediaProvider, defaultAudioProviderFactory } from 'ionic-audio';
@NgModule({
declarations: [
MyApp
],
imports: [
HttpModule,
BrowserModule,
IonicModule.forRoot(MyApp),
SuperTabsModule.forRoot(),
IonicAudioModule.forRoot(defaultAudioProviderFactory)
],`
`Configuration
@ionic/cli-utils : 1.13.0 ionic (Ionic CLI) : 3.13.0
global packages:
cordova (Cordova CLI) : not installed
local packages:
@ionic/app-scripts : 2.1.4
Cordova Platforms : browser 4.1.0
Ionic Framework : ionic-angular 3.6.1
System:
Android SDK Tools : 26.0.1
Node : v6.11.2
npm : 5.3.0
OS : Windows 10
Misc:
backend : legacy`
I find a solution (lazy loading)
:
just import IonicAudioModule to xxx.module.ts
where you using audio plugins.
import { IonicAudioModule, defaultAudioProviderFactory } from 'ionic-audio';
@NgModule({
declarations: [
DebugPage,
],
imports: [
IonicPageModule.forChild(MyMusicPageModule),
IonicAudioModule.forRoot(defaultAudioProviderFactory)
],
exports: [
DebugPage,
],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
export class MyMusicPageModule {} // not AppModule
ERROR Error: Uncaught (in promise): Error: Template parse errors: Can't bind to 'track' since it isn't a known property of 'audio-track'.
some one help
I find a solution
(lazy loading)
:just import IonicAudioModule to
xxx.module.ts
where you using audio plugins.import { IonicAudioModule, defaultAudioProviderFactory } from 'ionic-audio'; @NgModule({ declarations: [ DebugPage, ], imports: [ IonicPageModule.forChild(MyMusicPageModule), IonicAudioModule.forRoot(defaultAudioProviderFactory) ], exports: [ DebugPage, ], schemas: [CUSTOM_ELEMENTS_SCHEMA] }) export class MyMusicPageModule {} // not AppModule
This solved my issue
Hi,
I am trying to integrate the music player, but not able to get it working. Below is the code:
html:
Component Module:
Component:
app.module.ts
Below is the screenshot of the result:
Let me know what is going wrong.