Skip to content

Commit 458d2bb

Browse files
authored
2.4 - Update to latest version
2 parents 720fabf + 6dee9c7 commit 458d2bb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+911
-601
lines changed

README.md

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
<p align="center">
2-
<a href="https://quead.github.io/demo/" target="_blank" title="YouTube Player Demo">
2+
<a href="https://habarnam.io/player/home" target="_blank" title="YouTube Player Demo">
33
Demo
44
</a>
5-
<a href="https://quead.github.io/demo/" target="_blank" title="YouTube Player">
6-
<img alt="Angular YouTube Player Logo" src="https://i.imgur.com/THnmBnz.png" style="height: auto; max-width:100%;" />
5+
<a href="https://habarnam.io/player/home" target="_blank" title="YouTube Player">
6+
<img alt="Angular YouTube Player Logo" src="https://i.imgur.com/h4x3o5k.jpg" style="height: auto; max-width:100%;" />
77
</a>
88
</p>
99

1010
# About Player
11-
[![Version](https://img.shields.io/badge/Current%20version-v2.3.3-brightgreen.svg?style=flat)](https://github.com/quead/angular2-yt-player)
11+
[![Version](https://img.shields.io/badge/Current%20version-v2.4-brightgreen.svg?style=flat)](https://github.com/quead/angular-youtube-player)
1212

13-
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/quead/angular2-yt-player/master/LICENSE)
14-
[![GitHub forks](https://img.shields.io/github/forks/quead/angular2-yt-player.svg)](https://github.com/quead/angular2-yt-player/network)
15-
[![GitHub stars](https://img.shields.io/github/stars/quead/angular2-yt-player.svg)](https://github.com/quead/angular2-yt-player/stargazers)
13+
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/quead/angular-youtube-player/master/LICENSE)
14+
[![GitHub forks](https://img.shields.io/github/forks/quead/angular-youtube-player.svg)](https://github.com/quead/angular-youtube-player/network)
15+
[![GitHub stars](https://img.shields.io/github/stars/quead/angular-youtube-player.svg)](https://github.com/quead/angular-youtube-player/stargazers)
1616

17-
This is a simple youtube web player and desktop player based on [angular-cli](https://github.com/angular/angular-cli "Angular Cli") 7.0.3, [@angular/fire](https://github.com/angular/angularfire2), [ngx-youtube-player](https://github.com/orizens/ng2-youtube-player "ngx youtube player") 6.0.0 (used for youtube iFrame API), SCSS (CSS3), HTML5.
17+
This is a simple youtube web player based on [angular-cli](https://github.com/angular/angular-cli "Angular Cli"), [ngx-youtube-player](https://github.com/orizens/ng2-youtube-player "ngx youtube player"), [ngx-socket-io](https://github.com/rodgc/ngx-socket-io "ngx socket.io"), [ng2-dragula](https://github.com/valor-software/ng2-dragula "ng2 dragula").
1818

1919
This player is compatible only with Chrome/webkit browsers.
2020

2121
*The project status is beta.*
2222

23-
## Usage
23+
## How to use
2424

2525
**For Angular and Typescript Development**
2626
1. Install [NodeJS 8.11.3+](https://nodejs.org/en/download/ "Node JS Download")
@@ -38,7 +38,9 @@ This player is compatible only with Chrome/webkit browsers.
3838

3939
5. Add your youtube api key in settings.json or in the app
4040

41-
6. To make available firebase (for session feature upload/download) update `environments.prod.ts` and `environments.ts`
41+
6. To connect to your [server](https://github.com/quead/angular-youtube-server "Angular youtube server")
42+
43+
You must change inside **app.modules.ts** your path to your server.
4244

4345
**For SASS development**
4446

@@ -53,6 +55,14 @@ This player is compatible only with Chrome/webkit browsers.
5355
4. Edit files from src/assets/scss
5456

5557
## Changelog
58+
Angular YouTube Player 2.4
59+
- Switched from firebase to json through socket.io and private server
60+
- Responsive layout
61+
- Sync player in session
62+
- Rooms: join/leave room by unique id
63+
- Playlist is no more auto populated when is empty
64+
- You can't export/import anymore from .JSON file
65+
5666
Angular YouTube Player 2.3.3
5767
- Fixed bugs after refactoring
5868
- Added session key for playlist which you can upload to cloud and download from cloud (integrated with firebase)
@@ -149,7 +159,6 @@ Angular YouTube Player 1.1
149159
- *Show/hide debugging features*
150160
- *Show/hide thumbnails in search*
151161

152-
153162
Angular YouTube Player 1.0.2
154163
- Change volume on your video
155164
- Related videos
@@ -167,17 +176,12 @@ Angular YouTube Player 1.0.0
167176
- *Room chat **(unversioned)***
168177

169178
#### Roadmap to 3.0
170-
- Responsive layout **(in v2.4)**
171-
- Sync player between session **(in v2.4)**
172-
- Keep your settings in cloud **(in v2.8)**
173-
- Integrating YouTube subscriptions/playlist **(in v2.9)**
174-
175-
**Rooms**
176-
- *Create room where you can watch videos with others in sync by sharing the room link **(in v2.7)***
177179
- *Set private/public room **(in v2.7)***
178-
- *List of public rooms **(in v2.8)***
180+
- *List of public rooms **(in v2.9)***
179181
- *Room moderators which can add videos, kick roommates, mute roommates, rename room title and description **(in v2.9)***
180182

183+
#### Roadmap to 4.0
184+
- Integrating YouTube account subscriptions/playlist **(in v3.0)**
181185

182186
#### Removed features
183187
- Global hotkeys for application in desktop (play/pause/next/prev, for keyboards with media buttons)

package.json

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-youtube-player",
3-
"version": "2.3.3",
3+
"version": "2.4.0",
44
"license": "MIT",
55
"scripts": {
66
"ng": "ng",
@@ -12,45 +12,45 @@
1212
},
1313
"private": true,
1414
"dependencies": {
15-
"@angular/animations": "^7.0.1",
16-
"@angular/common": "^7.0.1",
17-
"@angular/compiler": "^7.0.1",
18-
"@angular/core": "^7.0.1",
19-
"@angular/fire": "^5.1.0",
20-
"@angular/forms": "^7.0.1",
21-
"@angular/http": "^7.0.1",
22-
"@angular/platform-browser": "^7.0.1",
23-
"@angular/platform-browser-dynamic": "^7.0.1",
24-
"@angular/router": "^7.0.1",
25-
"@ngu/carousel": "^1.5.4",
15+
"@angular/animations": "^7.2.10",
16+
"@angular/common": "^7.2.10",
17+
"@angular/compiler": "^7.2.10",
18+
"@angular/core": "^7.2.10",
19+
"@angular/forms": "^7.2.10",
20+
"@angular/http": "^7.2.10",
21+
"@angular/platform-browser": "^7.2.10",
22+
"@angular/platform-browser-dynamic": "^7.2.10",
23+
"@angular/router": "^7.2.10",
24+
"@ngu/carousel": "^1.5.5",
2625
"core-js": "^2.5.7",
27-
"firebase": "^5.5.5",
2826
"hammerjs": "^2.0.8",
2927
"ng2-dragula": "^2.1.0",
28+
"ngx-socket-io": "^2.1.1",
3029
"ngx-youtube-player": "^6.0.0",
31-
"rxjs": "^6.3.3",
32-
"rxjs-compat": "^6.2.1",
33-
"zone.js": "^0.8.26"
30+
"rxjs": "^6.4.0",
31+
"rxjs-compat": "^6.4.0",
32+
"tslib": "^1.9.0",
33+
"zone.js": "^0.8.29"
3434
},
3535
"devDependencies": {
36-
"@angular-devkit/build-angular": "~0.10.0",
37-
"@angular/cli": "~7.0.3",
38-
"@angular/compiler-cli": "~7.0.0",
39-
"@angular/language-service": "~7.0.0",
40-
"@types/node": "~8.9.4",
36+
"@angular-devkit/build-angular": "~0.13.0",
37+
"@angular/cli": "~7.3.6",
38+
"@angular/compiler-cli": "~7.2.10",
39+
"@angular/language-service": "~7.2.10",
4140
"@types/jasmine": "~2.8.8",
4241
"@types/jasminewd2": "~2.0.3",
42+
"@types/node": "~8.9.4",
4343
"codelyzer": "~4.5.0",
4444
"jasmine-core": "~2.99.1",
4545
"jasmine-spec-reporter": "~4.2.1",
46-
"karma": "~3.0.0",
46+
"karma": "^4.0.1",
4747
"karma-chrome-launcher": "~2.2.0",
4848
"karma-coverage-istanbul-reporter": "~2.0.1",
4949
"karma-jasmine": "~1.1.2",
5050
"karma-jasmine-html-reporter": "^0.2.2",
5151
"protractor": "~5.4.0",
5252
"ts-node": "~7.0.0",
5353
"tslint": "~5.11.0",
54-
"typescript": "~3.1.1"
54+
"typescript": "~3.2.4"
5555
}
5656
}

src/app/app.component.html

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,17 @@
2121
<app-related></app-related>
2222
</div>
2323
<div class="col col-3">
24+
<app-room></app-room>
2425
<app-playlist></app-playlist>
2526
</div>
2627
<div class="col col-5">
2728
<div class="app app-feed">
2829
<router-outlet></router-outlet>
2930
</div>
30-
<div [ngClass]="{'active': shared.notify.enabled }" class="notif notif-primary">
31+
<div [ngClass]="{'active': notify.defaults.enabled }" class="notif notif-primary">
3132
<span class="fa fa-cog fa-spin fa-fw"></span>
32-
<p>{{ shared.notify.message }}</p>
33+
<p>{{ notify.defaults.message }}</p>
3334
</div>
3435
</div>
3536
</div>
36-
<div id="mobile-unavailable">
37-
The app is not ready for mobile/tablet, soon...
38-
</div>
3937
</div>

src/app/app.component.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Component, ElementRef, ViewChild, OnInit } from '@angular/core';
22
import { SharedService } from './services/shared.service';
3+
import { NotifyService } from './services/notify.service';
34
import { GlobalsService } from './services/globals.service';
45
import { PlaylistControlService } from './services/playlist-control.service';
56

@@ -16,19 +17,11 @@ export class AppComponent implements OnInit {
1617
public shared: SharedService,
1718
public globals: GlobalsService,
1819
public playlistCTRL: PlaylistControlService,
20+
public notify: NotifyService
1921
) {
20-
localStorage.removeItem('firebase:previous_websocket_failure');
2122
}
2223

2324
ngOnInit() {
2425
this.globals.videoItemIDvalue = this.videoItemIDvalue;
25-
this.shared.preventOldSettings();
26-
}
27-
28-
// ---------------- Update app ----------------
29-
setApp() {
30-
this.shared.initFeed().then(() => {
31-
this.playlistCTRL.fillPlaylist();
32-
});
3326
}
3427
}

src/app/app.module.ts

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { HttpClientModule } from '@angular/common/http';
44
import { ReactiveFormsModule } from '@angular/forms';
55
import { FormsModule } from '@angular/forms';
66
import { AppRoutingModule } from './app.router';
7-
7+
import { SocketIoModule, SocketIoConfig } from 'ngx-socket-io';
88
import { DragulaModule } from 'ng2-dragula';
99
import { NguCarouselModule, NguCarouselConfig, NguCarousel } from '@ngu/carousel';
1010

@@ -23,25 +23,23 @@ import { PlayerComponent } from './components/player/player.component';
2323
import { YoutubePlayerModule } from 'ngx-youtube-player';
2424
import { CategoryComponent } from './components/category/category.component';
2525

26-
// Firebase
27-
import { AngularFireModule } from '@angular/fire';
28-
import { AngularFireDatabase } from '@angular/fire/database';
29-
30-
import { environment } from '../environments/environment';
3126
import { PlaylistComponent } from './components/playlist/playlist.component';
3227
import { RelatedComponent } from './components/related/related.component';
28+
import { RoomComponent } from './components/room/room.component';
29+
30+
const config: SocketIoConfig = { url: 'https://habarnam.io:8888/', options: {} };
3331

3432
@NgModule({
3533
imports: [
36-
AngularFireModule.initializeApp(environment.firebase, 'angular-yt-player-quead'),
3734
BrowserModule,
3835
HttpClientModule,
3936
ReactiveFormsModule,
4037
YoutubePlayerModule,
4138
FormsModule,
4239
DragulaModule.forRoot(),
4340
NguCarouselModule,
44-
AppRoutingModule
41+
AppRoutingModule,
42+
SocketIoModule.forRoot(config)
4543
],
4644
declarations: [
4745
AppComponent,
@@ -52,7 +50,8 @@ import { RelatedComponent } from './components/related/related.component';
5250
CategoryComponent,
5351
PlayerComponent,
5452
PlaylistComponent,
55-
RelatedComponent
53+
RelatedComponent,
54+
RoomComponent
5655
],
5756
bootstrap: [ AppComponent ],
5857
providers: [
@@ -63,7 +62,6 @@ import { RelatedComponent } from './components/related/related.component';
6362
PlaylistControlService,
6463
SharedService,
6564
GlobalsService,
66-
AngularFireDatabase,
6765
NguCarouselConfig,
6866
NguCarousel
6967
]

src/app/components/category/category.component.html

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ <h2>Trending</h2>
1313
</div>
1414
<div class="feed-video-list video-list" [ngClass]="{'grid-list': !globals.listGrid }">
1515
<ng-container *ngIf="loading">
16-
<div *ngFor="let i of [1,2,3,4,5,6,8,9,10]" class="loading-feed-list loading-anim"></div>
16+
<div *ngFor="let i of [0,1,2,3,4,5,6,8,9,10]" class="loading-feed-list loading-anim"></div>
1717
</ng-container>
1818
<ng-container *ngIf="!loading">
1919
<div *ngFor="let feedVideo of globals.feedVideos; let i = index" [ngClass]="{'hidden-thumbnails': !globals.thumbnails }" [attr.data-index]="i" class="video-item">
@@ -29,17 +29,22 @@ <h2>Trending</h2>
2929
</div>
3030
</div>
3131
</div>
32-
<div class="video-item-settings">
33-
<button class="video-item-play" (click)="onClickVideo(i, 0)">
34-
<span class="fa fa-play"></span>
35-
</button>
36-
<button class="video-item-play" (click)="shared.onCopyVideoItemLink(i, 0)">
32+
<div class="video-item-settings" *ngIf="!globals.isTempSessionActive">
33+
<button class="video-item-play" (click)="onClickVideo(i, 0)">
34+
<span class="fa fa-play"></span>
35+
</button>
36+
<button class="video-item-play" (click)="shared.onCopyVideoItemLink(i, 0)">
37+
<span class="fa fa-share-alt"></span>
38+
</button>
39+
<button class="video-item-add" (click)="playlist.addPlaylistItem(i, 0)">
40+
<span class="fa fa-plus"></span>
41+
</button>
42+
</div>
43+
<div class="video-item-settings" *ngIf="globals.isTempSessionActive">
44+
<button class="video-item-play" (click)="shared.onCopyVideoItemLink(i, 0)">
3745
<span class="fa fa-share-alt"></span>
3846
</button>
39-
<button class="video-item-add" (click)="playlist.addPlaylistItem(i, 0)">
40-
<span class="fa fa-plus"></span>
41-
</button>
42-
</div>
47+
</div>
4348
</div>
4449
</ng-container>
4550
</div>

src/app/components/category/category.component.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,7 @@ export class CategoryComponent implements OnInit {
3939
this.globals.currentCategory = category;
4040
this.getCategories();
4141
} else {
42-
this.globals.currentCategory = 'all';
43-
this.globals.feedVideos = null;
44-
this.shared.initFeed().then(() => {
45-
this.loading = false;
46-
});
42+
this.resetCategories();
4743
}
4844
}
4945

0 commit comments

Comments
 (0)