I wrote the following script to store the value of the variable "muted_status" and then pass it into a cookie but it seems like the variable always has a false value.
var muted_status = false;
$('#jp_container_1').on("click", function() {
setTimeout(function() {
if ($('#jp_container_1').hasClass("jp-state-muted")) {
var muted_status = true;
} else {
var muted_status = false;
}
}, 1000);
$.cookie('jp_mute', muted_status, { expires: 7, path: '/'});
});