1b673064 by logesh

dev:changes in mynotes

1 parent 25c24732
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
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
......
......@@ -6,9 +6,30 @@ define(['jquery'], function($) {
$('document').ready(function(){
if(url.includes('/mod/hvp/view.php')){
if(url.includes('/mod/page/view.php')){
console.log("this is inside hvp");
var iframe = document.querySelector('iframe');
console.log(iframe);
var player = new Vimeo.Player(iframe);
console.log(player);
player.on("play", function() {
console.log('played the video!');
});
player.getCurrentTime().then(function(seconds) {
// seconds = the current playback position
console.log(seconds);
})
player.pause().then(function() {
console.log('the video was paused');
})
/*.catch(function(error) {
// an error occurred
});*/
console.log("after player");
}
});
......
......@@ -120,7 +120,11 @@ class block_mynotes extends block_base {
'perpage' => $config->mynotesperpage,
),
);
// $PAGE->requires->string_for_js('charactersleft', 'block_mynotes');
// $PAGE->requires->js_call_amd('block_mynotes/player', 'init');
// $PAGE->requires->js('/blocks/mynotes/javascript/player.min.js');
// $PAGE->requires->js( new moodle_url($CFG->wwwroot . '/blocks/mynotes/javascript/player.min.js') );
$PAGE->requires->js_call_amd('block_mynotes/script', 'init');
$PAGE->requires->string_for_js('notmorethan', 'block_mynotes');
$PAGE->requires->string_for_js('mynotes', 'block_mynotes');
......@@ -136,5 +140,6 @@ class block_mynotes extends block_base {
$PAGE->requires->string_for_js('mynotessavedundertab', 'block_mynotes');
$PAGE->requires->string_for_js('cancel', 'moodle');
$this->page->requires->js_call_amd('block_mynotes/mynotesblock', 'init', $arguments);
}
}
\ 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!