Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
verona-modules-aspect
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IQB
verona-modules-aspect
Commits
2875a4fe
Commit
2875a4fe
authored
3 years ago
by
jojohoch
Browse files
Options
Downloads
Patches
Plain Diff
[player] Implement `vopGetStateRequest` subscription
parent
1dcfad9c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
projects/player/src/app/components/player-state.component.ts
+13
-1
13 additions, 1 deletion
projects/player/src/app/components/player-state.component.ts
projects/player/src/app/services/verona-subscription.service.ts
+10
-2
10 additions, 2 deletions
...ts/player/src/app/services/verona-subscription.service.ts
with
23 additions
and
3 deletions
projects/player/src/app/components/player-state.component.ts
+
13
−
1
View file @
2875a4fe
...
@@ -8,7 +8,7 @@ import { UnitPage } from '../../../../common/unit';
...
@@ -8,7 +8,7 @@ import { UnitPage } from '../../../../common/unit';
import
{
VeronaSubscriptionService
}
from
'
../services/verona-subscription.service
'
;
import
{
VeronaSubscriptionService
}
from
'
../services/verona-subscription.service
'
;
import
{
import
{
PlayerState
,
PlayerState
,
RunningState
,
VopContinueCommand
,
VopPageNavigationCommand
,
VopStopCommand
RunningState
,
VopContinueCommand
,
VopGetStateRequest
,
VopPageNavigationCommand
,
VopStopCommand
}
from
'
../models/verona
'
;
}
from
'
../models/verona
'
;
import
{
VeronaPostService
}
from
'
../services/verona-post.service
'
;
import
{
VeronaPostService
}
from
'
../services/verona-post.service
'
;
...
@@ -59,6 +59,9 @@ export class PlayerStateComponent implements OnInit, OnDestroy {
...
@@ -59,6 +59,9 @@ export class PlayerStateComponent implements OnInit, OnDestroy {
this
.
veronaSubscriptionService
.
vopStopCommand
this
.
veronaSubscriptionService
.
vopStopCommand
.
pipe
(
takeUntil
(
this
.
ngUnsubscribe
))
.
pipe
(
takeUntil
(
this
.
ngUnsubscribe
))
.
subscribe
((
message
:
VopStopCommand
):
void
=>
this
.
onStop
(
message
));
.
subscribe
((
message
:
VopStopCommand
):
void
=>
this
.
onStop
(
message
));
this
.
veronaSubscriptionService
.
vopGetStateRequest
.
pipe
(
takeUntil
(
this
.
ngUnsubscribe
))
.
subscribe
((
message
:
VopGetStateRequest
):
void
=>
this
.
onGetStateRequest
(
message
));
}
}
onSelectedIndexChange
():
void
{
onSelectedIndexChange
():
void
{
...
@@ -79,6 +82,15 @@ export class PlayerStateComponent implements OnInit, OnDestroy {
...
@@ -79,6 +82,15 @@ export class PlayerStateComponent implements OnInit, OnDestroy {
this
.
sendVopStateChangedNotification
();
this
.
sendVopStateChangedNotification
();
}
}
private
onGetStateRequest
(
message
:
VopGetStateRequest
):
void
{
// eslint-disable-next-line no-console
console
.
log
(
'
player: onGetStateRequest
'
,
message
);
if
(
message
.
stop
)
{
this
.
running
=
false
;
}
this
.
sendVopStateChangedNotification
();
}
private
onPageNavigation
(
message
:
VopPageNavigationCommand
):
void
{
private
onPageNavigation
(
message
:
VopPageNavigationCommand
):
void
{
// eslint-disable-next-line no-console
// eslint-disable-next-line no-console
console
.
log
(
'
player: onPageNavigation
'
,
message
);
console
.
log
(
'
player: onPageNavigation
'
,
message
);
...
...
This diff is collapsed.
Click to expand it.
projects/player/src/app/services/verona-subscription.service.ts
+
10
−
2
View file @
2875a4fe
import
{
Injectable
}
from
'
@angular/core
'
;
import
{
Injectable
}
from
'
@angular/core
'
;
import
{
fromEvent
,
Observable
,
Subject
}
from
'
rxjs
'
;
import
{
fromEvent
,
Observable
,
Subject
}
from
'
rxjs
'
;
import
{
import
{
VopContinueCommand
,
VopContinueCommand
,
VopGetStateRequest
,
VopMessage
,
VopMessage
,
VopNavigationDeniedNotification
,
VopNavigationDeniedNotification
,
VopPageNavigationCommand
,
VopPageNavigationCommand
,
...
@@ -18,6 +18,7 @@ export class VeronaSubscriptionService {
...
@@ -18,6 +18,7 @@ export class VeronaSubscriptionService {
private
_vopPageNavigationCommand
=
new
Subject
<
VopPageNavigationCommand
>
();
private
_vopPageNavigationCommand
=
new
Subject
<
VopPageNavigationCommand
>
();
private
_vopStopCommand
=
new
Subject
<
VopStopCommand
>
();
private
_vopStopCommand
=
new
Subject
<
VopStopCommand
>
();
private
_vopContinueCommand
=
new
Subject
<
VopContinueCommand
>
();
private
_vopContinueCommand
=
new
Subject
<
VopContinueCommand
>
();
private
_vopGetStateRequest
=
new
Subject
<
VopGetStateRequest
>
();
constructor
()
{
constructor
()
{
fromEvent
(
window
,
'
message
'
)
fromEvent
(
window
,
'
message
'
)
...
@@ -39,7 +40,6 @@ export class VeronaSubscriptionService {
...
@@ -39,7 +40,6 @@ export class VeronaSubscriptionService {
console
.
log
(
'
player: _vopNavigationDeniedNotification
'
,
messageData
);
console
.
log
(
'
player: _vopNavigationDeniedNotification
'
,
messageData
);
this
.
_vopNavigationDeniedNotification
.
next
(
messageData
);
this
.
_vopNavigationDeniedNotification
.
next
(
messageData
);
break
;
break
;
// TODO
case
'
vopPageNavigationCommand
'
:
case
'
vopPageNavigationCommand
'
:
// eslint-disable-next-line no-console
// eslint-disable-next-line no-console
console
.
log
(
'
player: _vopPageNavigationCommand
'
,
messageData
);
console
.
log
(
'
player: _vopPageNavigationCommand
'
,
messageData
);
...
@@ -56,6 +56,10 @@ export class VeronaSubscriptionService {
...
@@ -56,6 +56,10 @@ export class VeronaSubscriptionService {
this
.
_vopContinueCommand
.
next
(
messageData
);
this
.
_vopContinueCommand
.
next
(
messageData
);
break
;
break
;
case
'
vopGetStateRequest
'
:
case
'
vopGetStateRequest
'
:
// eslint-disable-next-line no-console
console
.
log
(
'
player: _vopGetStateRequest
'
,
messageData
);
this
.
_vopGetStateRequest
.
next
(
messageData
);
break
;
default
:
default
:
// eslint-disable-next-line no-console
// eslint-disable-next-line no-console
console
.
warn
(
`player: got message of unknown type
${
messageData
.
type
}
`
);
console
.
warn
(
`player: got message of unknown type
${
messageData
.
type
}
`
);
...
@@ -81,4 +85,8 @@ export class VeronaSubscriptionService {
...
@@ -81,4 +85,8 @@ export class VeronaSubscriptionService {
get
vopContinueCommand
():
Observable
<
VopContinueCommand
>
{
get
vopContinueCommand
():
Observable
<
VopContinueCommand
>
{
return
this
.
_vopContinueCommand
.
asObservable
();
return
this
.
_vopContinueCommand
.
asObservable
();
}
}
get
vopGetStateRequest
():
Observable
<
VopGetStateRequest
>
{
return
this
.
_vopGetStateRequest
.
asObservable
();
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment