558fb160 by logesh

dev: player script for js

1 parent 5ca8f561
......@@ -87,25 +87,25 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f
//notes player time starts
var iframe = document.querySelector('iframe');
console.log(iframe);
// console.log(iframe);
var player = new Vimeo.Player(iframe);
console.log(player);
// console.log(player);
var time;
player.getCurrentTime().then(function(seconds) {
time=seconds;
})
console.log(time);
//
params['sesskey'] = M.cfg.sesskey;
var str = '</br></br><font color="green">newly You have taken notes at ';
// str +=time;
console.log(time);
str +=time;
str +=" secs in this video.</font>";
// var result = str.fontcolor("green");
params['notestime'] = str;
player.pause().then(function() {
alert('the video was paused');
})
//notes player time ends
......
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
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
......
......@@ -87,25 +87,25 @@ define(['jquery', 'core/yui', 'core/str', 'core/config', 'core/notification'], f
//notes player time starts
var iframe = document.querySelector('iframe');
console.log(iframe);
// console.log(iframe);
var player = new Vimeo.Player(iframe);
console.log(player);
// console.log(player);
var time;
player.getCurrentTime().then(function(seconds) {
time=seconds;
})
console.log(time);
//
params['sesskey'] = M.cfg.sesskey;
var str = '</br></br><font color="green">newly You have taken notes at ';
// str +=time;
console.log(time);
str +=time;
str +=" secs in this video.</font>";
// var result = str.fontcolor("green");
params['notestime'] = str;
player.pause().then(function() {
alert('the video was paused');
})
//notes player time ends
......
......@@ -13,7 +13,7 @@ define(['jquery'], function($) {
var player = new Vimeo.Player(iframe);
$('#mynotepencil').click(function(){
/* $('#mynotepencil').click(function(){
var time;
......@@ -32,11 +32,9 @@ define(['jquery'], function($) {
}, 1000);
});
});*/
player.pause().then(function() {
alert('the video was paused');
})
}
......
......@@ -150,7 +150,6 @@ class block_mynotes_manager {
public function addmynote($context, $contextarea, $course, $content,$timer, $format = FORMAT_MOODLE) {
global $CFG, $DB, $USER, $OUTPUT;
$content=$content.$timer;
// print_r($content);
$newnote = new stdClass;
$newnote->contextid = $context->id;
$newnote->contextarea = $contextarea;
......
......@@ -65,8 +65,8 @@ echo $OUTPUT->header(); //...send headers
switch ($action) {
case 'add':
$content = optional_param('content', '', PARAM_RAW);
$timer = optional_param('notestime', 0, PARAM_TEXT);
print_r($timer);
$timer = optional_param('notestime', '', PARAM_TEXT);
$manager = new block_mynotes_manager();
if ($note = $manager->addmynote($context, $contextarea, $course, $content,$timer)) {
$options = new stdClass();
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!