Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.angular
20 changes: 20 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

# Simple Example

This example demonstrates how to use the `interactive-video-angular-wrapper` in a simple Angular application.

## How to run

1. Install the dependencies:

```bash
pnpm install
```

2. Run the application:

```bash
pnpm start
```

3. Open your browser to `http://localhost:4200`.
Comment thread
taj54 marked this conversation as resolved.
89 changes: 89 additions & 0 deletions examples/angular.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"simple-example": {
"projectType": "application",
"schematics": {},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/simple-example",
"index": "index.html",
"main": "main.ts",
"polyfills": ["zone.js"],
"tsConfig": "tsconfig.app.json",
"assets": [],
"styles": [],
"scripts": []
},
"configurations": {
"production": {
"budgets": [
{
"type": "initial",
"maximumWarning": "500kb",
"maximumError": "1mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "2kb",
"maximumError": "4kb"
}
],
"outputHashing": "all"
},
"development": {
"buildOptimizer": false,
"optimization": false,
"vendorChunk": true,
"extractLicenses": false,
"sourceMap": true,
"namedChunks": true
}
},
"defaultConfiguration": "development"
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"buildTarget": "simple-example:build"
},
"configurations": {
"production": {
"buildTarget": "simple-example:build:production"
},
"development": {
"buildTarget": "simple-example:build:development"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "simple-example:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"polyfills": ["zone.js", "zone.js/testing"],
"tsConfig": "tsconfig.spec.json",
"assets": ["assets"],
"styles": ["styles.css"],
"scripts": []
}
}
}
}
},
"cli": {
"analytics": false
}
}
34 changes: 34 additions & 0 deletions examples/app.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { CommonModule } from '@angular/common'; // Import CommonModule for NgIf

@Component({
selector: 'app-root',
standalone: true,
imports: [CommonModule], // Use CommonModule for NgIf
schemas: [CUSTOM_ELEMENTS_SCHEMA], // Allow Web Components
template: `
Comment thread
taj54 marked this conversation as resolved.
<h1>Simple Interactive Video Example</h1>
<iv-interactive-video
[videoUrl]="'http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4'"
[cues]="[
{
id: 'cue-1',
time: 5,
payload: {
type: 'text',
data: {
text: 'This is a simple text overlay.',
},
},
}
]"
(analyticsEvent)="onAnalyticsEvent($event)"
></iv-interactive-video>
`,
})
export class AppComponent {
onAnalyticsEvent(event: any) {
console.log('Analytics Event:', event);
}
}

12 changes: 12 additions & 0 deletions examples/app.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import { InteractiveVideoComponent } from '@interactive-video-labs/angular';
Comment thread
taj54 marked this conversation as resolved.

@NgModule({
declarations: [AppComponent],
imports: [BrowserModule, InteractiveVideoComponent],
providers: [],
bootstrap: [AppComponent],
})
export class AppModule {}
12 changes: 12 additions & 0 deletions examples/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Simple Example</title>
</head>
<body>
<app-root></app-root>
</body>
</html>
4 changes: 4 additions & 0 deletions examples/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { bootstrapApplication } from '@angular/platform-browser';
import { AppComponent } from './app.component';

bootstrapApplication(AppComponent).catch((err) => console.error(err));
40 changes: 40 additions & 0 deletions examples/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"name": "simple-example",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "pnpm exec ng serve --configuration=development --verbose",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test"
},
"private": true,
"dependencies": {
"@angular/animations": "~19.0.0",
"@angular/common": "~19.0.0",
"@angular/compiler": "~19.0.0",
"@angular/core": "~19.0.0",
"@angular/forms": "~19.0.0",
"@angular/platform-browser": "~19.0.0",
"@angular/platform-browser-dynamic": "~19.0.0",
"@angular/router": "~19.0.0",
"@interactive-video-labs/angular": "workspace:*",
"rxjs": "~7.8.0",
"tslib": "^2.3.0",
"zone.js": "~0.15.0"
},
"devDependencies": {
"@angular-devkit/architect": "0.1900.7",
"@angular-devkit/build-angular": "~19.0.0",
"@angular/cli": "~19.0.0",
"@angular/compiler-cli": "~19.0.0",
"@types/jasmine": "~4.3.0",
"jasmine-core": "~4.5.0",
"karma": "~6.4.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "~2.2.0",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "~2.0.0",
"typescript": "5.6.2"
}
}
10 changes: 10 additions & 0 deletions examples/tsconfig.app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./out-tsc/app",
"types": []
},
"files": ["main.ts"],
"include": ["**/*.d.ts"]
}
34 changes: 34 additions & 0 deletions examples/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist",
"forceConsistentCasingInFileNames": true,
"strict": true,
"noImplicitOverride": true,
"noPropertyAccessFromIndexSignature": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"sourceMap": true,
"declaration": false,
"downlevelIteration": true,
"experimentalDecorators": true,
"moduleResolution": "node",
"importHelpers": true,
"target": "ES2022",
"module": "ES2022",
"lib": ["ES2022", "dom"],
"paths": {
"@interactive-video-labs/angular": [
"../dist"
]
}
},
"angularCompilerOptions": {
"enableI18nLegacyMessageIdFormat": false,
"strictInjectionParameters": true,
"strictInputAccessModifiers": true,
"strictTemplates": true
}
}
34 changes: 17 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
"dist"
],
"scripts": {
"build": "tsup src/index.ts --format esm,cjs --dts",
"dev": "tsup src/index.ts --watch --format esm,cjs",
"build": "tsup",
"dev": "tsup --watch",
"test": "vitest run",
"clean": "rm -rf dist",
"clean": "rimraf dist",
"prepare": "pnpm build"
},
"keywords": [
Expand All @@ -30,8 +30,7 @@
"typescript",
"video-player",
"cue-points",
"interactive-learning",
"angular-wrapper"
""
],
"author": "Taj",
"license": "MIT",
Expand All @@ -45,26 +44,27 @@
},
"packageManager": "pnpm@10.13.1",
"peerDependencies": {
"@angular/common": "^15.0.0 || ^16.0.0 || ^17.0.0",
"@angular/core": "^15.0.0 || ^16.0.0 || ^17.0.0",
"@interactive-video-labs/core": "^0.1.2"
"@angular/common": "~19.0.0",
"@angular/core": "~19.0.0",
"@interactive-video-labs/core": "^0.1.4"
},
"dependencies": {
"tslib": "^2.8.1"
},
"devDependencies": {
"@analogjs/vite-plugin-angular": "^1.19.4",
"@angular-devkit/build-angular": "^20.1.5",
"@angular/common": "^20.1.6",
"@angular/compiler": "^20.1.6",
"@angular/compiler-cli": "^20.1.6",
"@angular/core": "^20.1.6",
"@angular/platform-browser": "^20.1.6",
"@angular/platform-browser-dynamic": "^20.1.6",
"@angular-devkit/build-angular": "~19.0.0",
"@angular/common": "~19.0.0",
"@angular/compiler": "~19.0.0",
"@angular/compiler-cli": "~19.0.0",
"@angular/core": "~19.0.0",
"@angular/platform-browser": "~19.0.0",
"@angular/platform-browser-dynamic": "~19.0.0",
"jsdom": "^26.1.0",
"tsup": "^8.5.0",
"typescript": "^5.9.2",
"typescript": "5.6.2",
"vitest": "^3.2.4",
"zone.js": "^0.15.1"
"zone.js": "^0.15.1",
"rimraf": "^5.0.0"
}
}
Loading
Loading