{"id":8604,"date":"2020-07-31T23:54:28","date_gmt":"2020-08-01T06:54:28","guid":{"rendered":"https:\/\/www.waveplayer.info\/?p=8604"},"modified":"2020-07-31T23:54:31","modified_gmt":"2020-08-01T06:54:31","slug":"test-for-a-b-comparison","status":"publish","type":"post","link":"https:\/\/www.waveplayer.info\/tests\/test-for-a-b-comparison\/","title":{"rendered":"Test for A\/B comparison"},"content":{"rendered":"\n<script>\n    (function($){\n        let currentIndex = 0,\n            currentTime = 0\n        window.abComparison = (event) => {\n            const currentInstance = WavePlayer.getCurrentInstance()\n            currentIndex = Number( ! currentIndex )\n            currentTime = WavePlayer.getCurrentTime()\n            \/\/ currentInstance.skipTo( currentIndex )\n            WavePlayer.setCurrentTrack( currentInstance.tracks[ currentIndex ] )\n            WavePlayer.play()\n            WavePlayer.audio.currentTime = currentTime\n            $('#button-comparison').text( `Version ${currentIndex?'B':'A'}` )\n        }\n    })(jQuery)\n<\/script>\n<style>\n    #button-comparison {\n    width: 300px;\n    margin: 20px auto;\n    display: block;\n    padding: 10px 20px;\n    font-size: 1.5rem;\n    background: linear-gradient(45deg, #058,#08b);\n    color: #fff;\n    border: none;\n    border-radius: 4px;\n    cursor: pointer;\n}\n<\/style>\n\n<button id=\"button-comparison\" class=\"button-version-comparison\" type=\"button\" onclick=\"abComparison();\">Version A<\/button>\n\n\n<div class=\"waveplayer-container\"><div id=\"waveplayer-246d1309cb4b17479391590d02ae4980-68c006922d9c1\" class=\"waveplayer loading wvpl-skin-play_n_wave wvpl-palette-800e3a14c86733ad9ccc96fd80850d88 wvpl-style-light wvpl-size-md \" data-skin=\"play_n_wave\" data-limit=\"0\" data-mode=\"normal\" data-config_id=\"246d1309cb4b17479391590d02ae4980\" data-instance_id=\"246d1309cb4b17479391590d02ae4980-68bffb5697bc5\">\n\t<div class=\"wvpl-controls\">\n\t\t<div class=\"wvpl-icon wvpl-play\"><\/div>\n\t<\/div>\n\t<div class=\"wvpl-wave\">\n\t\t<div class=\"wvpl-overlay\">\n\t\t\t<svg>\n\t\t\t\t<use xlink:href=\"#waveform-animation\" \/>\n\t\t\t<\/svg>\n\t\t\t<div class=\"percentage\"><\/div>\n\t\t\t<div class=\"wvpl-loading\">\n\t\t\t\t<div class=\"wvpl-loading-progress\"><\/div>\n\t\t\t<\/div>\n\t\t\t<div class=\"message\"><\/div>\n\t\t<\/div>\n\t\t<div class=\"wvpl-position\"><\/div>\n\t\t<div class=\"wvpl-waveform\"><\/div>\n\t\t<div class=\"wvpl-duration\"><\/div>\n\t<\/div>\n<\/div>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>Version A<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-8604","post","type-post","status-publish","format-standard","hentry","category-tests"],"_links":{"self":[{"href":"https:\/\/www.waveplayer.info\/wp-json\/wp\/v2\/posts\/8604","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.waveplayer.info\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.waveplayer.info\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.waveplayer.info\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.waveplayer.info\/wp-json\/wp\/v2\/comments?post=8604"}],"version-history":[{"count":0,"href":"https:\/\/www.waveplayer.info\/wp-json\/wp\/v2\/posts\/8604\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.waveplayer.info\/wp-json\/wp\/v2\/media?parent=8604"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.waveplayer.info\/wp-json\/wp\/v2\/categories?post=8604"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.waveplayer.info\/wp-json\/wp\/v2\/tags?post=8604"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}