Sunday, December 22, 2019

i finally have the template for the html5 frontend done, and have uploaded it to the bandcamp site. this is not a formal rerelease, but an addition to the previous rerelease. the formal rereleases moving forward will include the html5 frontends by default.

there is an instructions file, but you basically just unzip and load the index into your browser.

this is overdue, but there should be some more releases up over the next few days.

https://jasonparent.bandcamp.com/album/inri-cassette-demo-1
yeah. i'm done testing.

i made a minor update to the autoplay to reset when it's done:

Player.onended = function(){
    if(++elm < nextsrc.length){  
         Player.src = nextsrc[elm]; Player.play();
         txtOutput.value = titles[elm];   
         }
         else if(elm == nextsrc.length){
             Player.src=nextsrc[0];
             txtOutput.value=titles[0];
             elm=0;
         }
}

and, that's that.

you may use my html5 player freely, as much as you'd like. just mention my bandcamp page somewhere (jasonparent.bandcamp.com), if you feel like it.

the player is of course intended for use with bandcamp downloads, so the next post will be....it won't be a final update for inri000, but it will be the last one for quite a while.
you have to test things. programming is empirical.

there is one scenario where this breaks, and it's because i just let the user push the counter in any direction they want, for as long as they want. it really didn't matter, before, it was just a counter going up and down. but, now i have a listener on the play error, so pushing the counter out of bounds breaks the player.

specifically, if i let the player push forward or backward past the bounds of the playlist, it generates the same error that i'd get if i didn't have the right array. this was creating a lot of confusion.

so, now the button doesn't work when you get past the bounds, it just stops, leaving the error for the situation where i don't have the right array.

clearly, this would suggest that any other situation that generates a play error is going to wreak similar havoc. the thing is that i can't think of any other situation that would do that. the assumption is that the html file is in the same directory as the mp3 files; if they aren't there, you'd get an error, but you're not getting very far without them, anyways. i'm not done testing yet, let's see if i can find something else.

i also dropped the boolean around the script as a troubleshooting step and didn't put it back. it can just pause on massive error. you'll have to refresh to restore functionality, but that should only happen when the files aren't there, anyways.

for now, here's the new and hopefully final script:

<p align="center">

//the display box
<input disabled type = "text"  style="width:300px;background-color:#000000;border-width:0px;" id = "txtOutput"/>
<br>

//the onclick now calls a function. i need a conditional. it was getting messy.
<button type="button"  style="font-size:50px;" onclick="backClick()">&lt;</button>

//the html5 audio control is the same/
<audio autoplay controls  style="width:500px;height:50px"  id="Player">
   <source id=flac src="path to first flac file" type='audio/flac; codecs="flac"'>
   <source id=mp3 src="path to first mp3 file" type='audio/mpeg; codecs="mp3"'>
   <source id=aac   src="path to first m4a file" type='audio/mp4'>
   <source id=wav src="path to first wav file" type='audio/wav'>
   <source id=ogg src="path to first ogg file" type='audio/ogg; codecs="vorbis"'>
</audio>

//there's now a function here, too
<button type="button"  style="font-size:50px;" onclick="forwardClick()">&gt;</button>

//this is the two row table
<table>
<tr><td width=200 onclick="Player.src = nextsrc[0]; Player.play(); elm=0; txtOutput.value = this.innerHTML">track 1 </td><td onclick="Player.src = nextsrc[8]; Player.play(); elm=8; txtOutput.value = this.innerHTML">track 9</td></tr>
.
.
.
</table>


<script>
var elm = 0;  //counter
var Player = document.getElementById('Player');  //player

var titles =[array of song titles];

txtOutput.value = titles[0]; //autoload track 1

var nextsrc = ["array of paths to mp3 files"];  //default


Player.onerror=function(){   //if the file can't play
     nextsrc = ["array of paths to flac files"]; //try flac
     Player.src=nextsrc[elm];  //set current path
     Player.play();  /play
     Player.onerror=function(){    //if the player throws another error  
          nextsrc = ["array of paths to ogg files"]; /try oggs
          Player.src=nextsrc[elm]; 
          Player.play();
          Player.onerror=function(){
               nextsrc = ["array of paths to m4a files"];  //try mp4
               Player.src=nextsrc[elm];
               Player.play();
               Player.onerror=function(){
                    nextsrc = ["array of paths to wav files"]; //try wav
                    Player.src=nextsrc[elm];
                    Player.play();
                    Player.onerror=function(){Player.pause();}  //give up
                    } 
              }
          }
     }

function backClick(){  //here's the onclick script moved to a function
    if(elm>=1){   //the index has to be in bounds.
        Player.src = nextsrc[--elm];
        Player.play();
        txtOutput.value = titles[elm];
    }
    else{
    elm=0;  //or set it to 0
    }
}

function forwardClick(){    //here's the other button script
    if(elm<=(nextsrc.length-2)){ //the index must be in bounds
        Player.src = nextsrc[++elm];
        Player.play();
        txtOutput.value = titles[elm];
    }
    else{
    elm=nextsrc.length-1;  //or set to the end
    }}


Player.onended = function(){    //autoplay
    if(++elm < nextsrc.length){  
         Player.src = nextsrc[elm]; Player.play();
         txtOutput.value = titles[elm];   
         }
}
</script>
</p>
are there problems with that code?

well, i shut off the loop. that's the biggest thing i could see going wrong.

as mentioned, i'd have much rather tried to figure out what the file type is first, but the api doesn't want you to do that - it forces you to do shit like this. it's cringey, in a sense, yes - you don't want to be pushing errors like this too much, as it opens up security issues. i wouldn't be surprised if i essentially just emulated a hacker routine. but, these files are local, and at least one of the arrays should work, or why are you doing this? as was the case with the buttons, the error handling is not good, but who cares, functionally? it works, and it will work so long as you don't get stupid about it.

i'm not sure i'd recommend this for any kind of internet application, though.
so, i was completely right about approaching the javascript frontend like it's a...script...rather than trying to fuck around with objects. and, the right error listener was the onerror, too.

let's do this one more time.

so, i posted the thing here, initially:
http://dsdfghghfsdflgkfgkja.blogspot.com/2019/11/im-going-to-post-last-update-to-this.html

the changes are as follows.

//this is the html5 control. it now checks for each of the filetypes, and either plays the file or throws an error.
<audio autoplay controls  style="width:500px;height:50px"  id="Player">
<source id=flac src="path to first flac file" type="audio/flac">
<source id=mp3 src="path to first mp3 file" type="audio/mp3">
<source id=aac src="path to first m4a file" type="audio/mp4">
<source id=wav src="path to first wav file" type="audio/wav">
<source id=ogg src="path to first ogg file" type="audio/ogg">
</audio>

//here is the script.
<script>
var elm = 0;      //this is the counter. the snippet used elm. i don't really know why. you can change it to c...
var t=0;  //this is a boolean to prevent infinite looping through the error handling
var Player = document.getElementById('Player');   //this gets the player from the html doc

//so, let's try to set the file paths to mp3 files
var nextsrc = [array of mp3 file paths];

//if they aren't accessible, the player will throw an error
Player.onerror=function(){
     if (t=0){
          nextsrc = [array of flac file paths];  //well, let's try flac, then.
          Player.src=nextsrc[elm];  //then, let's set the path
          Player.play();   //try to play. if it works, great. if not, it errors:.
          Player.onerror=function(){  
               nextsrc = [array of ogg file paths];  //well, if it's not mp3 & not flac, maybe it's ogg...
               Player.src=nextsrc[elm];  //so, set the path
               Player.play();  /try to play. if it doesn't work, it errors:
               Player.onerror=function(){ 
                    nextsrc = [array of m4a file paths]; //next, try the m4as
                    Player.src=nextsrc[elm];  //set the path again
                    Player.play();  //try to play. if it doesn't work, it'll error one more time...
                    Player.onerror=function(){
                         nextsrc = [array of wav file paths];  //last try.
                         Player.src=nextsrc[elm];  //set the path
                         Player.play();  //play
                         Player.onerror=function(){t=1;}  //if it's still erroring, give up
                   }
               }
          }
     }
}
</script>

=============

the rest is the same.

i think that's done, now, so i should get that uploaded soon and should be able to move forward pretty quickly. just some more testing, still...
this article repeats the fallacy that nuclear is carbon-neutral, which is the actual crux of the debate, and something i've already thoroughly debunked.

we can have a debate on the broader merits of including nuclear in the grid. but, if your candidate is telling you that nuclear is carbon neutral, you should investigate who their donors are - because that is wrong.

https://www.vox.com/energy-and-environment/2019/9/6/20852313/december-democratic-debate-nuclear-power-energy
yeah.

this is out of nowhere. but i'll take it.

https://www.vox.com/science-and-health/2019/12/19/21029902/open-access-trump
no. breaking the law and going to prison doesn't cost anybody anything at all, except the person getting arrested, who now has legal costs.

do you know what the balance of probabilities is? it's that roger hallam is actually a police officer, an agent provocateur, which is a tactic that was invented by bismarck to trick the communists of the time into getting arrested. once they arrest you, you'll be under surveillance for the rest of your life.

there is a core of truth in what he's saying - the reason that the sit down strikes were effective was that it crippled production, forcing management to negotiate. i haven't read this research directly, but i've made these arguments independently. writing letters and marching peacefully doesn't work, but getting arrested doesn't either, or at least it doesn't without something worthwhile attached to it.

one thing that's been effective in canada, and to a lesser extent in the united states, is launching litigation against the oil companies. that is something that really hits them at the bottom line. if you make the cost of business so high that there's no longer any profit, they will withdraw voluntarily. we've had a lot of serious victories in canada by pushing litigation as a political tactic.

but, if you want to go out of your way to get arrested on the basis that you're trying to disrupt the system, make sure that you're actually disrupting the system! blockade a refinery. sabotage a train (and tell them before they use it). reverse the flow of a pipeline.

you need to think bigger than sitting in the streets and smoking drugs and getting arrested for the sake of it. that's just walking into a trap.

https://www.vox.com/future-perfect/2019/12/20/21028407/extinction-rebellion-climate-change-nonviolent-civil-disobedience
and, to be clear.

liberals aren't supposed to uphold the value of the state, they're supposed to argue for self-sufficiency without it. socialism is about setting up an algorithm where the state eventually withers away, and anarchism is just socialism in a hurry.

so, who argues for the value and role of government in society?

conservatives.
i'd be happy to do my part if the system was equitable and free.

but, i'm not buying into the slave-master propaganda that tells me i'm a piece of shit for refusing to participate in capitalism, and fuck you for suggesting i should.
ok.

so, i didn't get anything done today.

and now i'm very sleepy...

let's hope i can get by with a nap and get up early.
regarding the issue of arrest, this case would appear to also supersede Storrey, but i can't bring in new evidence...

....i'd have to just bring it to the court's attention.

https://decisions.scc-csc.ca/scc-csc/scc-csc/en/item/17947/index.do
i understand that there are some groups of people that may feel as though the court may discriminate against them, and may want a way out. whatever.

but, i should not be forced to suffer as a result of their claims of discrimination.

the law should be changed to allow for an option. if some people feel that they'll get a more fair trial through an extrajudicial process, good for them; if some people want the issue dealt with in a court instead of via a tribunal, they should have that option, too.
i have confidence that the court will instantly realize the absurdity i've been put through, once it sees the case.

but, i shouldn't have had to go through this process to get the case into the court in the first place.

i should have had the option to file in court, immediately.
i was arrested on an unarrestable offence without a warrant and held without cause more than a year ago, and the statutes in this country have forced me to:

1) defer the issue to the police force that arrested me (which is absurd)
2) ask a civilian body (that is explicitly not trained to deal with this) to review the decision of the police force (which is equally absurd)
3) only allow for a request for judicial review after receiving the report from the civilian body.

i have experienced months worth of delays, in the process.

an illegal arrest is a breakdown in the rule of law, by definition.

as such, i have not been able to get anybody with any kind of substantive legal training to look at what is clearly a collapse in the rule of law, allowing the police to break the law with impunity.

and, if this continues, it is going to be a constitutional right challenge, because i need to be able to get this in front of a judge, in the end. this cannot be left up to an unelected body with no training. that would be despotic - it would be like living in iran.
even up until recently, there were ways out.

in the 40s, you had the kibbutz, if you were jewish. in the 60s and 70s and most of the 80s, you had hippie and punk communities out there where life on the margins of capitalism was possible, even if life outside of it wasn't.

but, everything got bought up in the 90s.

and, there really is nothing left - no way out.

well, unless you want to join a cult, i guess.

but, the basic question - why do so many poor people hate the government when they're so reliant on it? - is not so hard to understand. they know that the reason they're reliant on the government is that the government has passed policies that make them reliant on it, and then enforced those policies with extreme violence. you can't make that go away with bread and circuses. you can't force them to love their masters, or push the stockholm syndrome down with conditioning. the resentment is entirely rational.
i don't want into the system.

i don't want a chance to succeed, to do well - a fair playing field.

i want out of the society...

but, it's ubiquitous. the only way out is to take the check.
essentially, it seems like the author of that book is expecting people to demonstrate a level of stockholm syndrome in regards to people's attitudes towards the government, which both enslaves it and feeds it, and is confused as to why people aren't overlooking the slavery in response to the food.

but, she's missing the basic point - that we wouldn't need to rely on the state if it wouldn't force us to, by upholding these systems of market economics that force you to work or die trying.

if there was somewhere where people could go to escape the coercion of state-controlled capitalism, a large percentage of the people that currently rely on the state to exist would jump at the chance, and no doubt live quite happily without it.

i know i would, that's for sure.

but, so long as the government puts all of these rules in place forcing me to waste all of my time generating surplus value for somebody else, and offers me this pittance as the only way to avoid the slavery, then i'm going to end up reliant on it.

but, i'm not going to be happy about it, though.

i'm not going to love my oppressor.