File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
src/components/VideoTutorialButton Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,32 @@ export default class VideoTutorialButton extends Component {
13
13
this . state = {
14
14
videoTutorialModal : null
15
15
} ;
16
+ this . dispatchOnStartEvent = this . dispatchOnStartEvent . bind ( this ) ;
17
+ this . dispatchOnProgressEvent = this . dispatchOnProgressEvent . bind ( this ) ;
18
+ }
19
+
20
+ dispatchOnStartEvent ( ) {
21
+ back4AppNavigation && back4AppNavigation . onStartDatabaseBrowserVideoEvent ( ) ;
22
+ this . dispatched = { } ;
23
+ }
24
+
25
+ dispatchOnFinishEvent ( ) {
26
+ back4AppNavigation && back4AppNavigation . onFinishDatabaseBrowserVideoEvent ( ) ;
27
+ }
28
+
29
+ dispatchOnProgressEvent ( { played } ) {
30
+ if ( this . dispatched ) {
31
+ if ( ! this . dispatched [ 75 ] && played >= 0.75 ) {
32
+ back4AppNavigation && back4AppNavigation . onThreeQuartersDatabaseBrowserVideoEvent ( ) ;
33
+ this . dispatched [ 75 ] = true ;
34
+ } else if ( ! this . dispatched [ 50 ] && played >= 0.5 ) {
35
+ back4AppNavigation && back4AppNavigation . onHalfDatabaseBrowserVideoEvent ( ) ;
36
+ this . dispatched [ 50 ] = true ;
37
+ } else if ( ! this . dispatched [ 25 ] && played >= 0.25 ) {
38
+ back4AppNavigation && back4AppNavigation . onQuarterDatabaseBrowserVideoEvent ( ) ;
39
+ this . dispatched [ 25 ] = true ;
40
+ }
41
+ }
16
42
}
17
43
18
44
componentWillMount ( ) {
@@ -38,6 +64,9 @@ export default class VideoTutorialButton extends Component {
38
64
controls
39
65
width = "100%"
40
66
height = "100%"
67
+ onStart = { this . dispatchOnStartEvent }
68
+ onEnded = { this . dispatchOnFinishEvent }
69
+ onProgress = { this . dispatchOnProgressEvent }
41
70
/>
42
71
</ div >
43
72
</ Popover >
You can’t perform that action at this time.
0 commit comments