dev: player script for js
Showing
6 changed files
with
16 additions
and
19 deletions
... | @@ -87,25 +87,25 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f | ... | @@ -87,25 +87,25 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f |
87 | //notes player time starts | 87 | //notes player time starts |
88 | 88 | ||
89 | var iframe = document.querySelector('iframe'); | 89 | var iframe = document.querySelector('iframe'); |
90 | console.log(iframe); | 90 | // console.log(iframe); |
91 | var player = new Vimeo.Player(iframe); | 91 | var player = new Vimeo.Player(iframe); |
92 | console.log(player); | 92 | // console.log(player); |
93 | var time; | 93 | var time; |
94 | player.getCurrentTime().then(function(seconds) { | 94 | player.getCurrentTime().then(function(seconds) { |
95 | 95 | ||
96 | time=seconds; | 96 | time=seconds; |
97 | }) | 97 | }) |
98 | console.log(time); | 98 | // |
99 | 99 | ||
100 | params['sesskey'] = M.cfg.sesskey; | 100 | params['sesskey'] = M.cfg.sesskey; |
101 | var str = '</br></br><font color="green">newly You have taken notes at '; | 101 | var str = '</br></br><font color="green">newly You have taken notes at '; |
102 | // str +=time; | 102 | console.log(time); |
103 | str +=time; | ||
103 | str +=" secs in this video.</font>"; | 104 | str +=" secs in this video.</font>"; |
104 | // var result = str.fontcolor("green"); | 105 | // var result = str.fontcolor("green"); |
105 | params['notestime'] = str; | 106 | params['notestime'] = str; |
106 | 107 | ||
107 | player.pause().then(function() { | 108 | player.pause().then(function() { |
108 | alert('the video was paused'); | ||
109 | }) | 109 | }) |
110 | 110 | ||
111 | //notes player time ends | 111 | //notes player time ends | ... | ... |
1 | define(["jquery"],function(e){return{init:function(){var n=e(location).attr("href");e("document").ready(function(){if(n.includes("/mod/page/view.php")){var t=document.querySelector("iframe"),i=new Vimeo.Player(t);e("#mynotepencil").click(function(){var e;i.getCurrentTime().then(function(n){e=n}),setTimeout(function(){var n="<div> You have taken notes at ";n+=e;(n+=" in this video.</div>").fontcolor("green")},1e3)}),i.pause().then(function(){alert("the video was paused")})}})}}}); | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | define(["jquery"],function(e){return{init:function(){var n=e(location).attr("href");e("document").ready(function(){if(n.includes("/mod/page/view.php")){var e=document.querySelector("iframe");new Vimeo.Player(e)}})}}}); | ||
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
... | @@ -87,25 +87,25 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f | ... | @@ -87,25 +87,25 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f |
87 | //notes player time starts | 87 | //notes player time starts |
88 | 88 | ||
89 | var iframe = document.querySelector('iframe'); | 89 | var iframe = document.querySelector('iframe'); |
90 | console.log(iframe); | 90 | // console.log(iframe); |
91 | var player = new Vimeo.Player(iframe); | 91 | var player = new Vimeo.Player(iframe); |
92 | console.log(player); | 92 | // console.log(player); |
93 | var time; | 93 | var time; |
94 | player.getCurrentTime().then(function(seconds) { | 94 | player.getCurrentTime().then(function(seconds) { |
95 | 95 | ||
96 | time=seconds; | 96 | time=seconds; |
97 | }) | 97 | }) |
98 | console.log(time); | 98 | // |
99 | 99 | ||
100 | params['sesskey'] = M.cfg.sesskey; | 100 | params['sesskey'] = M.cfg.sesskey; |
101 | var str = '</br></br><font color="green">newly You have taken notes at '; | 101 | var str = '</br></br><font color="green">newly You have taken notes at '; |
102 | // str +=time; | 102 | console.log(time); |
103 | str +=time; | ||
103 | str +=" secs in this video.</font>"; | 104 | str +=" secs in this video.</font>"; |
104 | // var result = str.fontcolor("green"); | 105 | // var result = str.fontcolor("green"); |
105 | params['notestime'] = str; | 106 | params['notestime'] = str; |
106 | 107 | ||
107 | player.pause().then(function() { | 108 | player.pause().then(function() { |
108 | alert('the video was paused'); | ||
109 | }) | 109 | }) |
110 | 110 | ||
111 | //notes player time ends | 111 | //notes player time ends | ... | ... |
... | @@ -13,7 +13,7 @@ define(['jquery'], function($) { | ... | @@ -13,7 +13,7 @@ define(['jquery'], function($) { |
13 | var player = new Vimeo.Player(iframe); | 13 | var player = new Vimeo.Player(iframe); |
14 | 14 | ||
15 | 15 | ||
16 | $('#mynotepencil').click(function(){ | 16 | /* $('#mynotepencil').click(function(){ |
17 | 17 | ||
18 | var time; | 18 | var time; |
19 | 19 | ||
... | @@ -32,11 +32,9 @@ define(['jquery'], function($) { | ... | @@ -32,11 +32,9 @@ define(['jquery'], function($) { |
32 | 32 | ||
33 | }, 1000); | 33 | }, 1000); |
34 | 34 | ||
35 | }); | 35 | });*/ |
36 | 36 | ||
37 | player.pause().then(function() { | 37 | |
38 | alert('the video was paused'); | ||
39 | }) | ||
40 | 38 | ||
41 | 39 | ||
42 | } | 40 | } | ... | ... |
... | @@ -150,7 +150,6 @@ class block_mynotes_manager { | ... | @@ -150,7 +150,6 @@ class block_mynotes_manager { |
150 | public function addmynote($context, $contextarea, $course, $content,$timer, $format = FORMAT_MOODLE) { | 150 | public function addmynote($context, $contextarea, $course, $content,$timer, $format = FORMAT_MOODLE) { |
151 | global $CFG, $DB, $USER, $OUTPUT; | 151 | global $CFG, $DB, $USER, $OUTPUT; |
152 | $content=$content.$timer; | 152 | $content=$content.$timer; |
153 | // print_r($content); | ||
154 | $newnote = new stdClass; | 153 | $newnote = new stdClass; |
155 | $newnote->contextid = $context->id; | 154 | $newnote->contextid = $context->id; |
156 | $newnote->contextarea = $contextarea; | 155 | $newnote->contextarea = $contextarea; | ... | ... |
... | @@ -65,8 +65,8 @@ echo $OUTPUT->header(); //...send headers | ... | @@ -65,8 +65,8 @@ echo $OUTPUT->header(); //...send headers |
65 | switch ($action) { | 65 | switch ($action) { |
66 | case 'add': | 66 | case 'add': |
67 | $content = optional_param('content', '', PARAM_RAW); | 67 | $content = optional_param('content', '', PARAM_RAW); |
68 | $timer = optional_param('notestime', 0, PARAM_TEXT); | 68 | $timer = optional_param('notestime', '', PARAM_TEXT); |
69 | print_r($timer); | 69 | |
70 | $manager = new block_mynotes_manager(); | 70 | $manager = new block_mynotes_manager(); |
71 | if ($note = $manager->addmynote($context, $contextarea, $course, $content,$timer)) { | 71 | if ($note = $manager->addmynote($context, $contextarea, $course, $content,$timer)) { |
72 | $options = new stdClass(); | 72 | $options = new stdClass(); | ... | ... |
-
Please register or sign in to post a comment