Skip to content

Commit 2758a95

Browse files
authored
Merge pull request #3 from taj54/main
fix: resolve build error by correctly importing types
2 parents 9b3b0ff + 668a261 commit 2758a95

20 files changed

Lines changed: 4521 additions & 1005 deletions

examples/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.angular

examples/README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
# Simple Example
3+
4+
This example demonstrates how to use the `interactive-video-angular-wrapper` in a simple Angular application.
5+
6+
## How to run
7+
8+
1. Install the dependencies:
9+
10+
```bash
11+
pnpm install
12+
```
13+
14+
2. Run the application:
15+
16+
```bash
17+
pnpm start
18+
```
19+
20+
3. Open your browser to `http://localhost:4200`.

examples/angular.json

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"version": 1,
4+
"newProjectRoot": "projects",
5+
"projects": {
6+
"simple-example": {
7+
"projectType": "application",
8+
"schematics": {},
9+
"root": "",
10+
"sourceRoot": "src",
11+
"prefix": "app",
12+
"architect": {
13+
"build": {
14+
"builder": "@angular-devkit/build-angular:browser",
15+
"options": {
16+
"outputPath": "dist/simple-example",
17+
"index": "index.html",
18+
"main": "main.ts",
19+
"polyfills": ["zone.js"],
20+
"tsConfig": "tsconfig.app.json",
21+
"assets": [],
22+
"styles": [],
23+
"scripts": []
24+
},
25+
"configurations": {
26+
"production": {
27+
"budgets": [
28+
{
29+
"type": "initial",
30+
"maximumWarning": "500kb",
31+
"maximumError": "1mb"
32+
},
33+
{
34+
"type": "anyComponentStyle",
35+
"maximumWarning": "2kb",
36+
"maximumError": "4kb"
37+
}
38+
],
39+
"outputHashing": "all"
40+
},
41+
"development": {
42+
"buildOptimizer": false,
43+
"optimization": false,
44+
"vendorChunk": true,
45+
"extractLicenses": false,
46+
"sourceMap": true,
47+
"namedChunks": true
48+
}
49+
},
50+
"defaultConfiguration": "development"
51+
},
52+
"serve": {
53+
"builder": "@angular-devkit/build-angular:dev-server",
54+
"options": {
55+
"buildTarget": "simple-example:build"
56+
},
57+
"configurations": {
58+
"production": {
59+
"buildTarget": "simple-example:build:production"
60+
},
61+
"development": {
62+
"buildTarget": "simple-example:build:development"
63+
}
64+
},
65+
"defaultConfiguration": "development"
66+
},
67+
"extract-i18n": {
68+
"builder": "@angular-devkit/build-angular:extract-i18n",
69+
"options": {
70+
"browserTarget": "simple-example:build"
71+
}
72+
},
73+
"test": {
74+
"builder": "@angular-devkit/build-angular:karma",
75+
"options": {
76+
"polyfills": ["zone.js", "zone.js/testing"],
77+
"tsConfig": "tsconfig.spec.json",
78+
"assets": ["assets"],
79+
"styles": ["styles.css"],
80+
"scripts": []
81+
}
82+
}
83+
}
84+
}
85+
},
86+
"cli": {
87+
"analytics": false
88+
}
89+
}

examples/app.component.ts

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
2+
import { CommonModule } from '@angular/common'; // Import CommonModule for NgIf
3+
import { InteractiveVideoComponent } from '@interactive-video-labs/angular';
4+
5+
@Component({
6+
selector: 'app-root',
7+
standalone: true,
8+
imports: [CommonModule, InteractiveVideoComponent], // Use CommonModule for NgIf
9+
schemas: [CUSTOM_ELEMENTS_SCHEMA], // Allow Web Components
10+
template: `
11+
<h1>Simple Interactive Video Example</h1>
12+
<iv-interactive-video
13+
[videoUrl]="'http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4'"
14+
[cues]="[
15+
{
16+
id: 'cue-1',
17+
time: 5,
18+
payload: {
19+
type: 'text',
20+
data: {
21+
text: 'This is a simple text overlay.',
22+
},
23+
},
24+
}
25+
]"
26+
(analyticsEvent)="onAnalyticsEvent($event)"
27+
></iv-interactive-video>
28+
`,
29+
})
30+
export class AppComponent {
31+
onAnalyticsEvent(event: any) {
32+
console.log('Analytics Event:', event);
33+
}
34+
}
35+

examples/app.module.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { NgModule } from '@angular/core';
2+
import { BrowserModule } from '@angular/platform-browser';
3+
import { AppComponent } from './app.component';
4+
import { InteractiveVideoComponent } from '@interactive-video-labs/angular';
5+
6+
@NgModule({
7+
declarations: [AppComponent],
8+
imports: [BrowserModule, InteractiveVideoComponent],
9+
providers: [],
10+
bootstrap: [AppComponent],
11+
})
12+
export class AppModule {}

examples/index.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
<!DOCTYPE html>
3+
<html lang="en">
4+
<head>
5+
<meta charset="UTF-8" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Simple Example</title>
8+
</head>
9+
<body>
10+
<app-root></app-root>
11+
</body>
12+
</html>

examples/main.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { bootstrapApplication } from '@angular/platform-browser';
2+
import { AppComponent } from './app.component';
3+
4+
bootstrapApplication(AppComponent).catch((err) => console.error(err));

examples/package.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"name": "simple-example",
3+
"version": "0.0.0",
4+
"scripts": {
5+
"ng": "ng",
6+
"start": "pnpm exec ng serve --configuration=development --verbose",
7+
"build": "ng build",
8+
"watch": "ng build --watch --configuration development",
9+
"test": "ng test"
10+
},
11+
"private": true,
12+
"dependencies": {
13+
"@angular/animations": "~19.0.0",
14+
"@angular/common": "~19.0.0",
15+
"@angular/compiler": "~19.0.0",
16+
"@angular/core": "~19.0.0",
17+
"@angular/forms": "~19.0.0",
18+
"@angular/platform-browser": "~19.0.0",
19+
"@angular/platform-browser-dynamic": "~19.0.0",
20+
"@angular/router": "~19.0.0",
21+
"@interactive-video-labs/angular": "workspace:*",
22+
"rxjs": "~7.8.0",
23+
"tslib": "^2.3.0",
24+
"zone.js": "~0.15.0"
25+
},
26+
"devDependencies": {
27+
"@angular-devkit/architect": "0.1900.7",
28+
"@angular-devkit/build-angular": "~19.0.0",
29+
"@angular/cli": "~19.0.0",
30+
"@angular/compiler-cli": "~19.0.0",
31+
"@types/jasmine": "~4.3.0",
32+
"jasmine-core": "~4.5.0",
33+
"karma": "~6.4.0",
34+
"karma-chrome-launcher": "~3.1.0",
35+
"karma-coverage": "~2.2.0",
36+
"karma-jasmine": "~5.1.0",
37+
"karma-jasmine-html-reporter": "~2.0.0",
38+
"typescript": "5.6.2"
39+
}
40+
}

examples/tsconfig.app.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
{
3+
"extends": "./tsconfig.json",
4+
"compilerOptions": {
5+
"outDir": "./out-tsc/app",
6+
"types": []
7+
},
8+
"files": ["main.ts"],
9+
"include": ["**/*.d.ts"]
10+
}

examples/tsconfig.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
2+
{
3+
"compileOnSave": false,
4+
"compilerOptions": {
5+
"baseUrl": "./",
6+
"outDir": "./dist",
7+
"forceConsistentCasingInFileNames": true,
8+
"strict": true,
9+
"noImplicitOverride": true,
10+
"noPropertyAccessFromIndexSignature": true,
11+
"noImplicitReturns": true,
12+
"noFallthroughCasesInSwitch": true,
13+
"sourceMap": true,
14+
"declaration": false,
15+
"downlevelIteration": true,
16+
"experimentalDecorators": true,
17+
"moduleResolution": "node",
18+
"importHelpers": true,
19+
"target": "ES2022",
20+
"module": "ES2022",
21+
"lib": ["ES2022", "dom"],
22+
"paths": {
23+
"@interactive-video-labs/angular": [
24+
"../dist"
25+
]
26+
}
27+
},
28+
"angularCompilerOptions": {
29+
"enableI18nLegacyMessageIdFormat": false,
30+
"strictInjectionParameters": true,
31+
"strictInputAccessModifiers": true,
32+
"strictTemplates": true
33+
}
34+
}

0 commit comments

Comments
 (0)