cookk

0 Views

How was the video ?
`); _click_to_play = true; $(".plyr").prepend(` `); $(".plyr").prepend(` `); }); $(document).ready(function() { $(document).on("click", "#skip_btn", function(){ // alert("play"); player.play(); $("#plyr_overlay").hide(); $("#plyr_overlay_text_show").hide(); $("#plyr_overlay_t").hide(); $("#plyr_leads_form_show").hide(); }); }); $(document).ready(function() { $(document).on("click", ".question_skip_btn", function(){ // alert("play"); player.play(); $("#plyr_overlay").hide(); $("#plyr_overlay_t").hide(); $("#plyr_overlay_text_show").hide(); $(".question_show").hide(); }); $(document).on("click", ".quiz_skip_btn", function(){ // alert("play"); player.play(); $("#plyr_overlay").hide(); $("#plyr_overlay_t").hide(); $("#plyr_overlay_text_show").hide(); $(".quiz_show").hide(); }); }); // var _video_embed_stats_url = "https://avenow.vidpowr.net/video_stats"; var _video_url_id = "cookk"; var _random_id = "79048773"; var _split_id = "0"; var _video_embed_resp_url = "https://avenow.vidpowr.net/video_reaction"; var _video_embed_comment_url = "https://avenow.vidpowr.net/video_comment"; // analytics /* $(function(){ $.post(_video_embed_stats_url,{ _id: _video_url_id, _view_id: _random_id, _opened: true, _split_id: _split_id }).done(function(data){ console.log(data); }); }); */ // reaction $("#reaction input[name=reaction]").click(function(){ if($(this).is(":checked")) { var _feedback = $(this).val(); $.post(_video_embed_resp_url, { _id: _video_url_id, _view_id: _random_id, _feedback: _feedback, _split_id: _split_id }).done(function(data){ console.log(data); }); } }); $("#comment").click(function(e){ var _comment = $("textarea#comment_msg").val(); if(_comment.trim().length > 0) { e.preventDefault(); $.post(_video_embed_comment_url, { _id: _video_url_id, _view_id: _random_id, _comment: _comment }).done(function(data){ if(data != "error") { var toastLiveExample = document.getElementById('liveToast') var _new_comment_url = "https://avenow.vidpowr.net/:id"; _new_comment_url = _new_comment_url.replace(':id', _video_url_id); $("#new_comment_link").attr('href', _new_comment_url + "#comment-" + data); var toast = new bootstrap.Toast(toastLiveExample); toast.show(); // console.log(data); } }); } else { // console.log("write something"); $("textarea#comment_msg").focus(); } }); $("#comment_signup").click(function(e){ $("#signup_modal").modal("show"); }); // post_video_comment_route /* player.on('playing', function(){ $.post(_video_embed_stats_url, { _id: _video_url_id, _view_id: _random_id, _played: true, _split_id: _split_id }).done(function(data){ console.log(data); }); }); */ player.on('ended', function(){ player.stop(); /* $.post(_video_embed_stats_url, { _id: _video_url_id, _view_id: _random_id, _ended: true, _split_id: _split_id }).done(function(data){ console.log(data); }); */ }); var _shown = false; var _shown_t = false; var _shown_dwnld = false; var _shown_anywhere = false; var _shown_overlay = false; $("div.plyr--full-ui").prepend(`
What is your age
`); $("#quiz_1_show form.save_quiz input[name=answer]").click(function(e){ console.log("checkbox clicked"); e.preventDefault(); var _video_id = $("#save_quiz_1 input[name='video_id']").val(); var _question_id = $("#save_quiz_1 input[name='quiz_id']").val(); var _answer = $("#save_quiz_1 input[name='answer']:checked").val(); var _url = "https://avenow.vidpowr.net/save_video_quiz_answer"; $.post(_url, { video_id: _video_id, question_id: _question_id, answer: _answer, type: 'quiz' }).done(function(data){ if(data != "error") { $("#quiz_1_show").hide(); console.log(data); player.play(); if(data != "done") { // get jump time (if any) // alert(data); if(data.includes(":")) { var a = data.split(':'); var _time = (+a[0]) * 60 * 60 + (+a[1]) * 60 + (+a[2]); player.currentTime = parseFloat(_time); } else { window.location = "https://avenow.vidpowr.net/"+data; } } } }); }); /* $("#quiz_1_show form.save_quiz").submit(function(e){ e.preventDefault(); var _video_id = $("#save_quiz_1 input[name='video_id']").val(); var _question_id = $("#save_quiz_1 input[name='quiz_id']").val(); var _answer = $("#save_quiz_1 input[name='answer']:checked").val(); var _url = "https://avenow.vidpowr.net/save_video_quiz_answer"; $.post(_url, { video_id: _video_id, question_id: _question_id, answer: _answer, type: 'quiz' }).done(function(data){ if(data != "error") { $("#quiz_1_show").hide(); console.log(data); player.play(); if(data != "done") { // get jump time (if any) // alert(data); if(data.includes(":")) { var a = data.split(':'); var _time = (+a[0]) * 60 * 60 + (+a[1]) * 60 + (+a[2]); player.currentTime = parseFloat(_time); } else { window.location = "https://avenow.vidpowr.net/"+data; } } } }); }); */ var _form_q_1_shown = false; player.on('timeupdate', function(){ // console.log(player.currentTime); var __cta_time_q_1 = "00:00:20"; __cta_time_q_1 = __cta_time_q_1.split(":"); var _hours_q_1 = parseInt(__cta_time_q_1[0]); var _minutes_q_1 = parseInt(__cta_time_q_1[1]); var _seconds_q_1 = parseInt(__cta_time_q_1[2]); var _time_q_1 = _hours_q_1 * 3600 + _minutes_q_1 * 60 + _seconds_q_1; // console.log(_time); var _min_time_q_1 = _time_q_1 - 0.2; var _max_time_q_1 = _time_q_1 + 0.2; // console.log(_min_time + " " + _max_time); if(_form_q_1_shown == false) { if(player.currentTime >= _min_time_q_1 && player.currentTime <= _max_time_q_1) { player.pause(); $("#quiz_1_show").css('display', 'flex'); _form_q_1_shown = true; } } }); $(function(){ });