Skip to content
This repository has been archived by the owner on May 1, 2020. It is now read-only.

Videogular2 not working with Ionic 2 #178

Closed
gulukul opened this issue Oct 16, 2016 · 4 comments
Closed

Videogular2 not working with Ionic 2 #178

gulukul opened this issue Oct 16, 2016 · 4 comments

Comments

@gulukul
Copy link

gulukul commented Oct 16, 2016

Short description of the problem:

I simply want to display a video in iOS such that it autoplays and user does NOT get any option to play/pause/stop it. What I am basically doing is trying to make a video splash screen. None of the ionic-native plugins have this support, so I am trying to integrate Videogular2 in Ionic 2. This is not working. The video is available locally.

ionic-app-scripts build fails:

[04:05:20] Error: Unexpected value 'VgCore' imported by the module 'AppModule'
[04:05:20] ngc failed
[04:05:20] ionic-app-script task: "build"
[04:05:20] Error: Error

What behavior are you expecting?

The video runs fine.

Steps to reproduce:

  1. Install videogular2: sudo npm install -g videogular2 --save
  2. In app.module.ts:
    Headers:
import { VgCore } from 'videogular2/core';
import { VgControlsModule } from 'videogular2/controls';
import { VgOverlayPlayModule } from 'videogular2/overlay-play';

Then:

@NgModule({
  declarations: [
    ...
  ],
  imports: [
    IonicModule.forRoot(MyApp),
    VgCore,
    VgControlsModule,
    VgOverlayPlayModule
  ],
...
});
  1. Then run the app ionic serve

Which Ionic Version? 2.x

@jgw96
Copy link
Contributor

jgw96 commented Oct 17, 2016

Hello, thanks for using Ionic! Since this looks to be an error with the library you are using (looks like it does not support Angular 2 AoT compile) I will be closing this issue and asking that you open an issue on that libraries repo instead.

@jgw96 jgw96 closed this as completed Oct 17, 2016
@scottopolis
Copy link

Hello, I have this same problem. This issue is actually with ionic-app-scripts, not videogular 2.

Here is the error I'm getting:

[11:57:57] Error: Unexpected value 'VgCore' imported by the module 'AppModule'
[11:57:57] ngc failed
[11:57:57] ionic-app-script task: "build"
[11:57:57] Error: Error

Compiling using the angular cli using AoT compile does not produce this issue: videogular/videogular2#249

I did some digging and it may be the way ionic-app-scripts uses angular cli: angular/angular-cli#2763

I am using:

ionic-app-scripts 0.0.46
angular-cli: 1.0.0-beta.20-4
ionic: 2.1.7

I hope this helps!

@chriswheatonshoutz
Copy link

I had the same problem as well. I was able to get it working.
Using:
ionic-app-scripts 0.0.46
Modify: node_modules\videogular2\package.json
"dependencies": {}, delete all
"devDependencies": {} paste in the following
"@angular/common": "^2.0.0",
"@angular/compiler": "^2.0.0",
"@angular/core": "^2.0.0",
"@angular/platform-browser": "^2.0.0",
"@angular/platform-browser-dynamic": "^2.0.0",
"es6-shim": "^0.35.1",
"reflect-metadata": "^0.1.8",
"rxjs": "^5.0.0-beta.12",
"systemjs": "^0.19.40",
"zone.js": "^0.6.26",

Delete node_modules\videogular2\node_modules

I hope this helps!

@nazrdogan
Copy link

+1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants