diff --git a/services/web/public/coffee/directives/videoPlayState.coffee b/services/web/public/coffee/directives/videoPlayState.coffee new file mode 100644 index 0000000000..bd7e41e26c --- /dev/null +++ b/services/web/public/coffee/directives/videoPlayState.coffee @@ -0,0 +1,16 @@ +define [ + "base" +], (App) -> + App.directive "videoPlayState", ($parse) -> + return { + restrict: "A", + link: (scope, element, attrs) -> + videoDOMEl = element[0] + console.dir videoDOMEl + scope.$watch (() -> $parse(attrs.videoPlayState)(scope)), (shouldPlay) -> + if shouldPlay + videoDOMEl.currentTime = 0 + videoDOMEl.play() + else + videoDOMEl.pause() + } diff --git a/services/web/public/coffee/ide.coffee b/services/web/public/coffee/ide.coffee index 1ce6fdf0b9..0314e9ffd3 100644 --- a/services/web/public/coffee/ide.coffee +++ b/services/web/public/coffee/ide.coffee @@ -29,6 +29,7 @@ define [ "directives/stopPropagation" "directives/rightClick" "directives/expandableTextArea" + "directives/videoPlayState" "services/queued-http" "filters/formatDate" "main/event"