1b673064 by logesh

dev:changes in mynotes

1 parent 25c24732
1 define(["jquery"],function(n){return{init:function(){var i=n(location).attr("href");n("document").ready(function(){i.includes("/mod/hvp/view.php")&&console.log("this is inside hvp")})}}});
...\ No newline at end of file ...\ No newline at end of file
1 define(["jquery"],function(e){return{init:function(){var o=e(location).attr("href");e("document").ready(function(){if(o.includes("/mod/page/view.php")){var e=document.querySelector("iframe");console.log(e);var n=new Vimeo.Player(e);console.log(n),n.on("play",function(){console.log("played the video!")}),n.getCurrentTime().then(function(e){console.log(e)}),n.pause().then(function(){console.log("the video was paused")}),console.log("after player")}})}}});
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -6,9 +6,30 @@ define(['jquery'], function($) { ...@@ -6,9 +6,30 @@ define(['jquery'], function($) {
6 6
7 $('document').ready(function(){ 7 $('document').ready(function(){
8 8
9 if(url.includes('/mod/hvp/view.php')){ 9 if(url.includes('/mod/page/view.php')){
10 10
11 console.log("this is inside hvp"); 11 var iframe = document.querySelector('iframe');
12 console.log(iframe);
13 var player = new Vimeo.Player(iframe);
14 console.log(player);
15
16 player.on("play", function() {
17 console.log('played the video!');
18 });
19
20 player.getCurrentTime().then(function(seconds) {
21 // seconds = the current playback position
22 console.log(seconds);
23 })
24 player.pause().then(function() {
25 console.log('the video was paused');
26 })
27
28
29 /*.catch(function(error) {
30 // an error occurred
31 });*/
32 console.log("after player");
12 33
13 } 34 }
14 }); 35 });
......
...@@ -120,7 +120,11 @@ class block_mynotes extends block_base { ...@@ -120,7 +120,11 @@ class block_mynotes extends block_base {
120 'perpage' => $config->mynotesperpage, 120 'perpage' => $config->mynotesperpage,
121 ), 121 ),
122 ); 122 );
123
123 // $PAGE->requires->string_for_js('charactersleft', 'block_mynotes'); 124 // $PAGE->requires->string_for_js('charactersleft', 'block_mynotes');
125 // $PAGE->requires->js_call_amd('block_mynotes/player', 'init');
126 // $PAGE->requires->js('/blocks/mynotes/javascript/player.min.js');
127 // $PAGE->requires->js( new moodle_url($CFG->wwwroot . '/blocks/mynotes/javascript/player.min.js') );
124 $PAGE->requires->js_call_amd('block_mynotes/script', 'init'); 128 $PAGE->requires->js_call_amd('block_mynotes/script', 'init');
125 $PAGE->requires->string_for_js('notmorethan', 'block_mynotes'); 129 $PAGE->requires->string_for_js('notmorethan', 'block_mynotes');
126 $PAGE->requires->string_for_js('mynotes', 'block_mynotes'); 130 $PAGE->requires->string_for_js('mynotes', 'block_mynotes');
...@@ -136,5 +140,6 @@ class block_mynotes extends block_base { ...@@ -136,5 +140,6 @@ class block_mynotes extends block_base {
136 $PAGE->requires->string_for_js('mynotessavedundertab', 'block_mynotes'); 140 $PAGE->requires->string_for_js('mynotessavedundertab', 'block_mynotes');
137 $PAGE->requires->string_for_js('cancel', 'moodle'); 141 $PAGE->requires->string_for_js('cancel', 'moodle');
138 $this->page->requires->js_call_amd('block_mynotes/mynotesblock', 'init', $arguments); 142 $this->page->requires->js_call_amd('block_mynotes/mynotesblock', 'init', $arguments);
143
139 } 144 }
140 } 145 }
...\ No newline at end of file ...\ No newline at end of file
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!