changes in vimeo player ajax call
Showing
4 changed files
with
65 additions
and
57 deletions
... | @@ -73,17 +73,11 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f | ... | @@ -73,17 +73,11 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f |
73 | request: function(args) { | 73 | request: function(args) { |
74 | var params = {}; | 74 | var params = {}; |
75 | var scope = this; | 75 | var scope = this; |
76 | if (args['scope']) { | 76 | |
77 | scope = args['scope']; | 77 | |
78 | } | 78 | |
79 | params['contextarea'] = scope.currenttab.replace(CONFIG.prefix, ''); | 79 | |
80 | params['contextarea'] = params['contextarea'].replace('#', ''); | 80 | |
81 | if (args.params) { | ||
82 | for (i in args.params) { | ||
83 | params[i] = args.params[i]; | ||
84 | } | ||
85 | } | ||
86 | params['sesskey'] = M.cfg.sesskey; | ||
87 | var url= $(location).attr('href'); | 81 | var url= $(location).attr('href'); |
88 | //notes player time starts | 82 | //notes player time starts |
89 | $('document').ready(function(){ | 83 | $('document').ready(function(){ |
... | @@ -92,7 +86,6 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f | ... | @@ -92,7 +86,6 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f |
92 | var iframe = document.querySelector('iframe'); | 86 | var iframe = document.querySelector('iframe'); |
93 | // console.log(iframe); | 87 | // console.log(iframe); |
94 | var player = new Vimeo.Player(iframe); | 88 | var player = new Vimeo.Player(iframe); |
95 | console.log("player"); | ||
96 | console.log(player); | 89 | console.log(player); |
97 | player.pause().then(function() { | 90 | player.pause().then(function() { |
98 | }) | 91 | }) |
... | @@ -108,14 +101,12 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f | ... | @@ -108,14 +101,12 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f |
108 | $.ajax({ | 101 | $.ajax({ |
109 | url: rootPath + "/blocks/mynotes/timerajax.php", | 102 | url: rootPath + "/blocks/mynotes/timerajax.php", |
110 | type: 'POST', | 103 | type: 'POST', |
111 | data: { notestime: str}, | 104 | data: {notestime: 'pollathavan'}, |
112 | success: function(data){ | 105 | success: function(data){ |
113 | |||
114 | 106 | ||
115 | } | 107 | } |
116 | }); | 108 | }); |
117 | 109 | ||
118 | |||
119 | // if ( url.includes('/mod/page/view.php') ){ | 110 | // if ( url.includes('/mod/page/view.php') ){ |
120 | 111 | ||
121 | $.ajax({url: rootPath + "/blocks/mynotes/timerajax.php", success: function(result){ | 112 | $.ajax({url: rootPath + "/blocks/mynotes/timerajax.php", success: function(result){ |
... | @@ -132,26 +123,37 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f | ... | @@ -132,26 +123,37 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f |
132 | // } | 123 | // } |
133 | 124 | ||
134 | 125 | ||
135 | |||
136 | // params['notestime'] = str; | 126 | // params['notestime'] = str; |
137 | 127 | ||
138 | // console.log(str); | 128 | // console.log(str); |
139 | }) | 129 | }) |
140 | // | 130 | // |
141 | 131 | ||
142 | |||
143 | |||
144 | |||
145 | |||
146 | |||
147 | // var result = str.fontcolor("green"); | 132 | // var result = str.fontcolor("green"); |
148 | |||
149 | |||
150 | |||
151 | } | 133 | } |
152 | }); | 134 | }); |
153 | //notes player time ends | 135 | //notes player time ends |
154 | 136 | ||
137 | |||
138 | |||
139 | |||
140 | |||
141 | |||
142 | |||
143 | |||
144 | if (args['scope']) { | ||
145 | scope = args['scope']; | ||
146 | } | ||
147 | params['contextarea'] = scope.currenttab.replace(CONFIG.prefix, ''); | ||
148 | params['contextarea'] = params['contextarea'].replace('#', ''); | ||
149 | if (args.params) { | ||
150 | for (i in args.params) { | ||
151 | params[i] = args.params[i]; | ||
152 | } | ||
153 | } | ||
154 | params['sesskey'] = M.cfg.sesskey; | ||
155 | |||
156 | |||
155 | var cfg = { | 157 | var cfg = { |
156 | method: 'POST', | 158 | method: 'POST', |
157 | on: { | 159 | on: { | ... | ... |
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 i=document.querySelector("iframe"),t=new Vimeo.Player(i);console.log(t),e("#mynotepencil").click(function(){t.getCurrentTime().then(function(e){})})}})}}}); | ||
... | \ 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 t=document.querySelector("iframe"),i=new Vimeo.Player(t);console.log(i),e("#mynotepencil").click(function(){setTimeout(function(){i.getCurrentTime().then(function(e){})},1e3)})}})}}}); | ||
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
... | @@ -73,17 +73,11 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f | ... | @@ -73,17 +73,11 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f |
73 | request: function(args) { | 73 | request: function(args) { |
74 | var params = {}; | 74 | var params = {}; |
75 | var scope = this; | 75 | var scope = this; |
76 | if (args['scope']) { | 76 | |
77 | scope = args['scope']; | 77 | |
78 | } | 78 | |
79 | params['contextarea'] = scope.currenttab.replace(CONFIG.prefix, ''); | 79 | |
80 | params['contextarea'] = params['contextarea'].replace('#', ''); | 80 | |
81 | if (args.params) { | ||
82 | for (i in args.params) { | ||
83 | params[i] = args.params[i]; | ||
84 | } | ||
85 | } | ||
86 | params['sesskey'] = M.cfg.sesskey; | ||
87 | var url= $(location).attr('href'); | 81 | var url= $(location).attr('href'); |
88 | //notes player time starts | 82 | //notes player time starts |
89 | $('document').ready(function(){ | 83 | $('document').ready(function(){ |
... | @@ -92,7 +86,6 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f | ... | @@ -92,7 +86,6 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f |
92 | var iframe = document.querySelector('iframe'); | 86 | var iframe = document.querySelector('iframe'); |
93 | // console.log(iframe); | 87 | // console.log(iframe); |
94 | var player = new Vimeo.Player(iframe); | 88 | var player = new Vimeo.Player(iframe); |
95 | console.log("player"); | ||
96 | console.log(player); | 89 | console.log(player); |
97 | player.pause().then(function() { | 90 | player.pause().then(function() { |
98 | }) | 91 | }) |
... | @@ -108,14 +101,12 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f | ... | @@ -108,14 +101,12 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f |
108 | $.ajax({ | 101 | $.ajax({ |
109 | url: rootPath + "/blocks/mynotes/timerajax.php", | 102 | url: rootPath + "/blocks/mynotes/timerajax.php", |
110 | type: 'POST', | 103 | type: 'POST', |
111 | data: { notestime: str}, | 104 | data: {notestime: 'pollathavan'}, |
112 | success: function(data){ | 105 | success: function(data){ |
113 | |||
114 | 106 | ||
115 | } | 107 | } |
116 | }); | 108 | }); |
117 | 109 | ||
118 | |||
119 | // if ( url.includes('/mod/page/view.php') ){ | 110 | // if ( url.includes('/mod/page/view.php') ){ |
120 | 111 | ||
121 | $.ajax({url: rootPath + "/blocks/mynotes/timerajax.php", success: function(result){ | 112 | $.ajax({url: rootPath + "/blocks/mynotes/timerajax.php", success: function(result){ |
... | @@ -132,26 +123,37 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f | ... | @@ -132,26 +123,37 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f |
132 | // } | 123 | // } |
133 | 124 | ||
134 | 125 | ||
135 | |||
136 | // params['notestime'] = str; | 126 | // params['notestime'] = str; |
137 | 127 | ||
138 | // console.log(str); | 128 | // console.log(str); |
139 | }) | 129 | }) |
140 | // | 130 | // |
141 | 131 | ||
142 | |||
143 | |||
144 | |||
145 | |||
146 | |||
147 | // var result = str.fontcolor("green"); | 132 | // var result = str.fontcolor("green"); |
148 | |||
149 | |||
150 | |||
151 | } | 133 | } |
152 | }); | 134 | }); |
153 | //notes player time ends | 135 | //notes player time ends |
154 | 136 | ||
137 | |||
138 | |||
139 | |||
140 | |||
141 | |||
142 | |||
143 | |||
144 | if (args['scope']) { | ||
145 | scope = args['scope']; | ||
146 | } | ||
147 | params['contextarea'] = scope.currenttab.replace(CONFIG.prefix, ''); | ||
148 | params['contextarea'] = params['contextarea'].replace('#', ''); | ||
149 | if (args.params) { | ||
150 | for (i in args.params) { | ||
151 | params[i] = args.params[i]; | ||
152 | } | ||
153 | } | ||
154 | params['sesskey'] = M.cfg.sesskey; | ||
155 | |||
156 | |||
155 | var cfg = { | 157 | var cfg = { |
156 | method: 'POST', | 158 | method: 'POST', |
157 | on: { | 159 | on: { | ... | ... |
1 | <?php | 1 | <?php |
2 | require_once('/../../config.php'); | 2 | require_once('/../../config.php'); |
3 | require_once($CFG->dirroot.'/user/profile/lib.php'); | 3 | // require_once($CFG->dirroot.'/user/profile/lib.php'); |
4 | require_once($CFG->dirroot.'/course/lib.php'); | 4 | // require_once($CFG->dirroot.'/course/lib.php'); |
5 | require_once($CFG->dirroot . '/blocks/mynotes/lib.php'); | 5 | require_once($CFG->dirroot . '/blocks/mynotes/lib.php'); |
6 | global $USER,$DB; | 6 | global $USER,$DB; |
7 | 7 | ||
8 | if (!isloggedin()) { | 8 | // if (!isloggedin()) { |
9 | echo json_encode(array('error' => 'require_login')); | 9 | // echo json_encode(array('error' => 'require_login')); |
10 | die(); | 10 | // die(); |
11 | } | 11 | // } |
12 | 12 | ||
13 | $timertext = optional_param('notestime', '', PARAM_TEXT); | 13 | $timertext = optional_param('notestime', '', PARAM_TEXT); |
14 | 14 | ||
15 | // $myuser=profile_user_record($USER->id); | 15 | // $myuser=profile_user_record($USER->id); |
16 | 16 | ||
17 | if ($timertext){ | 17 | if ($timertext){ |
18 | 18 | ||
19 | echo json_encode($timertext); | 19 | echo $timertext; |
20 | 20 | ||
21 | } | 21 | } |
22 | else{ | ||
23 | |||
24 | echo "value fromrhere"; | ||
25 | } | ... | ... |
-
Please register or sign in to post a comment