mirror of
https://github.com/overleaf/overleaf.git
synced 2024-10-31 21:21:03 -04:00
16 lines
361 B
CoffeeScript
16 lines
361 B
CoffeeScript
|
define [
|
||
|
"base"
|
||
|
], (App) ->
|
||
|
App.directive "videoPlayState", ($parse) ->
|
||
|
return {
|
||
|
restrict: "A",
|
||
|
link: (scope, element, attrs) ->
|
||
|
videoDOMEl = element[0]
|
||
|
scope.$watch (() -> $parse(attrs.videoPlayState)(scope)), (shouldPlay) ->
|
||
|
if shouldPlay
|
||
|
videoDOMEl.currentTime = 0
|
||
|
videoDOMEl.play()
|
||
|
else
|
||
|
videoDOMEl.pause()
|
||
|
}
|