f9077e02 by logesh

change in vimeo player events

1 parent a1164735
define(["jquery"],function(e){return{init:function(){var n=e(location).attr("href");e("document").ready(function(){var t="You have taken notes at ",o=(t+=" in this video.").fontcolor("green");if(alert(o),n.includes("/mod/page/view.php")){var i=document.querySelector("iframe"),u=new Vimeo.Player(i);u.on("play",function(){alert("played the video!")}),u.getVideoId().then(function(e){}),setTimeout(function(){u.getCurrentTime().then(function(e){console.log("time out function"),console.log(e)})},1500),e("#mynotepencil").click(function(){var n;u.getCurrentTime().then(function(e){n=e}),setTimeout(function(){e("#id_mynotecontent-258").val(n)},1e3)}),u.pause().then(function(){alert("the video was paused")})}})}}});
\ 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 n=document.querySelector("iframe"),t=new Vimeo.Player(n);t.on("play",function(){console.log("played the video!"),setTimeout(function(){t.getCurrentTime().then(function(e){console.log("time video played"),console.log(e)})},1500)}),t.getVideoId().then(function(e){console.log("video id"),console.log(e),console.log("*******")}),setTimeout(function(){t.getCurrentTime().then(function(e){console.log("time out function"),console.log(e)})},1500),e("#mynotepencil").click(function(){var o;t.getCurrentTime().then(function(e){o=e}),setTimeout(function(){console.log(o);var n="<div> You have taken notes at ";n+=o;var t=(n+=" in this video.</div>").fontcolor("green");e("#id_mynotecontent-258").val(t)},1e3)}),t.pause().then(function(){alert("the video was paused")})}})}}});
\ No newline at end of file
......
......@@ -6,12 +6,6 @@ define(['jquery'], function($) {
$('document').ready(function(){
var str = "You have taken notes at ";
str +=" in this video."
var result = str.fontcolor("green");
alert(result);
if(url.includes('/mod/page/view.php')){
var iframe = document.querySelector('iframe');
......@@ -19,11 +13,22 @@ define(['jquery'], function($) {
var player = new Vimeo.Player(iframe);
player.on("play", function() {
alert('played the video!');
console.log('played the video!');
setTimeout(function(){
player.getCurrentTime().then(function(seconds) {
console.log("time video played");
console.log(seconds);
})
}, 1500);
});
player.getVideoId().then(function(id) {
// id = the video id
console.log("video id");
console.log(id);
console.log("*******")
})
......@@ -47,11 +52,14 @@ define(['jquery'], function($) {
})
setTimeout(function(){
console.log(time);
var str = "<div> You have taken notes at ";
str +=time;
str +=" in this video.</div>"
$("#id_mynotecontent-258").val(time);
var result = str.fontcolor("green");
$("#id_mynotecontent-258").val(result);
}, 1000);
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!