aaddd433 by logesh

changes in vimeo player ajax call

1 parent 6c86867b
......@@ -73,17 +73,11 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f
request: function(args) {
var params = {};
var scope = this;
if (args['scope']) {
scope = args['scope'];
}
params['contextarea'] = scope.currenttab.replace(CONFIG.prefix, '');
params['contextarea'] = params['contextarea'].replace('#', '');
if (args.params) {
for (i in args.params) {
params[i] = args.params[i];
}
}
params['sesskey'] = M.cfg.sesskey;
var url= $(location).attr('href');
//notes player time starts
$('document').ready(function(){
......@@ -92,7 +86,6 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f
var iframe = document.querySelector('iframe');
// console.log(iframe);
var player = new Vimeo.Player(iframe);
console.log("player");
console.log(player);
player.pause().then(function() {
})
......@@ -108,14 +101,12 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f
$.ajax({
url: rootPath + "/blocks/mynotes/timerajax.php",
type: 'POST',
data: { notestime: str},
data: {notestime: 'pollathavan'},
success: function(data){
}
});
// if ( url.includes('/mod/page/view.php') ){
$.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
// }
// params['notestime'] = str;
// console.log(str);
})
//
// var result = str.fontcolor("green");
}
});
//notes player time ends
if (args['scope']) {
scope = args['scope'];
}
params['contextarea'] = scope.currenttab.replace(CONFIG.prefix, '');
params['contextarea'] = params['contextarea'].replace('#', '');
if (args.params) {
for (i in args.params) {
params[i] = args.params[i];
}
}
params['sesskey'] = M.cfg.sesskey;
var cfg = {
method: 'POST',
on: {
......
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
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
......
......@@ -73,17 +73,11 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f
request: function(args) {
var params = {};
var scope = this;
if (args['scope']) {
scope = args['scope'];
}
params['contextarea'] = scope.currenttab.replace(CONFIG.prefix, '');
params['contextarea'] = params['contextarea'].replace('#', '');
if (args.params) {
for (i in args.params) {
params[i] = args.params[i];
}
}
params['sesskey'] = M.cfg.sesskey;
var url= $(location).attr('href');
//notes player time starts
$('document').ready(function(){
......@@ -92,7 +86,6 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f
var iframe = document.querySelector('iframe');
// console.log(iframe);
var player = new Vimeo.Player(iframe);
console.log("player");
console.log(player);
player.pause().then(function() {
})
......@@ -108,14 +101,12 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f
$.ajax({
url: rootPath + "/blocks/mynotes/timerajax.php",
type: 'POST',
data: { notestime: str},
data: {notestime: 'pollathavan'},
success: function(data){
}
});
// if ( url.includes('/mod/page/view.php') ){
$.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
// }
// params['notestime'] = str;
// console.log(str);
})
//
// var result = str.fontcolor("green");
}
});
//notes player time ends
if (args['scope']) {
scope = args['scope'];
}
params['contextarea'] = scope.currenttab.replace(CONFIG.prefix, '');
params['contextarea'] = params['contextarea'].replace('#', '');
if (args.params) {
for (i in args.params) {
params[i] = args.params[i];
}
}
params['sesskey'] = M.cfg.sesskey;
var cfg = {
method: 'POST',
on: {
......
<?php
require_once('/../../config.php');
require_once($CFG->dirroot.'/user/profile/lib.php');
require_once($CFG->dirroot.'/course/lib.php');
// require_once($CFG->dirroot.'/user/profile/lib.php');
// require_once($CFG->dirroot.'/course/lib.php');
require_once($CFG->dirroot . '/blocks/mynotes/lib.php');
global $USER,$DB;
if (!isloggedin()) {
echo json_encode(array('error' => 'require_login'));
die();
}
// if (!isloggedin()) {
// echo json_encode(array('error' => 'require_login'));
// die();
// }
$timertext = optional_param('notestime', '', PARAM_TEXT);
$timertext = optional_param('notestime', '', PARAM_TEXT);
// $myuser=profile_user_record($USER->id);
if ($timertext){
echo json_encode($timertext);
echo $timertext;
}
else{
echo "value fromrhere";
}
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!