Tabular Single Row Emoji Sharing Menu Tutorial

Tabular Single Row Emoji Sharing Menu Tutorial

Tabular Single Row Emoji Sharing Menu Tutorial

Onto yesterday’s Tabular Single Row YouTube API Radio Play Textbox Tutorial, today, we are adding …

  • to that slivery left hand table cell … remaining slivery because what we are adding is what we like to call …
  • “emoji buttons” related to Sharing functionality … regarding …
    1. Email 📧
    2. SMS 📟
    3. Save 💾

… hooking into the Recall functionality set up when textareas got those additional “smarts” a few days ago.

This happens in …


Previous relevant Tabular Single Row YouTube API Radio Play Textbox Tutorial is shown below.

Tabular Single Row YouTube API Radio Play Textbox Tutorial

Tabular Single Row YouTube API Radio Play Textbox Tutorial

Apart from yesterday’s Tabular Single Row YouTube API Radio Play Tutorial‘s mainly HTML input type=checkbox means by which the user could control their YouTube video “Radio play” modes of use, there was one more aspect to user control we wanted to offer, that being to …


allow user to change a "Radio playlist" member in real time by changing the textboxes to the right of the individual checkboxes, primarily to enter in their own YouTube 11 character video identifier

… and have the software detect this event programmatically and update various aspects of that “Radio play” scenario.

This means, now, we can publish a more complete Javascript interventional snippet of code of relevance to yesterday’s and today’s work below …


function playingvideo() {
var mytos='', onethous=1000;
sparedur=-1;
beenbefore=true;
if (('' + parent.document.URL + 's').replace(/\#https/g,'') != ('' + parent.document.URL + 's')) {
//setTimeout(playingvideo, onethous);
var xvcen='';
if (eval('' + duration) <= 0) {
try {
duration='' + event.target.getDuration();
parent.document.getElementById('myh1').innerHTML='' + event.target.getVideoData().title;
setTimeout(function(){
parent.document.getElementById('youtube_duration').value='' + parent.document.getElementById('j' + ivid).value; // duration
}, 2000);
onethous=2500;
if (parent.document.getElementById('mytopspan')) { // && navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
mytos=parent.document.getElementById('mytopspan').innerHTML;
if (parent.document.getElementById('mytopspan').innerHTML.indexOf(' unmute ') == -1) {
if (('' + top.document.URL).indexOf('isradio=') != -1 && ('' + top.document.URL).indexOf('audioyoutube=') != -1 && nextvidi == 1) {
parent.document.getElementById('mytopspan').innerHTML='<font color=red>Please unmute within 30 seconds ... </font>' + mytos;
setTimeout(function(){
parent.document.getElementById('mytopspan').innerHTML=parent.document.getElementById('mytopspan').innerHTML.replace(' within 30 seconds ', ' as you require ').replace(' color="red"', ' color="blue"');
}, 30000);
} else {
parent.document.getElementById('mytopspan').innerHTML='<font color=blue>Please unmute as required ... </font>' + mytos;
}
}
}
} catch(xfghgf) {
duration='' + player.getDuration();
setTimeout(function(){
parent.document.getElementById('myh1').innerHTML='' + player.getVideoData().title;
parent.document.getElementById('youtube_duration').value='' + '' + parent.document.getElementById('j' + ivid).value; // duration;
}, 2000);
onethous=2500;
if (parent.document.getElementById('mytopspan')) { // && navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
mytos=parent.document.getElementById('mytopspan').innerHTML;
if (parent.document.getElementById('mytopspan').innerHTML.indexOf(' unmute ') == -1) {
if (('' + top.document.URL).indexOf('isradio=') != -1 && ('' + top.document.URL).indexOf('audioyoutube=') != -1 && nextvidi == 1) {
parent.document.getElementById('mytopspan').innerHTML='<font color=red>Please unmute within 30 seconds ... </font>' + mytos;
setTimeout(function(){
parent.document.getElementById('mytopspan').innerHTML=parent.document.getElementById('mytopspan').innerHTML.replace(' within 30 seconds ', ' as you require ').replace(' color="red"', ' color="blue"');
}, 30000);
} else {
parent.document.getElementById('mytopspan').innerHTML='<font color=blue>Please unmute as required ... </font>' + mytos;
}
}
}
}
}
try {
xvcen='' + event.target.getCurrentTime();
} catch(xfghgf) {
xvcen='' + player.getCurrentTime();
}
var aswellas=0;
if (parent.document.getElementById('c' + ivid)) {
if (!parent.document.getElementById('c' + ivid).checked) {
aswellas=eval(1 + eval('' + duration));
}
}
var ipo=0;
var xxcen=eval(aswellas + eval('' + xvcen));
if (eval(1 + xxcen) >= eval('' + duration)) {
//alert('here RE ' + duration + ' stduration=' + stduration);
if (nextvidi >= 0) {
if (parent.document.getElementById('c' + nextvidi)) {
if (!parent.document.getElementById('c' + nextvidi).checked) {
ipo=0;
while (parent.document.getElementById('xx' + ipo)) {
parent.document.getElementById('xx' + ipo).style.backgroundColor='pink';
ipo++;
}
while (!parent.document.getElementById('c' + nextvidi).checked) {
if (parent.document.getElementById('shufflechk')) {
if (!parent.document.getElementById('shufflechk').checked) {
nextvidi++;
if (eval('' + viddurs.length) <= nextvidi) {
if (parent.document.getElementById('loopchk')) {
if (!parent.document.getElementById('loopchk').checked) {
nextvidi--;
player.stopVideo();
} else {
nextvidi=0;
}
} else {
nextvidi=0;
}
}
} else {
nextvidi=Math.floor(Math.random() * eval('' + viddurs.length));
}
} else {
nextvidi++;
if (eval('' + viddurs.length) <= nextvidi) {
if (parent.document.getElementById('loopchk')) {
if (!parent.document.getElementById('loopchk').checked) {
nextvidi--;
player.stopVideo();
} else {
nextvidi=0;
}
} else {
nextvidi=0;
}
}
}
}
}
}
if (eval('' + viddurs.length) <= nextvidi) {
nextvidi=0;
ipo=0;
while (parent.document.getElementById('xx' + ipo)) {
parent.document.getElementById('xx' + ipo).style.backgroundColor='pink';
ipo++;
}
if (parent.document.getElementById('xx' + nextvidi)) {
parent.document.getElementById('xx' + nextvidi).style.backgroundColor='lightgreen';
}
} else if (parent.document.getElementById('xx' + nextvidi)) {
if (parent.document.getElementById('shufflechk')) {
if (parent.document.getElementById('shufflechk').checked) {
ipo=0;
while (parent.document.getElementById('xx' + ipo)) {
parent.document.getElementById('xx' + ipo).style.backgroundColor='pink';
ipo++;
}
}
}
parent.document.getElementById('xx' + nextvidi).style.backgroundColor='lightgreen';
}
duration=-1;
wasno=('' + nextvidi);
wasdur=('' + viddurs[nextvidi]);
wasvid='' + vidarrv[nextvidi];
wasstart=('' + vidstarts[nextvidi]);
wasdos=viddos[nextvidi];
newdos=viddos[nextvidi];
newno=('' + nextvidi);
newdur=('' + viddurs[nextvidi]);
newvid='' + vidarrv[nextvidi];
newstart=('' + vidstarts[nextvidi]);
wastitle='';
newtitle='';
if (parent.document.getElementById('i' + nextvidi)) {
//alert(1);
if (eval('' + ('' + parent.document.getElementById('i' + nextvidi).value).length) >= 11 && parent.document.getElementById('i' + nextvidi).value.indexOf('' + vidarrv[nextvidi]) == -1) {
beenbefore=false;
//alert(11);
if (parent.document.getElementById('i' + nextvidi).value.indexOf('|') != -1) {
newstart=parent.document.getElementById('i' + nextvidi).value.split('|')[0];
vidstarts[nextvidi]='' + newstart;
newvid=parent.document.getElementById('i' + nextvidi).value.split('|')[1].split('#')[0];
vidarrv[nextvidi]='' + newvid;
} else {
newstart='0';
vidstarts[nextvidi]='' + newstart;
newvid=parent.document.getElementById('i' + nextvidi).value.split('#')[0];
vidarrv[nextvidi]='' + newvid;
}
if (parent.document.getElementById('c' + nextvidi)) {
if (parent.document.getElementById('c' + nextvidi).checked) {
newdos=true;
viddos[nextvidi]=true;
} else {
newdos=false;
viddos[nextvidi]=false;
}
}
}
}
if (top.document.getElementById('divtitles')) {
if (top.document.getElementById('divtitles').innerHTML.indexOf('|' + vidarrv[nextvidi] + '') == -1) {
//alert(111);
beenbefore=false;
}
}
//alert('1111 ' + viddurs[nextvidi] + ' beenbefore=' + beenbefore);
//if (('' + viddurs[nextvidi]) == '' || eval('0' + viddurs[nextvidi]) <= 0 || !beenbefore) {
//alert('changed');
//} else {
//alert('not changed');
//}
if (('' + viddurs[nextvidi]) == '' || eval('0' + viddurs[nextvidi]) <= 0 || !beenbefore) {
if (top.document.getElementById('divtitles')) {
if (top.document.getElementById('divtitles').innerHTML.indexOf('|' + viddurs[nextvidi] + '') != -1) {
if (top.document.getElementById('divtitles').innerHTML.indexOf('|' + viddurs[nextvidi] + '#') != -1) {
wastitle=top.document.getElementById('divtitles').innerHTML.split('|' + viddurs[nextvidi] + '#')[1].split('</')[0];
newtitle=wastitle;
}
}
}
player.loadVideoById(vidarrv[nextvidi], eval('' + vidstarts[nextvidi]), "large");
try {
ivid=nextvidi;
sparedur='' + event.target.getDuration();
//alert('3:' + sparedur);
viddurs[ivid]='' + sparedur;
newdur='' + viddurs[ivid];
setTimeout(function(){
parent.document.getElementById('myh1').innerHTML='' + event.target.getVideoData().title;
newtitle='' + event.target.getVideoData().title;
if (!beenbefore) {
top.document.getElementById('divtitles').innerHTML+='<span>' + newstart + '|' + newvid + '#' + newtitle.replace(/\&\;/g,'and').replace(/\ \&\ /g,' and ') + '</span>';
parent.fixdoc('' + ivid, '' + ('' + newdos).replace('false','off').replace('true','on') + '#' + newstart + '|' + newvid + '#' + newdur + '#' + newtitle);
} else if (newstart != wasstart || newvid != wasvid || newtitle != wastitle) {
top.document.getElementById('divtitles').innerHTML=top.document.getElementById('divtitles').innerHTML.replace(wasvid, 'cannotenda2');
top.document.getElementById('divtitles').innerHTML+='<span>' + newstart + '|' + newvid + '#' + newtitle.replace(/\&\;/g,'and').replace(/\ \&\ /g,' and ') + '</span>';
parent.fixdoc('' + ivid, '' + ('' + newdos).replace('false','off').replace('true','on') + '#' + newstart + '|' + newvid + '#' + newdur + '#' + newtitle);
}
parent.document.getElementById('youtube_duration').value='' + parent.document.getElementById('j' + ivid).value; // duration
}, 2000);
onethous=2500;
if (parent.document.getElementById('mytopspan')) { // && navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
mytos=parent.document.getElementById('mytopspan').innerHTML;
if (parent.document.getElementById('mytopspan').innerHTML.indexOf(' unmute ') == -1) {
if (('' + top.document.URL).indexOf('isradio=') != -1 && ('' + top.document.URL).indexOf('audioyoutube=') != -1 && nextvidi == 1) {
parent.document.getElementById('mytopspan').innerHTML='<font color=red>Please unmute within 30 seconds ... </font>' + mytos;
setTimeout(function(){
parent.document.getElementById('mytopspan').innerHTML=parent.document.getElementById('mytopspan').innerHTML.replace(' within 30 seconds ', ' as you require ').replace(' color="red"', ' color="blue"');
}, 30000);
} else {
parent.document.getElementById('mytopspan').innerHTML='<font color=blue>Please unmute as required ... </font>' + mytos;
}
}
}
} catch(xfghgf) {
ivid=nextvidi;
setTimeout(function(){
sparedur='' + player.getDuration();
viddurs[ivid]='' + sparedur; //duration;
newdur='' + viddurs[ivid]
parent.document.getElementById('youtube_duration').value='' + '' + parent.document.getElementById('j' + ivid).value; // duration;
parent.document.getElementById('myh1').innerHTML='' + player.getVideoData().title;
newtitle='' + parent.document.getElementById('myh1').innerHTML;
//alert('4:' + sparedur + ' newtitle=' + newtitle + ' beenbefore=' + beenbefore);
if (!beenbefore) {
top.document.getElementById('divtitles').innerHTML+='<span>' + newstart + '|' + newvid + '#' + newtitle.replace(/\&\;/g,'and').replace(/\ \&\ /g,' and ') + '</span>';
parent.fixdoc('' + ivid, '' + ('' + newdos).replace('false','off').replace('true','on') + '#' + newstart + '|' + newvid + '#' + newdur + '#' + newtitle);
} else if (newstart != wasstart || newvid != wasvid || newtitle != wastitle) {
top.document.getElementById('divtitles').innerHTML=top.document.getElementById('divtitles').innerHTML.replace(wasvid, 'cannotenda2');
top.document.getElementById('divtitles').innerHTML+='<span>' + newstart + '|' + newvid + '#' + newtitle.replace(/\&\;/g,'and').replace(/\ \&\ /g,' and ') + '</span>';
parent.fixdoc('' + ivid, '' + ('' + newdos).replace('false','off').replace('true','on') + '#' + newstart + '|' + newvid + '#' + newdur + '#' + newtitle);
}
}, 2000);
onethous=2500;
if (parent.document.getElementById('mytopspan')) { // && navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
mytos=parent.document.getElementById('mytopspan').innerHTML;
if (parent.document.getElementById('mytopspan').innerHTML.indexOf(' unmute ') == -1) {
if (('' + top.document.URL).indexOf('isradio=') != -1 && ('' + top.document.URL).indexOf('audioyoutube=') != -1 && nextvidi == 1) {
parent.document.getElementById('mytopspan').innerHTML='<font color=red>Please unmute within 30 seconds ... </font>' + mytos;
setTimeout(function(){
parent.document.getElementById('mytopspan').innerHTML=parent.document.getElementById('mytopspan').innerHTML.replace(' within 30 seconds ', ' as you require ').replace(' color="red"', ' color="blue"');
}, 30000);
} else {
parent.document.getElementById('mytopspan').innerHTML='<font color=blue>Please unmute as required ... </font>' + mytos;
}
}
}
}
} else {
player.loadVideoById(vidarrv[nextvidi], eval('' + vidstarts[nextvidi]), eval(eval('' + viddurs[nextvidi]) - eval('' + vidstarts[nextvidi])));
}
ivid=nextvidi;

if (parent.document.getElementById('shufflechk')) {
if (!parent.document.getElementById('shufflechk').checked) {
nextvidi++;
if (eval('' + viddurs.length) <= nextvidi) {
nextvidi=0;
}
} else {
nextvidi=Math.floor(Math.random() * eval('' + viddurs.length));
}
} else {
nextvidi++;
if (eval('' + viddurs.length) <= nextvidi) {
nextvidi=0;
}
}

}
}
setTimeout(playingvideo, onethous);
return '';
}

inplaying=true;
// rest of function playingvideo() as before ...
// end of function playingvideo()
}

… in …


Previous relevant Tabular Single Row YouTube API Radio Play Tutorial is shown below.

Tabular Single Row YouTube API Radio Play Tutorial

Tabular Single Row YouTube API Radio Play Tutorial

Today, we’re back to the Tabular Single Row Media Gallery ideas regarding the web application of the recent Tabular Single Row Textarea Sharing Tutorial and we’re involving more “button innards” thinking, with respect to adding onto the pre-existing …

  • radio play with YouTube audio stream only non-mobile platform incarnation … involving textarea usage … with, today, after getting the YouTube API inhouse web application, better attuned to …
  • radio play with YouTube audio stream only mobile platform incarnation … and …
  • radio play with YouTube video play on non-mobile platform incarnation … and …
  • radio play with YouTube video play on mobile platform incarnation

… additional functionalities allowing for …

  • looping (though the total list) … default for “radio play” …
  • shuffling … non-default …
  • individual YouTube video checkbox user control can end a song before it’s finish
  • recognition of individual YouTube video checkbox user control as above (can mean an individual song can be looped or deliberately ignored)
  • saving the playlist for user recall on the same web browser

… functionalities within those three new incarnations. We could organize the first to use the YouTube API in that “vertical in the one table cell, with checkboxes” way, too, but see the textareas of different interest in an ongoing sense. We’ll see whether we offer that YouTube API approach in a future release?!

Codewise, this involved …


Previous relevant Tabular Single Row Textarea Sharing Tutorial is shown below.

Tabular Single Row Textarea Sharing Tutorial

Tabular Single Row Textarea Sharing Tutorial

Yesterday’s Tabular Single Row Radio Play Tutorial‘s web application has two interesting features …

  • lots of use of textarea element placeholder attribute for explaining more complex data entry scenarios … and as of today …
  • a button element with the potential that it’s “innards” (ie. it’s innerHTML) is filled by a dropdown (ie. select element)

… it being our first time trying any HTML button element “innards” that were not always straight text. Is this the “comboBox” style of arrangement we used to see with desktop application GUIs and have long wished to simulate the usefulness of, online?!

Well, we’re not quite sure, but we think we’re going to look into it more into the future. So, what are we storing in this dropdown? We’re offering the user the chance … over to you code


document.getElementById('inp' + potlist[jwq] + '_' + document.getElementById(potlist[jwq]).target).title+='Entries starting with _ can describe ... ' + String.fromCharCode(10) + String.fromCharCode(10);
document.getElementById('inp' + potlist[jwq] + '_' + document.getElementById(potlist[jwq]).target).title+=' Comma separated audio stream only list of your own recallable YouTube IDs playlist' + String.fromCharCode(10);
document.getElementById('inp' + potlist[jwq] + '_' + document.getElementById(potlist[jwq]).target).title+=' Semicolon separated video list of your own recallable YouTube IDs playlist' + String.fromCharCode(10);
document.getElementById('inp' + potlist[jwq] + '_' + document.getElementById(potlist[jwq]).target).title+=' One of these inhouse playlist names above which start with tube' + perusedlist + String.fromCharCode(10);
document.getElementById('inp' + potlist[jwq] + '_' + document.getElementById(potlist[jwq]).target).title+=' YouTube Playlist 34 character identifier' + String.fromCharCode(10);
document.getElementById('inp' + potlist[jwq] + '_' + document.getElementById(potlist[jwq]).target).title+=' Spotify Playlist 22 character identifier' + String.fromCharCode(10);
document.getElementById('inp' + potlist[jwq] + '_' + document.getElementById(potlist[jwq]).target).title+=' Sundry _email _sms _saverecall _http://youtube.com#example' + String.fromCharCode(10);
document.getElementById('inp' + potlist[jwq] + '_' + document.getElementById(potlist[jwq]).target).ondblclick=function(event){ alert(event.target.title); };

… culminating in this new Javascript function …


function underscoresystem(inans, inota) {
var anchor=null, subjh='?subject=Hello';
var outans=inans;
var ytpllen=34; //eval('' + ('PLNtJQ2eJVoAMFocY7LOANvPH3cLyUonin').length);
var onevlen=11;
var sppllen=22;
var inhouse='';
var rperson='';
var mperson='';
var tperson='';
var jnota=inota;
if (outans.trim() != '') {
if (outans.toLowerCase().indexOf('mailto') == 0 || outans.toLowerCase().indexOf('email') == 0 || outans.toLowerCase().indexOf('sms') == 0 || outans.toLowerCase().indexOf('http') == 0 || outans.toLowerCase().indexOf('//') == 0 || outans.toLowerCase().indexOf('www.') == 0 || outans.toLowerCase().indexOf('save') == 0 || outans.toLowerCase().indexOf('recall') == 0) {
outans='_' + inans;
}
if (outans.replace(/^tube/g,'_').substring(0,1) == '_') {
subjh='?subject=' + encodeURIComponent('' + document.title + ' regarding ' + document.URL);
if (inota) {
if (document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target)) {
jnota=document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target);
}
}
if (('' + top.document.URL).indexOf('/swipe_media.htm') != -1) {
subjh='?subject=' + encodeURIComponent('' + document.title + ' regarding ' + document.URL);
if (('' + top.document.URL).indexOf('youtube=') != -1) {
if (('' + top.document.URL).indexOf('audioyoutube=') != -1 && ('' + top.document.URL).indexOf('isradio=') != -1) {
tperson='tuberadioapl_';
} else if (('' + top.document.URL).indexOf('youtube=') != -1 && ('' + top.document.URL).indexOf('isradio=') != -1) {
tperson='tuberadiovpl_';
} else if (('' + top.document.URL).indexOf('audioyoutube=') != -1 && ('' + top.document.URL).indexOf('isradio=') == -1) {
tperson='tubeapl_';
} else {
tperson='tubevpl_';
}
}
} else if ((outans + ' ').substring(0,4) == '____') {
tperson='tuberadioapl_';
outans=outans.replace(/^\_\_\_\_/g,'_');
} else if ((outans + ' ').substring(0,3) == '___') {
tperson='tuberadiovpl_';
outans=outans.replace(/^\_\_\_/g,'_');
} else if ((outans + ' ').substring(0,2) == '__') {
tperson='tubeapl_';
outans=outans.replace(/^\_\_/g,'_');
}
if (outans.indexOf('_recall') == 0 || outans.indexOf('_save') == 0) {
newlsval=tperson + ( ('' + Math.floor(Math.random() * 19897654)) + ('' + Math.floor(Math.random() * 19897654)) + ('' + Math.floor(Math.random() * 19897654)) + '000000000000000000000000000').substring(0,27);
if (perusedlist == '') { perusedlist=' ( and we found )'; }
perusedlist=perusedlist.replace(' )', ' ' + newlsval + ' )');
lastbize(newlsval, document.URL);
window.localStorage.setItem(newlsval, encodeURIComponent(document.URL));
jnota.title+=' ... for future recall reenter in web browser similar textarea playlist name ' + newlsval;
outans='';
if (inota) {
if (document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target)) {
jnota=document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target);
}
jnota.value='';
}
if (document.getElementById('recallable')) {
document.getElementById('recallable').innerHTML=newlsval;
document.getElementById('recallable').style.visibility='visible';
lastrecall=maybeselize(document.URL,lastrecall,newlsval);
}
newlsval='';

} else if (outans.toLowerCase().indexOf('_mailto') == 0 || outans.toLowerCase().indexOf('_email') == 0) {
anchor = document.createElement('a');
if (outans.toLowerCase().replace('_email','_mailto').indexOf('mailto:') != -1 && (outans.toLowerCase().trim() + '?').replace('_email','_mailto').indexOf('mailto:?') == -1) {
anchor.href = 'mailto:' + (outans.toLowerCase().trim() + '?').replace('_email','_mailto').split('mailto:')[1].split('?')[0] + subjh + '&body=' + encodeURIComponent(document.URL);
} else {
anchor.href = 'mailto:' + subjh + '&body=' + encodeURIComponent(document.URL);
}
anchor.style.display='none';
document.body.appendChild(anchor);
anchor.innerHTML='Email';
anchor.target='_top';
anchor.click();
outans='';
if (inota) {
if (document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target)) {
jnota=document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target);
}
jnota.value='';
}

} else if (outans.toLowerCase().indexOf('_sms') == 0) {
subjh='';
anchor = document.createElement('a');
if (outans.toLowerCase().indexOf('sms:') != -1 && (outans.toLowerCase().trim().replace('&','?') + '?').indexOf('sms:?') == -1) {
anchor.href = 'sms:' + (outans.toLowerCase().trim().replace('&','?') + '?').split('sms:')[1].split('?')[0] + subjh + '&body=' + encodeURIComponent(document.URL);
} else {
anchor.href = 'sms:' + subjh + '&body=' + encodeURIComponent(document.URL);
}
anchor.style.display='none';
document.body.appendChild(anchor);
anchor.innerHTML='SMS';
anchor.target='_top';
anchor.click();
outans='';
if (inota) {
if (document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target)) {
jnota=document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target);
}
jnota.value='';
}


} else if (outans.toLowerCase().indexOf('_http') == 0) {
window.open(outans.substring(5).replace(/^s/g,'').replace(/^\:/g,''), '_blank', 'top=50,left=50,width=500,height=500');
outans='';
if (inota) {
if (document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target)) {
jnota=document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target);
}
jnota.value='';
}


} else if (outans.toLowerCase().indexOf('_//') == 0) {
window.open(outans.substring(1), '_blank', 'top=50,left=50,width=500,height=500');
outans='';
if (inota) {
if (document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target)) {
jnota=document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target);
}
jnota.value='';
}


} else if (outans.toLowerCase().indexOf('_www') == 0) {
window.open('//' + outans.substring(1), '_blank', 'top=50,left=50,width=500,height=500');
outans='';
if (inota) {
if (document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target)) {
jnota=document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target);
}
jnota.value='';
}

} else if (outans.indexOf(',') != -1) { // tuberadioapl_
if (eval(eval('' + outans.replace(/\,/g,'').replace(/\;/g,'').length) % 11) == 1) {
if (tperson == '') { tperson='tubeapl_'; }
newlsval=tperson + ( ('' + Math.floor(Math.random() * 19897654)) + ('' + Math.floor(Math.random() * 19897654)) + ('' + Math.floor(Math.random() * 19897654)) + '000000000000000000000000000').substring(0,27);
if (perusedlist == '') { perusedlist=' ( and we found )'; }
perusedlist=perusedlist.replace(' )', ' ' + newlsval + ' )');
lastbize(newlsval, outans.substring(1).replace(/\;/g,','));
window.localStorage.setItem(newlsval, encodeURIComponent(outans.substring(1).replace(/\;/g,',')));
if (inota) {
jnota.title+=' ... for future recall reenter in this web browser similar textarea playlist name ' + newlsval;
}
return underscoresystem(newlsval, inota);
} else if (eval(eval('' + outans.replace(/\;/g,'').replace(/\,/g,'').length) % 11) == 0) {
if (tperson == '') { tperson='tuberapl_'; }
newlsval=tperson + ( ('' + Math.floor(Math.random() * 19897654)) + ('' + Math.floor(Math.random() * 19897654)) + ('' + Math.floor(Math.random() * 19897654)) + '000000000000000000000000000').substring(0,27);
if (perusedlist == '') { perusedlist=' ( and we found )'; }
perusedlist=perusedlist.replace(' )', ' ' + newlsval + ' )');
lastbize(newlsval, outans.substring(0).replace(/\;/g,','));
window.localStorage.setItem(newlsval, encodeURIComponent(outans.substring(0).replace(/\;/g,',')));
if (inota) {
jnota.title+=' ... for future recall reenter in web browser similar textarea playlist name ' + newlsval;
}
return underscoresystem(newlsval, inota);
}
} else if (outans.indexOf(';') != -1) { // tuberadiovpl_
if (eval(eval('' + outans.replace(/\;/g,'').replace(/\,/g,'').length) % 11) == 1) {
if (tperson == '') { tperson='tubevpl_'; }
newlsval=tperson + ( ('' + Math.floor(Math.random() * 19897654)) + ('' + Math.floor(Math.random() * 19897654)) + ('' + Math.floor(Math.random() * 19897654)) + '000000000000000000000000000').substring(0,27);
if (perusedlist == '') { perusedlist=' ( and we found )'; }
perusedlist=perusedlist.replace(' )', ' ' + newlsval + ' )');
window.localStorage.setItem(newlsval, encodeURIComponent(outans.substring(1).replace(/\;/g,',')));
lastbize(newlsval, outans.substring(1).replace(/\;/g,','));
if (inota) {
jnota.title+=' ... for future recall reenter in web browser similar textarea playlist name ' + newlsval;
}
return underscoresystem(newlsval, inota);
} else if (eval(eval('' + outans.replace(/\;/g,'').replace(/\,/g,'').length) % 11) == 0) {
if (tperson == '') { tperson='tubevpl_'; }
newlsval=tperson + ( ('' + Math.floor(Math.random() * 19897654)) + ('' + Math.floor(Math.random() * 19897654)) + ('' + Math.floor(Math.random() * 19897654)) + '000000000000000000000000000').substring(0,27);
if (perusedlist == '') { perusedlist=' ( and we found )'; }
perusedlist=perusedlist.replace(' )', ' ' + newlsval + ' )');
window.localStorage.setItem(newlsval, encodeURIComponent(outans.substring(0).replace(/\;/g,',')));
lastbize(newlsval, outans.substring(0).replace(/\;/g,','));
if (inota) {
jnota.title+=' ... for future recall reenter in web browser similar textarea playlist name ' + newlsval;
}
return underscoresystem(newlsval, inota);
}
} else {
switch ('' + eval('' + outans.length)) {
case '23':
outans=outans.replace(/^\_/g,'');
case '22':
window.open('//open.spotify.com/playlist/' + outans,'_blank'); //,'top=0,left=0,width=" + screen.width + ",height=" + screen.height);
outans='';
if (inota) {
if (document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target)) {
jnota=document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target);
}
jnota.value='';
}
break;


case '35':
outans=outans.replace(/^\_/g,'');
case '34':
window.open('//www.youtube.com/playlist?list=' + outans,'_blank'); //,'top=0,left=0,width=" + screen.width + ",height=" + screen.height);
outans='';
if (inota) {
if (document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target)) {
jnota=document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target);
}
jnota.value='';
}
break;


case '12':
outans=outans.replace(/^\_/g,'');
case '11':
if (('' + top.document.URL).indexOf('youtube=') != -1) {
top.location.href=top.document.URL.split('youtube=')[0] + 'youtube=' + outans;
outans='';
if (inota) {
if (document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target)) {
jnota=document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target);
}
jnota.value='';
}
} else {
underscorewo=window.open("//www.rjmprogramming.com.au/HTMLCSS/karaoke_youtube_api.htm?youtubeid=" + outans + "&justaJUNKudio=&youtube_duration=22234.0&email=&emoji=on&c0=off&i0=0&j0=22234&i1=&j1=&i2=&j2=&i3=&j3=&i4=&j4=&i5=&j5=&i6=&j6=&i7=&j7=&i8=&j8=&i9=&j9=&i10=&j10=&i11=&j11=&i12=&j12=&i13=&j13=&i14=&j14=&i15=&j15=&i16=&j16=&i17=&j17=&i18=&j18=&i19=&j19=&i20=&j20=&i21=&j21=&i22=&j22=&i23=&j23=&i24=&j24=&i25=&j25=&i26=&j26=&i27=&j27=&i28=&j28=&i29=&j29=","_blank","top=10,left=10,width=800,height=800");
outans='';
if (inota) {
if (document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target)) {
jnota=document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target);
jnota.value='';
}
}
}
break;


default:
if (outans.toLowerCase().indexOf('_tube') == 0) { outans=outans.replace(/^\_/g,''); }
if (outans.toLowerCase().indexOf('tuberadiovpl_') == 0) {
inhouse=('' + window.localStorage.getItem(outans)).replace(/^undefined/g,'').replace(/^null/g,'');
newlsval='';
} else if (outans.toLowerCase().indexOf('tuberadioapl_') == 0) {
inhouse=('' + window.localStorage.getItem(outans)).replace(/^undefined/g,'').replace(/^null/g,'');
newlsval='';
} else if (outans.toLowerCase().indexOf('tuberadiopl_') == 0) {
inhouse=('' + window.localStorage.getItem(outans)).replace(/^undefined/g,'').replace(/^null/g,'');
newlsval='';
} else if (outans.toLowerCase().indexOf('tubeapl_') == 0) {
inhouse=('' + window.localStorage.getItem(outans)).replace(/^undefined/g,'').replace(/^null/g,'');
newlsval='';
} else if (outans.toLowerCase().indexOf('tubevpl_') == 0) {
inhouse=('' + window.localStorage.getItem(outans)).replace(/^undefined/g,'').replace(/^null/g,'');
newlsval='';
} else if (outans.toLowerCase().indexOf('tubepl_') == 0) {
inhouse=('' + window.localStorage.getItem(outans)).replace(/^undefined/g,'').replace(/^null/g,'');
newlsval='';
} else if (eval('' + outans.length) == 28) {
inhouse=('' + window.localStorage.getItem('tubepl_' + outans.replace(/^\_/g,''))).replace(/^undefined/g,'').replace(/^null/g,'');
if (inhouse == '') {
inhouse=('' + window.localStorage.getItem('tubevpl_' + outans.replace(/^\_/g,''))).replace(/^undefined/g,'').replace(/^null/g,'');
}
if (inhouse == '') {
mperson='audio'
inhouse=('' + window.localStorage.getItem('tubeapl_' + outans.replace(/^\_/g,''))).replace(/^undefined/g,'').replace(/^null/g,'');
}
if (inhouse == '') {
mperson='isradio=y&audio'
inhouse=('' + window.localStorage.getItem('tuberadioapl_' + outans.replace(/^\_/g,''))).replace(/^undefined/g,'').replace(/^null/g,'');
}
if (inhouse == '') {
mperson='isradio=y&'
inhouse=('' + window.localStorage.getItem('tuberadiovpl_' + outans.replace(/^\_/g,''))).replace(/^undefined/g,'').replace(/^null/g,'');
}
} else if (eval('' + outans.length) == 27) {
inhouse=('' + window.localStorage.getItem('tubepl_' + outans)).replace(/^undefined/g,'').replace(/^null/g,'');
if (inhouse == '') {
inhouse=('' + window.localStorage.getItem('tubevpl_' + outans)).replace(/^undefined/g,'').replace(/^null/g,'');
}
if (inhouse == '') {
mperson='audio'
inhouse=('' + window.localStorage.getItem('tubeapl_' + outans)).replace(/^undefined/g,'').replace(/^null/g,'');
}
if (inhouse == '') {
inhouse=('' + window.localStorage.getItem('tuberadioapl_' + outans)).replace(/^undefined/g,'').replace(/^null/g,'');
}
if (inhouse == '') {
mperson='isradio=y&'
inhouse=('' + window.localStorage.getItem('tuberadiovpl_' + outans)).replace(/^undefined/g,'').replace(/^null/g,'');
}
}
if (inhouse.trim() != '') {
if (decodeURIComponent(inhouse).toLowerCase().indexOf('rjmprogramming.com.au') != -1) {
if (!inota) { return decodeURIComponent(inhouse) + '#' + outans; }
underscorewo=window.open(inhouse + '#' + outans,"_blank","top=0,left=0,width=" + screen.width + ",height=" + screen.height);
outans='';
if (document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target)) {
jnota=document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target);
jnota.value='';
}
} else {
if (!inota) { return "//www.rjmprogramming.com.au/HTMLCSS/swipe_media.html?" + mperson + "youtube=" + encodeURIComponent(decodeURIComponent(inhouse)) + "#" + outans; }
underscorewo=window.open("//www.rjmprogramming.com.au/HTMLCSS/swipe_media.html?" + mperson + "youtube=" + encodeURIComponent(decodeURIComponent(inhouse)) + "#" + outans,"_blank","top=0,left=0,width=" + screen.width + ",height=" + screen.height);
outans='';
if (document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target)) {
jnota=document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target);
jnota.value='';
}
}
}
break;
}
}
}
}
return outans;
}

Yes, the placeholder was struggling with what we wanted to offer as functionality, so we’re putting more into the textarea title attribute. These options allow users to create their own recallable playlists or access existant YouTube or Spotify ones to keep the music rolling in changed swipe_media.html Tabular Single Row Media Gallery helped out by ytaudioonly.js external Javascript helper.


Previous relevant Tabular Single Row Radio Play Tutorial is shown below.

Tabular Single Row Radio Play Tutorial

Tabular Single Row Radio Play Tutorial

We do not expect many readers to have thought yesterday’s YouTube Audio Only Mobile Looping Tutorial that little bit different. It was long in the making, and difficult (at least for us), but a brief tutorial. Too brief for interested parties, and we intended it as a seminal discussion, but it’s meaning got subsumed, if you will, with the goings on of the blog posting thread last talked about with the day before’s Tabular Single Row Image Gallery Linking Tutorial.

You see, the YouTube audio stream only inhouse looping control is an essential thing we needed to tie down for today’s progress in this blog posting thread, that being the first incarnation of …

Radio Play

… sequenced modes of play we’re offering today, as a start, for …

  • non-mobile users
  • using audio stream only button option clicks

So what was (most) …

difficult (at least for us)

… about getting this first Radio Play idea happening? In a word …

Focus

You find yourself wanting to do lots of …


[element].click();

… and …


[element].blur();

… types of work, which work best with focus (and boy, did we need to “focus”?!) We’ve minimised this where we could, but what we highly recommend users of this functionality doing is …

  • be presented with the solo web browser full screen (initial) window with the radio emoji
  • click desired first song link when the song link emojis appear … then …
  • it’s best to make this window small and away from other web browser windows but not overlapping for the best chance of …
  • songs play in sequence and loop back through the list

… within changed swipe_media.html Tabular Single Row Media Gallery helped out by ytaudioonly.js external Javascript helper.


Previous relevant Tabular Single Row Image Gallery Linking Tutorial is shown below.

Tabular Single Row Image Gallery Linking Tutorial

Tabular Single Row Image Gallery Linking Tutorial

After yesterday’s Tabular Single Row YouTube Audio or Video Buttons Tutorial work mainly regarding audio and video media, today we return to those …

  • background WordPress Blog random tutorial images … and link them via a modified 404.php creator’s …
    <?php

    if (strpos(('?' . $_SERVER['QUERY_STRING']), '?rand=') !== false) {
    $huht=@file_get_contents('http://www.rjmprogramming.com.au/HTMLCSS/select_palette.php?putrandom=' . urlencode('?rand=' . $_GET['rand'] . '.' . $pnumis . $ptitle));
    }

    ?>
    … calling on …
  • a modified select_palette.php helper …
    <?php

    if (isset($_GET['putrandom'])) {
    $contis=str_replace(' ','++',str_replace('+',' ',urldecode($_GET['putrandom']))) . "\n";
    $xcurgmt=gmdate("Ymd");
    if (!file_exists($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'media_gallery_swipe_' . $xcurgmt . '.htm')) {
    foreach (glob($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'media_gallery_swipe_' . '*.htm') as $dfilename) {
    unlink($dfilename);
    }
    file_put_contents($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'media_gallery_swipe_' . $xcurgmt . '.htm', $contis);
    } else {
    file_put_contents($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'media_gallery_swipe_' . $xcurgmt . '.htm', file_get_contents($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'media_gallery_swipe_' . $xcurgmt . '.htm') . $contis);
    }
    exit;
    } else if (isset($_GET['getrandom'])) {
    $xcurgmt=gmdate("Ymd");
    $imode=0;
    $contis="";
    $idp="";
    $jdp="";
    $pfix="";
    $sfix="";
    if (file_exists($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'media_gallery_swipe_' . $xcurgmt . '.htm')) {
    $contis=file_get_contents($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'media_gallery_swipe_' . $xcurgmt . '.htm');
    if (strlen($_GET['getrandom']) > 0) {
    $relstuffs=explode(str_replace(' ','++',str_replace('+',' ',strtolower(urldecode($_GET['getrandom'])))) . '.', $contis);
    if (sizeof($relstuffs) > 1) {
    $isub=0;
    $jdp=str_replace('rand=','',str_replace(' ','++',str_replace('+',' ',strtolower(urldecode($_GET['getrandom'])))));
    $imode=1;
    while (substr(substr($relstuffs[-1 + sizeof($relstuffs)],$isub),0,1) >= '0' && substr(substr($relstuffs[-1 + sizeof($relstuffs)],$isub),0,1) <= '9') {
    if ($imode == 0) {
    $jdp.=substr(substr($relstuffs[-1 + sizeof($relstuffs)],$isub),0,1);
    } else {
    $idp.=substr(substr($relstuffs[-1 + sizeof($relstuffs)],$isub),0,1);
    }
    $isub++;
    if (substr(substr($relstuffs[-1 + sizeof($relstuffs)],$isub),0,1) == '.') {
    $imode=1;
    $isub++;
    }
    }
    if (isset($_GET['via'])) {
    $pfix=" if (parent.document.getElementById('" . $_GET['via'] . "')) { parent.document.getElementById('" . $_GET['via'] . "').style.width='100%;'; parent.document.getElementById('" . $_GET['via'] . "').innerHTML+='<iframe style=width:100%;height:800px; src=!!!></iframe>'; } else { ";
    $sfix=" } ";
    }
    if (strtolower(urldecode($_GET['getrandom'])) != urldecode($_GET['getrandom'])) { // Cut to the Chase
    echo "<html><body onload=\"" . str_replace('!!!','/slideshow.html?title=' . explode(" (", explode("\n", explode('=' . $jdp . '.' . $idp, $contis)[1])[0])[0],$pfix) . " parent.window.open('/slideshow.html?title=" . explode(" (", explode("\n", explode('=' . $jdp . '.' . $idp, $contis)[1])[0])[0] . " " . $sfix . " ','_blank','top=200,left=200,width=600,height=600');\"></body></html>";
    exit;
    } else { // WordPress Blog Posting
    echo "<html><body onload=\"" . str_replace('!!!','/ITblog/?p=' . $idp . '#content',$pfix) . " parent.window.open('/ITblog/?p=" . $idp . "#content','_blank','top=200,left=200,width=600,height=600'); " . $sfix . " \"></body></html>";
    exit;
    }
    }
    }
    }
    echo "<html><body><pre>" . $contis . '</pre></body></html>';
    exit;
    }

    ?>
    … called at the parent window by …
  • changed swipe_media.html Tabular Single Row Media Gallery

    function checkmeout(evt, iscuttothechase) {
    if (evt.target.outerHTML.split('>')[0].indexOf('url(') != -1) {
    if (evt.target.outerHTML.split('>')[0].split('url(')[1].split(')')[0].indexOf('?rand=') != -1) {
    if (iscuttothechase) {
    document.getElementById('sparepal').src='/HTMLCSS/select_palette.php?getrandom=' + encodeURIComponent('RAND=' + evt.target.outerHTML.split('>')[0].split('url(')[1].split(')')[0].split('?rand=')[1].split("'")[0].split('"')[0].split(')')[0].split('"')[0]); // + ('&viJUNKa=' + evt.target.id).replace('td','div')
    } else {
    document.getElementById('sparepal').src='/HTMLCSS/select_palette.php?getrandom=' + encodeURIComponent('rand=' + evt.target.outerHTML.split('>')[0].split('url(')[1].split(')')[0].split('?rand=')[1].split("'")[0].split('"')[0].split(')')[0].split('"')[0]); // + ('&viJUNKa=' + evt.target.id).replace('td','div')
    }
    }
    }
    }

… web application, now accepting …

  1. click on one of these WordPress Blog random tutorial images to open window to relevant WordPress Blog posting … or …
  2. right click on one of these WordPress Blog random tutorial images to open window to relevant Cut to the Chase web application or presentation media regarding that blog posting above


Previous relevant Tabular Single Row YouTube Audio or Video Gallery Tutorial is shown below.

Tabular Single Row YouTube Audio or Video Gallery Tutorial

Tabular Single Row YouTube Audio or Video Gallery Tutorial

Today we’ve connected …

… which now have three new functionality options …

  • <–> … link to align the (previously) “Brady Bunch” YouTube iframes into a single row in the same web browser tab
  • <–>A+V … call of yesterday’s Media Gallery web application playing our “inhouse” YouTube iframe video playing web application in a new web browser tab
  • <–>A-V … link to our “inhouse” audio stream only YouTube iframe playing functionality in a new web browser tab

… involving changes to …

  • our changed

    var ytlist='';

    if (('' + document.URL + ('' + location.hash)).indexOf('onerow=') != -1) {
    setTimeout(function(){
    var inis='';
    var iwis=document.getElementById('vplayer1').getBoundingClientRect().width;
    var ifsare=document.getElementsByTagName('iframe');
    for (var jtt=0; jtt<ifsare.length; jtt++) {
    //alert(ifsare[jtt].src);
    if (ifsare[jtt].src.indexOf('/embed/') != -1) {
    if (ytlist == '') {
    ytlist='' + ifsare[jtt].src.split('/embed/')[1].substring(0,11);
    } else {
    ytlist+=',' + ifsare[jtt].src.split('/embed/')[1].substring(0,11);
    }
    }
    ifsare[jtt].style.width='' + iwis + 'px';
    }
    var toho=document.getElementsByTagName('table')[0];
    var tih=toho.innerHTML;
    var newtih=tih;
    //alert(tih);
    var thingos=tih.split('<tr');
    for (var itt=3; itt>=1; itt--) {
    if (itt == 1) {
    inis='<tr' + thingos[itt].split('</tr>')[0] + '</tr>';
    newtih=newtih.replace(inis, inis.replace('</tr>','<!--/tr-->'));
    } else if (itt == 3) {
    inis='<tr' + thingos[itt].split('</tr>')[0] + '</tr>';
    newtih=newtih.replace(inis, inis.replace('<tr>','<!--tr-->'));
    } else {
    inis='<tr' + thingos[itt].split('</tr>')[0] + '</tr>';
    newtih=newtih.replace(inis, inis.replace('<tr>','<!--tr-->').replace('</tr>','<!--/tr-->'));
    }
    }
    toho.innerHTML=newtih;
    toho.style.width='1000%';
    }, 4000);
    }

    setTimeout(function(){
    var antwo='';
    if (ytlist == '') {
    var ifsare=document.getElementsByTagName('iframe');
    for (var jtt=0; jtt<ifsare.length; jtt++) {
    //alert(ifsare[jtt].src);
    if (ifsare[jtt].src.indexOf('/embed/') != -1) {
    if (ytlist == '') {
    ytlist='' + ifsare[jtt].src.split('/embed/')[1].substring(0,11);
    } else {
    ytlist+=',' + ifsare[jtt].src.split('/embed/')[1].substring(0,11);
    }
    }
    }
    }
    if (ytlist != '') {
    antwo+=' <a title="Audio and video plays of YouTube videos" target=_blank href="/HTMLCSS/swipe_media.html?youtube=' + encodeURIComponent(ytlist) + '"><--><sup>A+V</sup></a>';
    antwo+=' <a title="Audio only plays of YouTube videos" target=_blank href="/HTMLCSS/swipe_media.html?audioyoutube=' + encodeURIComponent(ytlist) + '"><--><sub>A-V</sub></a>';
    }
    if (document.URL.indexOf('?') != -1) {
    document.getElementById('wshuffle').innerHTML+=' <a title="Present in one table row" target=_self href="' + document.URL.replace('?', '?onerow=' + Math.floor(Math.random() * 1989786)) + '"><--></a>' + antwo + ' ';
    } else {
    document.getElementById('wshuffle').innerHTML+=' <a title="Present in one table row" target=_self href="' + document.URL + '?onerow=' + Math.floor(Math.random() * 1989786) + '"><--></a>' + antwo + ' ';
    }
    }, 9000);

    youtube_brady_bunch.js being used in our inhouse Disco web application “peer to peer suite” web application “grandparent” level example …
  • “second draft” swipe_media.html Tabular Single Row Image Gallery web application


Previous relevant Tabular Single Row Image Gallery Primer Tutorial is shown below.

Tabular Single Row Image Gallery Primer Tutorial

Tabular Single Row Image Gallery Primer Tutorial

“Tabular Single Row Image Gallery” …

Smabular Single Row Image Gallery

… we’re sure is the reaction of some readers out there, to today’s “starting draft” for an idea we had. Today’s part of the jigsaw we want to explore may be “ho hum” and “so non-mobile”, but we’re hoping the thread appeals to more modern ideas as we go along.

So much for the apologies, and so let’s now look at the basis to this start …

  • media (so far just image) …
  • gallery … presented in …
  • table … HTML element … in …
  • single tr row
  • deliberately overflowing to the right of the screen view of the webpage … and so …
  • scrollable (ie. window scrollable) to … those right hand parts …
  • only “media loaded” …
  • as “scrolled to” or “stumbled upon”

So far the window scrollable detection goes (thanks to this useful link) …


window.onscroll = function (e) {
// called when the window is scrolled.
vspos4=document.body.scrollTop;
vspos3=document.body.scrollLeft;
var vstdn=Math.ceil(eval('' + vspos3) / eval('' + amin));
if (curtdn != vstdn) {
checkthen(vstdn);
}
}

… and the CSS produced “wording (ie. non-media) content” is produced down the bottom left of “inhouse WordPress Blog image cell background” ( possible because of background-size:contain ) we think is interesting …


<style>
td {
border: 1px dotted green;
}

.inhouse {
vertical-align: bottom;
padding-bottom: 20px;
}

.inhouse::after {
content: 'Media Gallery \a RJM Programming \a August, 2025 \a Thanks to Lorem Picsum at https://picsum.photos/ \a ' attr(alt);
white-space: pre-wrap;
}

</style>

… in a “first draft” Tabular Single Row Image Gallery web application for your perusal. Thanks to Lorem Picsum regarding, as so often happens for us, when we’d like beautiful random images to be involved with web applications!

If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.

Posted in eLearning, Event-Driven Programming, Tutorials | Tagged , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , | Leave a comment

Tabular Single Row YouTube API Radio Play Textbox Tutorial

Tabular Single Row YouTube API Radio Play Textbox Tutorial

Tabular Single Row YouTube API Radio Play Textbox Tutorial

Apart from yesterday’s Tabular Single Row YouTube API Radio Play Tutorial‘s mainly HTML input type=checkbox means by which the user could control their YouTube video “Radio play” modes of use, there was one more aspect to user control we wanted to offer, that being to …


allow user to change a "Radio playlist" member in real time by changing the textboxes to the right of the individual checkboxes, primarily to enter in their own YouTube 11 character video identifier

… and have the software detect this event programmatically and update various aspects of that “Radio play” scenario.

This means, now, we can publish a more complete Javascript interventional snippet of code of relevance to yesterday’s and today’s work below …


function playingvideo() {
var mytos='', onethous=1000;
sparedur=-1;
beenbefore=true;
if (('' + parent.document.URL + 's').replace(/\#https/g,'') != ('' + parent.document.URL + 's')) {
//setTimeout(playingvideo, onethous);
var xvcen='';
if (eval('' + duration) <= 0) {
try {
duration='' + event.target.getDuration();
parent.document.getElementById('myh1').innerHTML='' + event.target.getVideoData().title;
setTimeout(function(){
parent.document.getElementById('youtube_duration').value='' + parent.document.getElementById('j' + ivid).value; // duration
}, 2000);
onethous=2500;
if (parent.document.getElementById('mytopspan')) { // && navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
mytos=parent.document.getElementById('mytopspan').innerHTML;
if (parent.document.getElementById('mytopspan').innerHTML.indexOf(' unmute ') == -1) {
if (('' + top.document.URL).indexOf('isradio=') != -1 && ('' + top.document.URL).indexOf('audioyoutube=') != -1 && nextvidi == 1) {
parent.document.getElementById('mytopspan').innerHTML='<font color=red>Please unmute within 30 seconds ... </font>' + mytos;
setTimeout(function(){
parent.document.getElementById('mytopspan').innerHTML=parent.document.getElementById('mytopspan').innerHTML.replace(' within 30 seconds ', ' as you require ').replace(' color="red"', ' color="blue"');
}, 30000);
} else {
parent.document.getElementById('mytopspan').innerHTML='<font color=blue>Please unmute as required ... </font>' + mytos;
}
}
}
} catch(xfghgf) {
duration='' + player.getDuration();
setTimeout(function(){
parent.document.getElementById('myh1').innerHTML='' + player.getVideoData().title;
parent.document.getElementById('youtube_duration').value='' + '' + parent.document.getElementById('j' + ivid).value; // duration;
}, 2000);
onethous=2500;
if (parent.document.getElementById('mytopspan')) { // && navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
mytos=parent.document.getElementById('mytopspan').innerHTML;
if (parent.document.getElementById('mytopspan').innerHTML.indexOf(' unmute ') == -1) {
if (('' + top.document.URL).indexOf('isradio=') != -1 && ('' + top.document.URL).indexOf('audioyoutube=') != -1 && nextvidi == 1) {
parent.document.getElementById('mytopspan').innerHTML='<font color=red>Please unmute within 30 seconds ... </font>' + mytos;
setTimeout(function(){
parent.document.getElementById('mytopspan').innerHTML=parent.document.getElementById('mytopspan').innerHTML.replace(' within 30 seconds ', ' as you require ').replace(' color="red"', ' color="blue"');
}, 30000);
} else {
parent.document.getElementById('mytopspan').innerHTML='<font color=blue>Please unmute as required ... </font>' + mytos;
}
}
}
}
}
try {
xvcen='' + event.target.getCurrentTime();
} catch(xfghgf) {
xvcen='' + player.getCurrentTime();
}
var aswellas=0;
if (parent.document.getElementById('c' + ivid)) {
if (!parent.document.getElementById('c' + ivid).checked) {
aswellas=eval(1 + eval('' + duration));
}
}
var ipo=0;
var xxcen=eval(aswellas + eval('' + xvcen));
if (eval(1 + xxcen) >= eval('' + duration)) {
//alert('here RE ' + duration + ' stduration=' + stduration);
if (nextvidi >= 0) {
if (parent.document.getElementById('c' + nextvidi)) {
if (!parent.document.getElementById('c' + nextvidi).checked) {
ipo=0;
while (parent.document.getElementById('xx' + ipo)) {
parent.document.getElementById('xx' + ipo).style.backgroundColor='pink';
ipo++;
}
while (!parent.document.getElementById('c' + nextvidi).checked) {
if (parent.document.getElementById('shufflechk')) {
if (!parent.document.getElementById('shufflechk').checked) {
nextvidi++;
if (eval('' + viddurs.length) <= nextvidi) {
if (parent.document.getElementById('loopchk')) {
if (!parent.document.getElementById('loopchk').checked) {
nextvidi--;
player.stopVideo();
} else {
nextvidi=0;
}
} else {
nextvidi=0;
}
}
} else {
nextvidi=Math.floor(Math.random() * eval('' + viddurs.length));
}
} else {
nextvidi++;
if (eval('' + viddurs.length) <= nextvidi) {
if (parent.document.getElementById('loopchk')) {
if (!parent.document.getElementById('loopchk').checked) {
nextvidi--;
player.stopVideo();
} else {
nextvidi=0;
}
} else {
nextvidi=0;
}
}
}
}
}
}
if (eval('' + viddurs.length) <= nextvidi) {
nextvidi=0;
ipo=0;
while (parent.document.getElementById('xx' + ipo)) {
parent.document.getElementById('xx' + ipo).style.backgroundColor='pink';
ipo++;
}
if (parent.document.getElementById('xx' + nextvidi)) {
parent.document.getElementById('xx' + nextvidi).style.backgroundColor='lightgreen';
}
} else if (parent.document.getElementById('xx' + nextvidi)) {
if (parent.document.getElementById('shufflechk')) {
if (parent.document.getElementById('shufflechk').checked) {
ipo=0;
while (parent.document.getElementById('xx' + ipo)) {
parent.document.getElementById('xx' + ipo).style.backgroundColor='pink';
ipo++;
}
}
}
parent.document.getElementById('xx' + nextvidi).style.backgroundColor='lightgreen';
}
duration=-1;
wasno=('' + nextvidi);
wasdur=('' + viddurs[nextvidi]);
wasvid='' + vidarrv[nextvidi];
wasstart=('' + vidstarts[nextvidi]);
wasdos=viddos[nextvidi];
newdos=viddos[nextvidi];
newno=('' + nextvidi);
newdur=('' + viddurs[nextvidi]);
newvid='' + vidarrv[nextvidi];
newstart=('' + vidstarts[nextvidi]);
wastitle='';
newtitle='';
if (parent.document.getElementById('i' + nextvidi)) {
//alert(1);
if (eval('' + ('' + parent.document.getElementById('i' + nextvidi).value).length) >= 11 && parent.document.getElementById('i' + nextvidi).value.indexOf('' + vidarrv[nextvidi]) == -1) {
beenbefore=false;
//alert(11);
if (parent.document.getElementById('i' + nextvidi).value.indexOf('|') != -1) {
newstart=parent.document.getElementById('i' + nextvidi).value.split('|')[0];
vidstarts[nextvidi]='' + newstart;
newvid=parent.document.getElementById('i' + nextvidi).value.split('|')[1].split('#')[0];
vidarrv[nextvidi]='' + newvid;
} else {
newstart='0';
vidstarts[nextvidi]='' + newstart;
newvid=parent.document.getElementById('i' + nextvidi).value.split('#')[0];
vidarrv[nextvidi]='' + newvid;
}
if (parent.document.getElementById('c' + nextvidi)) {
if (parent.document.getElementById('c' + nextvidi).checked) {
newdos=true;
viddos[nextvidi]=true;
} else {
newdos=false;
viddos[nextvidi]=false;
}
}
}
}
if (top.document.getElementById('divtitles')) {
if (top.document.getElementById('divtitles').innerHTML.indexOf('|' + vidarrv[nextvidi] + '') == -1) {
//alert(111);
beenbefore=false;
}
}
//alert('1111 ' + viddurs[nextvidi] + ' beenbefore=' + beenbefore);
//if (('' + viddurs[nextvidi]) == '' || eval('0' + viddurs[nextvidi]) <= 0 || !beenbefore) {
//alert('changed');
//} else {
//alert('not changed');
//}
if (('' + viddurs[nextvidi]) == '' || eval('0' + viddurs[nextvidi]) <= 0 || !beenbefore) {
if (top.document.getElementById('divtitles')) {
if (top.document.getElementById('divtitles').innerHTML.indexOf('|' + viddurs[nextvidi] + '') != -1) {
if (top.document.getElementById('divtitles').innerHTML.indexOf('|' + viddurs[nextvidi] + '#') != -1) {
wastitle=top.document.getElementById('divtitles').innerHTML.split('|' + viddurs[nextvidi] + '#')[1].split('</')[0];
newtitle=wastitle;
}
}
}
player.loadVideoById(vidarrv[nextvidi], eval('' + vidstarts[nextvidi]), "large");
try {
ivid=nextvidi;
sparedur='' + event.target.getDuration();
//alert('3:' + sparedur);
viddurs[ivid]='' + sparedur;
newdur='' + viddurs[ivid];
setTimeout(function(){
parent.document.getElementById('myh1').innerHTML='' + event.target.getVideoData().title;
newtitle='' + event.target.getVideoData().title;
if (!beenbefore) {
top.document.getElementById('divtitles').innerHTML+='<span>' + newstart + '|' + newvid + '#' + newtitle.replace(/\&\;/g,'and').replace(/\ \&\ /g,' and ') + '</span>';
parent.fixdoc('' + ivid, '' + ('' + newdos).replace('false','off').replace('true','on') + '#' + newstart + '|' + newvid + '#' + newdur + '#' + newtitle);
} else if (newstart != wasstart || newvid != wasvid || newtitle != wastitle) {
top.document.getElementById('divtitles').innerHTML=top.document.getElementById('divtitles').innerHTML.replace(wasvid, 'cannotenda2');
top.document.getElementById('divtitles').innerHTML+='<span>' + newstart + '|' + newvid + '#' + newtitle.replace(/\&\;/g,'and').replace(/\ \&\ /g,' and ') + '</span>';
parent.fixdoc('' + ivid, '' + ('' + newdos).replace('false','off').replace('true','on') + '#' + newstart + '|' + newvid + '#' + newdur + '#' + newtitle);
}
parent.document.getElementById('youtube_duration').value='' + parent.document.getElementById('j' + ivid).value; // duration
}, 2000);
onethous=2500;
if (parent.document.getElementById('mytopspan')) { // && navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
mytos=parent.document.getElementById('mytopspan').innerHTML;
if (parent.document.getElementById('mytopspan').innerHTML.indexOf(' unmute ') == -1) {
if (('' + top.document.URL).indexOf('isradio=') != -1 && ('' + top.document.URL).indexOf('audioyoutube=') != -1 && nextvidi == 1) {
parent.document.getElementById('mytopspan').innerHTML='<font color=red>Please unmute within 30 seconds ... </font>' + mytos;
setTimeout(function(){
parent.document.getElementById('mytopspan').innerHTML=parent.document.getElementById('mytopspan').innerHTML.replace(' within 30 seconds ', ' as you require ').replace(' color="red"', ' color="blue"');
}, 30000);
} else {
parent.document.getElementById('mytopspan').innerHTML='<font color=blue>Please unmute as required ... </font>' + mytos;
}
}
}
} catch(xfghgf) {
ivid=nextvidi;
setTimeout(function(){
sparedur='' + player.getDuration();
viddurs[ivid]='' + sparedur; //duration;
newdur='' + viddurs[ivid]
parent.document.getElementById('youtube_duration').value='' + '' + parent.document.getElementById('j' + ivid).value; // duration;
parent.document.getElementById('myh1').innerHTML='' + player.getVideoData().title;
newtitle='' + parent.document.getElementById('myh1').innerHTML;
//alert('4:' + sparedur + ' newtitle=' + newtitle + ' beenbefore=' + beenbefore);
if (!beenbefore) {
top.document.getElementById('divtitles').innerHTML+='<span>' + newstart + '|' + newvid + '#' + newtitle.replace(/\&\;/g,'and').replace(/\ \&\ /g,' and ') + '</span>';
parent.fixdoc('' + ivid, '' + ('' + newdos).replace('false','off').replace('true','on') + '#' + newstart + '|' + newvid + '#' + newdur + '#' + newtitle);
} else if (newstart != wasstart || newvid != wasvid || newtitle != wastitle) {
top.document.getElementById('divtitles').innerHTML=top.document.getElementById('divtitles').innerHTML.replace(wasvid, 'cannotenda2');
top.document.getElementById('divtitles').innerHTML+='<span>' + newstart + '|' + newvid + '#' + newtitle.replace(/\&\;/g,'and').replace(/\ \&\ /g,' and ') + '</span>';
parent.fixdoc('' + ivid, '' + ('' + newdos).replace('false','off').replace('true','on') + '#' + newstart + '|' + newvid + '#' + newdur + '#' + newtitle);
}
}, 2000);
onethous=2500;
if (parent.document.getElementById('mytopspan')) { // && navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
mytos=parent.document.getElementById('mytopspan').innerHTML;
if (parent.document.getElementById('mytopspan').innerHTML.indexOf(' unmute ') == -1) {
if (('' + top.document.URL).indexOf('isradio=') != -1 && ('' + top.document.URL).indexOf('audioyoutube=') != -1 && nextvidi == 1) {
parent.document.getElementById('mytopspan').innerHTML='<font color=red>Please unmute within 30 seconds ... </font>' + mytos;
setTimeout(function(){
parent.document.getElementById('mytopspan').innerHTML=parent.document.getElementById('mytopspan').innerHTML.replace(' within 30 seconds ', ' as you require ').replace(' color="red"', ' color="blue"');
}, 30000);
} else {
parent.document.getElementById('mytopspan').innerHTML='<font color=blue>Please unmute as required ... </font>' + mytos;
}
}
}
}
} else {
player.loadVideoById(vidarrv[nextvidi], eval('' + vidstarts[nextvidi]), eval(eval('' + viddurs[nextvidi]) - eval('' + vidstarts[nextvidi])));
}
ivid=nextvidi;

if (parent.document.getElementById('shufflechk')) {
if (!parent.document.getElementById('shufflechk').checked) {
nextvidi++;
if (eval('' + viddurs.length) <= nextvidi) {
nextvidi=0;
}
} else {
nextvidi=Math.floor(Math.random() * eval('' + viddurs.length));
}
} else {
nextvidi++;
if (eval('' + viddurs.length) <= nextvidi) {
nextvidi=0;
}
}

}
}
setTimeout(playingvideo, onethous);
return '';
}

inplaying=true;
// rest of function playingvideo() as before ...
// end of function playingvideo()
}

… in …


Previous relevant Tabular Single Row YouTube API Radio Play Tutorial is shown below.

Tabular Single Row YouTube API Radio Play Tutorial

Tabular Single Row YouTube API Radio Play Tutorial

Today, we’re back to the Tabular Single Row Media Gallery ideas regarding the web application of the recent Tabular Single Row Textarea Sharing Tutorial and we’re involving more “button innards” thinking, with respect to adding onto the pre-existing …

  • radio play with YouTube audio stream only non-mobile platform incarnation … involving textarea usage … with, today, after getting the YouTube API inhouse web application, better attuned to …
  • radio play with YouTube audio stream only mobile platform incarnation … and …
  • radio play with YouTube video play on non-mobile platform incarnation … and …
  • radio play with YouTube video play on mobile platform incarnation

… additional functionalities allowing for …

  • looping (though the total list) … default for “radio play” …
  • shuffling … non-default …
  • individual YouTube video checkbox user control can end a song before it’s finish
  • recognition of individual YouTube video checkbox user control as above (can mean an individual song can be looped or deliberately ignored)
  • saving the playlist for user recall on the same web browser

… functionalities within those three new incarnations. We could organize the first to use the YouTube API in that “vertical in the one table cell, with checkboxes” way, too, but see the textareas of different interest in an ongoing sense. We’ll see whether we offer that YouTube API approach in a future release?!

Codewise, this involved …


Previous relevant Tabular Single Row Textarea Sharing Tutorial is shown below.

Tabular Single Row Textarea Sharing Tutorial

Tabular Single Row Textarea Sharing Tutorial

Yesterday’s Tabular Single Row Radio Play Tutorial‘s web application has two interesting features …

  • lots of use of textarea element placeholder attribute for explaining more complex data entry scenarios … and as of today …
  • a button element with the potential that it’s “innards” (ie. it’s innerHTML) is filled by a dropdown (ie. select element)

… it being our first time trying any HTML button element “innards” that were not always straight text. Is this the “comboBox” style of arrangement we used to see with desktop application GUIs and have long wished to simulate the usefulness of, online?!

Well, we’re not quite sure, but we think we’re going to look into it more into the future. So, what are we storing in this dropdown? We’re offering the user the chance … over to you code


document.getElementById('inp' + potlist[jwq] + '_' + document.getElementById(potlist[jwq]).target).title+='Entries starting with _ can describe ... ' + String.fromCharCode(10) + String.fromCharCode(10);
document.getElementById('inp' + potlist[jwq] + '_' + document.getElementById(potlist[jwq]).target).title+=' Comma separated audio stream only list of your own recallable YouTube IDs playlist' + String.fromCharCode(10);
document.getElementById('inp' + potlist[jwq] + '_' + document.getElementById(potlist[jwq]).target).title+=' Semicolon separated video list of your own recallable YouTube IDs playlist' + String.fromCharCode(10);
document.getElementById('inp' + potlist[jwq] + '_' + document.getElementById(potlist[jwq]).target).title+=' One of these inhouse playlist names above which start with tube' + perusedlist + String.fromCharCode(10);
document.getElementById('inp' + potlist[jwq] + '_' + document.getElementById(potlist[jwq]).target).title+=' YouTube Playlist 34 character identifier' + String.fromCharCode(10);
document.getElementById('inp' + potlist[jwq] + '_' + document.getElementById(potlist[jwq]).target).title+=' Spotify Playlist 22 character identifier' + String.fromCharCode(10);
document.getElementById('inp' + potlist[jwq] + '_' + document.getElementById(potlist[jwq]).target).title+=' Sundry _email _sms _saverecall _http://youtube.com#example' + String.fromCharCode(10);
document.getElementById('inp' + potlist[jwq] + '_' + document.getElementById(potlist[jwq]).target).ondblclick=function(event){ alert(event.target.title); };

… culminating in this new Javascript function …


function underscoresystem(inans, inota) {
var anchor=null, subjh='?subject=Hello';
var outans=inans;
var ytpllen=34; //eval('' + ('PLNtJQ2eJVoAMFocY7LOANvPH3cLyUonin').length);
var onevlen=11;
var sppllen=22;
var inhouse='';
var rperson='';
var mperson='';
var tperson='';
var jnota=inota;
if (outans.trim() != '') {
if (outans.toLowerCase().indexOf('mailto') == 0 || outans.toLowerCase().indexOf('email') == 0 || outans.toLowerCase().indexOf('sms') == 0 || outans.toLowerCase().indexOf('http') == 0 || outans.toLowerCase().indexOf('//') == 0 || outans.toLowerCase().indexOf('www.') == 0 || outans.toLowerCase().indexOf('save') == 0 || outans.toLowerCase().indexOf('recall') == 0) {
outans='_' + inans;
}
if (outans.replace(/^tube/g,'_').substring(0,1) == '_') {
subjh='?subject=' + encodeURIComponent('' + document.title + ' regarding ' + document.URL);
if (inota) {
if (document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target)) {
jnota=document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target);
}
}
if (('' + top.document.URL).indexOf('/swipe_media.htm') != -1) {
subjh='?subject=' + encodeURIComponent('' + document.title + ' regarding ' + document.URL);
if (('' + top.document.URL).indexOf('youtube=') != -1) {
if (('' + top.document.URL).indexOf('audioyoutube=') != -1 && ('' + top.document.URL).indexOf('isradio=') != -1) {
tperson='tuberadioapl_';
} else if (('' + top.document.URL).indexOf('youtube=') != -1 && ('' + top.document.URL).indexOf('isradio=') != -1) {
tperson='tuberadiovpl_';
} else if (('' + top.document.URL).indexOf('audioyoutube=') != -1 && ('' + top.document.URL).indexOf('isradio=') == -1) {
tperson='tubeapl_';
} else {
tperson='tubevpl_';
}
}
} else if ((outans + ' ').substring(0,4) == '____') {
tperson='tuberadioapl_';
outans=outans.replace(/^\_\_\_\_/g,'_');
} else if ((outans + ' ').substring(0,3) == '___') {
tperson='tuberadiovpl_';
outans=outans.replace(/^\_\_\_/g,'_');
} else if ((outans + ' ').substring(0,2) == '__') {
tperson='tubeapl_';
outans=outans.replace(/^\_\_/g,'_');
}
if (outans.indexOf('_recall') == 0 || outans.indexOf('_save') == 0) {
newlsval=tperson + ( ('' + Math.floor(Math.random() * 19897654)) + ('' + Math.floor(Math.random() * 19897654)) + ('' + Math.floor(Math.random() * 19897654)) + '000000000000000000000000000').substring(0,27);
if (perusedlist == '') { perusedlist=' ( and we found )'; }
perusedlist=perusedlist.replace(' )', ' ' + newlsval + ' )');
lastbize(newlsval, document.URL);
window.localStorage.setItem(newlsval, encodeURIComponent(document.URL));
jnota.title+=' ... for future recall reenter in web browser similar textarea playlist name ' + newlsval;
outans='';
if (inota) {
if (document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target)) {
jnota=document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target);
}
jnota.value='';
}
if (document.getElementById('recallable')) {
document.getElementById('recallable').innerHTML=newlsval;
document.getElementById('recallable').style.visibility='visible';
lastrecall=maybeselize(document.URL,lastrecall,newlsval);
}
newlsval='';

} else if (outans.toLowerCase().indexOf('_mailto') == 0 || outans.toLowerCase().indexOf('_email') == 0) {
anchor = document.createElement('a');
if (outans.toLowerCase().replace('_email','_mailto').indexOf('mailto:') != -1 && (outans.toLowerCase().trim() + '?').replace('_email','_mailto').indexOf('mailto:?') == -1) {
anchor.href = 'mailto:' + (outans.toLowerCase().trim() + '?').replace('_email','_mailto').split('mailto:')[1].split('?')[0] + subjh + '&body=' + encodeURIComponent(document.URL);
} else {
anchor.href = 'mailto:' + subjh + '&body=' + encodeURIComponent(document.URL);
}
anchor.style.display='none';
document.body.appendChild(anchor);
anchor.innerHTML='Email';
anchor.target='_top';
anchor.click();
outans='';
if (inota) {
if (document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target)) {
jnota=document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target);
}
jnota.value='';
}

} else if (outans.toLowerCase().indexOf('_sms') == 0) {
subjh='';
anchor = document.createElement('a');
if (outans.toLowerCase().indexOf('sms:') != -1 && (outans.toLowerCase().trim().replace('&','?') + '?').indexOf('sms:?') == -1) {
anchor.href = 'sms:' + (outans.toLowerCase().trim().replace('&','?') + '?').split('sms:')[1].split('?')[0] + subjh + '&body=' + encodeURIComponent(document.URL);
} else {
anchor.href = 'sms:' + subjh + '&body=' + encodeURIComponent(document.URL);
}
anchor.style.display='none';
document.body.appendChild(anchor);
anchor.innerHTML='SMS';
anchor.target='_top';
anchor.click();
outans='';
if (inota) {
if (document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target)) {
jnota=document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target);
}
jnota.value='';
}


} else if (outans.toLowerCase().indexOf('_http') == 0) {
window.open(outans.substring(5).replace(/^s/g,'').replace(/^\:/g,''), '_blank', 'top=50,left=50,width=500,height=500');
outans='';
if (inota) {
if (document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target)) {
jnota=document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target);
}
jnota.value='';
}


} else if (outans.toLowerCase().indexOf('_//') == 0) {
window.open(outans.substring(1), '_blank', 'top=50,left=50,width=500,height=500');
outans='';
if (inota) {
if (document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target)) {
jnota=document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target);
}
jnota.value='';
}


} else if (outans.toLowerCase().indexOf('_www') == 0) {
window.open('//' + outans.substring(1), '_blank', 'top=50,left=50,width=500,height=500');
outans='';
if (inota) {
if (document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target)) {
jnota=document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target);
}
jnota.value='';
}

} else if (outans.indexOf(',') != -1) { // tuberadioapl_
if (eval(eval('' + outans.replace(/\,/g,'').replace(/\;/g,'').length) % 11) == 1) {
if (tperson == '') { tperson='tubeapl_'; }
newlsval=tperson + ( ('' + Math.floor(Math.random() * 19897654)) + ('' + Math.floor(Math.random() * 19897654)) + ('' + Math.floor(Math.random() * 19897654)) + '000000000000000000000000000').substring(0,27);
if (perusedlist == '') { perusedlist=' ( and we found )'; }
perusedlist=perusedlist.replace(' )', ' ' + newlsval + ' )');
lastbize(newlsval, outans.substring(1).replace(/\;/g,','));
window.localStorage.setItem(newlsval, encodeURIComponent(outans.substring(1).replace(/\;/g,',')));
if (inota) {
jnota.title+=' ... for future recall reenter in this web browser similar textarea playlist name ' + newlsval;
}
return underscoresystem(newlsval, inota);
} else if (eval(eval('' + outans.replace(/\;/g,'').replace(/\,/g,'').length) % 11) == 0) {
if (tperson == '') { tperson='tuberapl_'; }
newlsval=tperson + ( ('' + Math.floor(Math.random() * 19897654)) + ('' + Math.floor(Math.random() * 19897654)) + ('' + Math.floor(Math.random() * 19897654)) + '000000000000000000000000000').substring(0,27);
if (perusedlist == '') { perusedlist=' ( and we found )'; }
perusedlist=perusedlist.replace(' )', ' ' + newlsval + ' )');
lastbize(newlsval, outans.substring(0).replace(/\;/g,','));
window.localStorage.setItem(newlsval, encodeURIComponent(outans.substring(0).replace(/\;/g,',')));
if (inota) {
jnota.title+=' ... for future recall reenter in web browser similar textarea playlist name ' + newlsval;
}
return underscoresystem(newlsval, inota);
}
} else if (outans.indexOf(';') != -1) { // tuberadiovpl_
if (eval(eval('' + outans.replace(/\;/g,'').replace(/\,/g,'').length) % 11) == 1) {
if (tperson == '') { tperson='tubevpl_'; }
newlsval=tperson + ( ('' + Math.floor(Math.random() * 19897654)) + ('' + Math.floor(Math.random() * 19897654)) + ('' + Math.floor(Math.random() * 19897654)) + '000000000000000000000000000').substring(0,27);
if (perusedlist == '') { perusedlist=' ( and we found )'; }
perusedlist=perusedlist.replace(' )', ' ' + newlsval + ' )');
window.localStorage.setItem(newlsval, encodeURIComponent(outans.substring(1).replace(/\;/g,',')));
lastbize(newlsval, outans.substring(1).replace(/\;/g,','));
if (inota) {
jnota.title+=' ... for future recall reenter in web browser similar textarea playlist name ' + newlsval;
}
return underscoresystem(newlsval, inota);
} else if (eval(eval('' + outans.replace(/\;/g,'').replace(/\,/g,'').length) % 11) == 0) {
if (tperson == '') { tperson='tubevpl_'; }
newlsval=tperson + ( ('' + Math.floor(Math.random() * 19897654)) + ('' + Math.floor(Math.random() * 19897654)) + ('' + Math.floor(Math.random() * 19897654)) + '000000000000000000000000000').substring(0,27);
if (perusedlist == '') { perusedlist=' ( and we found )'; }
perusedlist=perusedlist.replace(' )', ' ' + newlsval + ' )');
window.localStorage.setItem(newlsval, encodeURIComponent(outans.substring(0).replace(/\;/g,',')));
lastbize(newlsval, outans.substring(0).replace(/\;/g,','));
if (inota) {
jnota.title+=' ... for future recall reenter in web browser similar textarea playlist name ' + newlsval;
}
return underscoresystem(newlsval, inota);
}
} else {
switch ('' + eval('' + outans.length)) {
case '23':
outans=outans.replace(/^\_/g,'');
case '22':
window.open('//open.spotify.com/playlist/' + outans,'_blank'); //,'top=0,left=0,width=" + screen.width + ",height=" + screen.height);
outans='';
if (inota) {
if (document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target)) {
jnota=document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target);
}
jnota.value='';
}
break;


case '35':
outans=outans.replace(/^\_/g,'');
case '34':
window.open('//www.youtube.com/playlist?list=' + outans,'_blank'); //,'top=0,left=0,width=" + screen.width + ",height=" + screen.height);
outans='';
if (inota) {
if (document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target)) {
jnota=document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target);
}
jnota.value='';
}
break;


case '12':
outans=outans.replace(/^\_/g,'');
case '11':
if (('' + top.document.URL).indexOf('youtube=') != -1) {
top.location.href=top.document.URL.split('youtube=')[0] + 'youtube=' + outans;
outans='';
if (inota) {
if (document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target)) {
jnota=document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target);
}
jnota.value='';
}
} else {
underscorewo=window.open("//www.rjmprogramming.com.au/HTMLCSS/karaoke_youtube_api.htm?youtubeid=" + outans + "&justaJUNKudio=&youtube_duration=22234.0&email=&emoji=on&c0=off&i0=0&j0=22234&i1=&j1=&i2=&j2=&i3=&j3=&i4=&j4=&i5=&j5=&i6=&j6=&i7=&j7=&i8=&j8=&i9=&j9=&i10=&j10=&i11=&j11=&i12=&j12=&i13=&j13=&i14=&j14=&i15=&j15=&i16=&j16=&i17=&j17=&i18=&j18=&i19=&j19=&i20=&j20=&i21=&j21=&i22=&j22=&i23=&j23=&i24=&j24=&i25=&j25=&i26=&j26=&i27=&j27=&i28=&j28=&i29=&j29=","_blank","top=10,left=10,width=800,height=800");
outans='';
if (inota) {
if (document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target)) {
jnota=document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target);
jnota.value='';
}
}
}
break;


default:
if (outans.toLowerCase().indexOf('_tube') == 0) { outans=outans.replace(/^\_/g,''); }
if (outans.toLowerCase().indexOf('tuberadiovpl_') == 0) {
inhouse=('' + window.localStorage.getItem(outans)).replace(/^undefined/g,'').replace(/^null/g,'');
newlsval='';
} else if (outans.toLowerCase().indexOf('tuberadioapl_') == 0) {
inhouse=('' + window.localStorage.getItem(outans)).replace(/^undefined/g,'').replace(/^null/g,'');
newlsval='';
} else if (outans.toLowerCase().indexOf('tuberadiopl_') == 0) {
inhouse=('' + window.localStorage.getItem(outans)).replace(/^undefined/g,'').replace(/^null/g,'');
newlsval='';
} else if (outans.toLowerCase().indexOf('tubeapl_') == 0) {
inhouse=('' + window.localStorage.getItem(outans)).replace(/^undefined/g,'').replace(/^null/g,'');
newlsval='';
} else if (outans.toLowerCase().indexOf('tubevpl_') == 0) {
inhouse=('' + window.localStorage.getItem(outans)).replace(/^undefined/g,'').replace(/^null/g,'');
newlsval='';
} else if (outans.toLowerCase().indexOf('tubepl_') == 0) {
inhouse=('' + window.localStorage.getItem(outans)).replace(/^undefined/g,'').replace(/^null/g,'');
newlsval='';
} else if (eval('' + outans.length) == 28) {
inhouse=('' + window.localStorage.getItem('tubepl_' + outans.replace(/^\_/g,''))).replace(/^undefined/g,'').replace(/^null/g,'');
if (inhouse == '') {
inhouse=('' + window.localStorage.getItem('tubevpl_' + outans.replace(/^\_/g,''))).replace(/^undefined/g,'').replace(/^null/g,'');
}
if (inhouse == '') {
mperson='audio'
inhouse=('' + window.localStorage.getItem('tubeapl_' + outans.replace(/^\_/g,''))).replace(/^undefined/g,'').replace(/^null/g,'');
}
if (inhouse == '') {
mperson='isradio=y&audio'
inhouse=('' + window.localStorage.getItem('tuberadioapl_' + outans.replace(/^\_/g,''))).replace(/^undefined/g,'').replace(/^null/g,'');
}
if (inhouse == '') {
mperson='isradio=y&'
inhouse=('' + window.localStorage.getItem('tuberadiovpl_' + outans.replace(/^\_/g,''))).replace(/^undefined/g,'').replace(/^null/g,'');
}
} else if (eval('' + outans.length) == 27) {
inhouse=('' + window.localStorage.getItem('tubepl_' + outans)).replace(/^undefined/g,'').replace(/^null/g,'');
if (inhouse == '') {
inhouse=('' + window.localStorage.getItem('tubevpl_' + outans)).replace(/^undefined/g,'').replace(/^null/g,'');
}
if (inhouse == '') {
mperson='audio'
inhouse=('' + window.localStorage.getItem('tubeapl_' + outans)).replace(/^undefined/g,'').replace(/^null/g,'');
}
if (inhouse == '') {
inhouse=('' + window.localStorage.getItem('tuberadioapl_' + outans)).replace(/^undefined/g,'').replace(/^null/g,'');
}
if (inhouse == '') {
mperson='isradio=y&'
inhouse=('' + window.localStorage.getItem('tuberadiovpl_' + outans)).replace(/^undefined/g,'').replace(/^null/g,'');
}
}
if (inhouse.trim() != '') {
if (decodeURIComponent(inhouse).toLowerCase().indexOf('rjmprogramming.com.au') != -1) {
if (!inota) { return decodeURIComponent(inhouse) + '#' + outans; }
underscorewo=window.open(inhouse + '#' + outans,"_blank","top=0,left=0,width=" + screen.width + ",height=" + screen.height);
outans='';
if (document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target)) {
jnota=document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target);
jnota.value='';
}
} else {
if (!inota) { return "//www.rjmprogramming.com.au/HTMLCSS/swipe_media.html?" + mperson + "youtube=" + encodeURIComponent(decodeURIComponent(inhouse)) + "#" + outans; }
underscorewo=window.open("//www.rjmprogramming.com.au/HTMLCSS/swipe_media.html?" + mperson + "youtube=" + encodeURIComponent(decodeURIComponent(inhouse)) + "#" + outans,"_blank","top=0,left=0,width=" + screen.width + ",height=" + screen.height);
outans='';
if (document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target)) {
jnota=document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target);
jnota.value='';
}
}
}
break;
}
}
}
}
return outans;
}

Yes, the placeholder was struggling with what we wanted to offer as functionality, so we’re putting more into the textarea title attribute. These options allow users to create their own recallable playlists or access existant YouTube or Spotify ones to keep the music rolling in changed swipe_media.html Tabular Single Row Media Gallery helped out by ytaudioonly.js external Javascript helper.


Previous relevant Tabular Single Row Radio Play Tutorial is shown below.

Tabular Single Row Radio Play Tutorial

Tabular Single Row Radio Play Tutorial

We do not expect many readers to have thought yesterday’s YouTube Audio Only Mobile Looping Tutorial that little bit different. It was long in the making, and difficult (at least for us), but a brief tutorial. Too brief for interested parties, and we intended it as a seminal discussion, but it’s meaning got subsumed, if you will, with the goings on of the blog posting thread last talked about with the day before’s Tabular Single Row Image Gallery Linking Tutorial.

You see, the YouTube audio stream only inhouse looping control is an essential thing we needed to tie down for today’s progress in this blog posting thread, that being the first incarnation of …

Radio Play

… sequenced modes of play we’re offering today, as a start, for …

  • non-mobile users
  • using audio stream only button option clicks

So what was (most) …

difficult (at least for us)

… about getting this first Radio Play idea happening? In a word …

Focus

You find yourself wanting to do lots of …


[element].click();

… and …


[element].blur();

… types of work, which work best with focus (and boy, did we need to “focus”?!) We’ve minimised this where we could, but what we highly recommend users of this functionality doing is …

  • be presented with the solo web browser full screen (initial) window with the radio emoji
  • click desired first song link when the song link emojis appear … then …
  • it’s best to make this window small and away from other web browser windows but not overlapping for the best chance of …
  • songs play in sequence and loop back through the list

… within changed swipe_media.html Tabular Single Row Media Gallery helped out by ytaudioonly.js external Javascript helper.


Previous relevant Tabular Single Row Image Gallery Linking Tutorial is shown below.

Tabular Single Row Image Gallery Linking Tutorial

Tabular Single Row Image Gallery Linking Tutorial

After yesterday’s Tabular Single Row YouTube Audio or Video Buttons Tutorial work mainly regarding audio and video media, today we return to those …

  • background WordPress Blog random tutorial images … and link them via a modified 404.php creator’s …
    <?php

    if (strpos(('?' . $_SERVER['QUERY_STRING']), '?rand=') !== false) {
    $huht=@file_get_contents('http://www.rjmprogramming.com.au/HTMLCSS/select_palette.php?putrandom=' . urlencode('?rand=' . $_GET['rand'] . '.' . $pnumis . $ptitle));
    }

    ?>
    … calling on …
  • a modified select_palette.php helper …
    <?php

    if (isset($_GET['putrandom'])) {
    $contis=str_replace(' ','++',str_replace('+',' ',urldecode($_GET['putrandom']))) . "\n";
    $xcurgmt=gmdate("Ymd");
    if (!file_exists($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'media_gallery_swipe_' . $xcurgmt . '.htm')) {
    foreach (glob($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'media_gallery_swipe_' . '*.htm') as $dfilename) {
    unlink($dfilename);
    }
    file_put_contents($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'media_gallery_swipe_' . $xcurgmt . '.htm', $contis);
    } else {
    file_put_contents($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'media_gallery_swipe_' . $xcurgmt . '.htm', file_get_contents($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'media_gallery_swipe_' . $xcurgmt . '.htm') . $contis);
    }
    exit;
    } else if (isset($_GET['getrandom'])) {
    $xcurgmt=gmdate("Ymd");
    $imode=0;
    $contis="";
    $idp="";
    $jdp="";
    $pfix="";
    $sfix="";
    if (file_exists($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'media_gallery_swipe_' . $xcurgmt . '.htm')) {
    $contis=file_get_contents($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'media_gallery_swipe_' . $xcurgmt . '.htm');
    if (strlen($_GET['getrandom']) > 0) {
    $relstuffs=explode(str_replace(' ','++',str_replace('+',' ',strtolower(urldecode($_GET['getrandom'])))) . '.', $contis);
    if (sizeof($relstuffs) > 1) {
    $isub=0;
    $jdp=str_replace('rand=','',str_replace(' ','++',str_replace('+',' ',strtolower(urldecode($_GET['getrandom'])))));
    $imode=1;
    while (substr(substr($relstuffs[-1 + sizeof($relstuffs)],$isub),0,1) >= '0' && substr(substr($relstuffs[-1 + sizeof($relstuffs)],$isub),0,1) <= '9') {
    if ($imode == 0) {
    $jdp.=substr(substr($relstuffs[-1 + sizeof($relstuffs)],$isub),0,1);
    } else {
    $idp.=substr(substr($relstuffs[-1 + sizeof($relstuffs)],$isub),0,1);
    }
    $isub++;
    if (substr(substr($relstuffs[-1 + sizeof($relstuffs)],$isub),0,1) == '.') {
    $imode=1;
    $isub++;
    }
    }
    if (isset($_GET['via'])) {
    $pfix=" if (parent.document.getElementById('" . $_GET['via'] . "')) { parent.document.getElementById('" . $_GET['via'] . "').style.width='100%;'; parent.document.getElementById('" . $_GET['via'] . "').innerHTML+='<iframe style=width:100%;height:800px; src=!!!></iframe>'; } else { ";
    $sfix=" } ";
    }
    if (strtolower(urldecode($_GET['getrandom'])) != urldecode($_GET['getrandom'])) { // Cut to the Chase
    echo "<html><body onload=\"" . str_replace('!!!','/slideshow.html?title=' . explode(" (", explode("\n", explode('=' . $jdp . '.' . $idp, $contis)[1])[0])[0],$pfix) . " parent.window.open('/slideshow.html?title=" . explode(" (", explode("\n", explode('=' . $jdp . '.' . $idp, $contis)[1])[0])[0] . " " . $sfix . " ','_blank','top=200,left=200,width=600,height=600');\"></body></html>";
    exit;
    } else { // WordPress Blog Posting
    echo "<html><body onload=\"" . str_replace('!!!','/ITblog/?p=' . $idp . '#content',$pfix) . " parent.window.open('/ITblog/?p=" . $idp . "#content','_blank','top=200,left=200,width=600,height=600'); " . $sfix . " \"></body></html>";
    exit;
    }
    }
    }
    }
    echo "<html><body><pre>" . $contis . '</pre></body></html>';
    exit;
    }

    ?>
    … called at the parent window by …
  • changed swipe_media.html Tabular Single Row Media Gallery

    function checkmeout(evt, iscuttothechase) {
    if (evt.target.outerHTML.split('>')[0].indexOf('url(') != -1) {
    if (evt.target.outerHTML.split('>')[0].split('url(')[1].split(')')[0].indexOf('?rand=') != -1) {
    if (iscuttothechase) {
    document.getElementById('sparepal').src='/HTMLCSS/select_palette.php?getrandom=' + encodeURIComponent('RAND=' + evt.target.outerHTML.split('>')[0].split('url(')[1].split(')')[0].split('?rand=')[1].split("'")[0].split('"')[0].split(')')[0].split('"')[0]); // + ('&viJUNKa=' + evt.target.id).replace('td','div')
    } else {
    document.getElementById('sparepal').src='/HTMLCSS/select_palette.php?getrandom=' + encodeURIComponent('rand=' + evt.target.outerHTML.split('>')[0].split('url(')[1].split(')')[0].split('?rand=')[1].split("'")[0].split('"')[0].split(')')[0].split('"')[0]); // + ('&viJUNKa=' + evt.target.id).replace('td','div')
    }
    }
    }
    }

… web application, now accepting …

  1. click on one of these WordPress Blog random tutorial images to open window to relevant WordPress Blog posting … or …
  2. right click on one of these WordPress Blog random tutorial images to open window to relevant Cut to the Chase web application or presentation media regarding that blog posting above


Previous relevant Tabular Single Row YouTube Audio or Video Gallery Tutorial is shown below.

Tabular Single Row YouTube Audio or Video Gallery Tutorial

Tabular Single Row YouTube Audio or Video Gallery Tutorial

Today we’ve connected …

… which now have three new functionality options …

  • <–> … link to align the (previously) “Brady Bunch” YouTube iframes into a single row in the same web browser tab
  • <–>A+V … call of yesterday’s Media Gallery web application playing our “inhouse” YouTube iframe video playing web application in a new web browser tab
  • <–>A-V … link to our “inhouse” audio stream only YouTube iframe playing functionality in a new web browser tab

… involving changes to …

  • our changed

    var ytlist='';

    if (('' + document.URL + ('' + location.hash)).indexOf('onerow=') != -1) {
    setTimeout(function(){
    var inis='';
    var iwis=document.getElementById('vplayer1').getBoundingClientRect().width;
    var ifsare=document.getElementsByTagName('iframe');
    for (var jtt=0; jtt<ifsare.length; jtt++) {
    //alert(ifsare[jtt].src);
    if (ifsare[jtt].src.indexOf('/embed/') != -1) {
    if (ytlist == '') {
    ytlist='' + ifsare[jtt].src.split('/embed/')[1].substring(0,11);
    } else {
    ytlist+=',' + ifsare[jtt].src.split('/embed/')[1].substring(0,11);
    }
    }
    ifsare[jtt].style.width='' + iwis + 'px';
    }
    var toho=document.getElementsByTagName('table')[0];
    var tih=toho.innerHTML;
    var newtih=tih;
    //alert(tih);
    var thingos=tih.split('<tr');
    for (var itt=3; itt>=1; itt--) {
    if (itt == 1) {
    inis='<tr' + thingos[itt].split('</tr>')[0] + '</tr>';
    newtih=newtih.replace(inis, inis.replace('</tr>','<!--/tr-->'));
    } else if (itt == 3) {
    inis='<tr' + thingos[itt].split('</tr>')[0] + '</tr>';
    newtih=newtih.replace(inis, inis.replace('<tr>','<!--tr-->'));
    } else {
    inis='<tr' + thingos[itt].split('</tr>')[0] + '</tr>';
    newtih=newtih.replace(inis, inis.replace('<tr>','<!--tr-->').replace('</tr>','<!--/tr-->'));
    }
    }
    toho.innerHTML=newtih;
    toho.style.width='1000%';
    }, 4000);
    }

    setTimeout(function(){
    var antwo='';
    if (ytlist == '') {
    var ifsare=document.getElementsByTagName('iframe');
    for (var jtt=0; jtt<ifsare.length; jtt++) {
    //alert(ifsare[jtt].src);
    if (ifsare[jtt].src.indexOf('/embed/') != -1) {
    if (ytlist == '') {
    ytlist='' + ifsare[jtt].src.split('/embed/')[1].substring(0,11);
    } else {
    ytlist+=',' + ifsare[jtt].src.split('/embed/')[1].substring(0,11);
    }
    }
    }
    }
    if (ytlist != '') {
    antwo+=' <a title="Audio and video plays of YouTube videos" target=_blank href="/HTMLCSS/swipe_media.html?youtube=' + encodeURIComponent(ytlist) + '"><--><sup>A+V</sup></a>';
    antwo+=' <a title="Audio only plays of YouTube videos" target=_blank href="/HTMLCSS/swipe_media.html?audioyoutube=' + encodeURIComponent(ytlist) + '"><--><sub>A-V</sub></a>';
    }
    if (document.URL.indexOf('?') != -1) {
    document.getElementById('wshuffle').innerHTML+=' <a title="Present in one table row" target=_self href="' + document.URL.replace('?', '?onerow=' + Math.floor(Math.random() * 1989786)) + '"><--></a>' + antwo + ' ';
    } else {
    document.getElementById('wshuffle').innerHTML+=' <a title="Present in one table row" target=_self href="' + document.URL + '?onerow=' + Math.floor(Math.random() * 1989786) + '"><--></a>' + antwo + ' ';
    }
    }, 9000);

    youtube_brady_bunch.js being used in our inhouse Disco web application “peer to peer suite” web application “grandparent” level example …
  • “second draft” swipe_media.html Tabular Single Row Image Gallery web application


Previous relevant Tabular Single Row Image Gallery Primer Tutorial is shown below.

Tabular Single Row Image Gallery Primer Tutorial

Tabular Single Row Image Gallery Primer Tutorial

“Tabular Single Row Image Gallery” …

Smabular Single Row Image Gallery

… we’re sure is the reaction of some readers out there, to today’s “starting draft” for an idea we had. Today’s part of the jigsaw we want to explore may be “ho hum” and “so non-mobile”, but we’re hoping the thread appeals to more modern ideas as we go along.

So much for the apologies, and so let’s now look at the basis to this start …

  • media (so far just image) …
  • gallery … presented in …
  • table … HTML element … in …
  • single tr row
  • deliberately overflowing to the right of the screen view of the webpage … and so …
  • scrollable (ie. window scrollable) to … those right hand parts …
  • only “media loaded” …
  • as “scrolled to” or “stumbled upon”

So far the window scrollable detection goes (thanks to this useful link) …


window.onscroll = function (e) {
// called when the window is scrolled.
vspos4=document.body.scrollTop;
vspos3=document.body.scrollLeft;
var vstdn=Math.ceil(eval('' + vspos3) / eval('' + amin));
if (curtdn != vstdn) {
checkthen(vstdn);
}
}

… and the CSS produced “wording (ie. non-media) content” is produced down the bottom left of “inhouse WordPress Blog image cell background” ( possible because of background-size:contain ) we think is interesting …


<style>
td {
border: 1px dotted green;
}

.inhouse {
vertical-align: bottom;
padding-bottom: 20px;
}

.inhouse::after {
content: 'Media Gallery \a RJM Programming \a August, 2025 \a Thanks to Lorem Picsum at https://picsum.photos/ \a ' attr(alt);
white-space: pre-wrap;
}

</style>

… in a “first draft” Tabular Single Row Image Gallery web application for your perusal. Thanks to Lorem Picsum regarding, as so often happens for us, when we’d like beautiful random images to be involved with web applications!

If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.

Posted in eLearning, Event-Driven Programming, Tutorials | Tagged , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , | Leave a comment

Tabular Single Row YouTube API Radio Play Tutorial

Tabular Single Row YouTube API Radio Play Tutorial

Tabular Single Row YouTube API Radio Play Tutorial

Today, we’re back to the Tabular Single Row Media Gallery ideas regarding the web application of the recent Tabular Single Row Textarea Sharing Tutorial and we’re involving more “button innards” thinking, with respect to adding onto the pre-existing …

  • radio play with YouTube audio stream only non-mobile platform incarnation … involving textarea usage … with, today, after getting the YouTube API inhouse web application, better attuned to …
  • radio play with YouTube audio stream only mobile platform incarnation … and …
  • radio play with YouTube video play on non-mobile platform incarnation … and …
  • radio play with YouTube video play on mobile platform incarnation

… additional functionalities allowing for …

  • looping (though the total list) … default for “radio play” …
  • shuffling … non-default …
  • individual YouTube video checkbox user control can end a song before it’s finish
  • recognition of individual YouTube video checkbox user control as above (can mean an individual song can be looped or deliberately ignored)
  • saving the playlist for user recall on the same web browser

… functionalities within those three new incarnations. We could organize the first to use the YouTube API in that “vertical in the one table cell, with checkboxes” way, too, but see the textareas of different interest in an ongoing sense. We’ll see whether we offer that YouTube API approach in a future release?!

Codewise, this involved …


Previous relevant Tabular Single Row Textarea Sharing Tutorial is shown below.

Tabular Single Row Textarea Sharing Tutorial

Tabular Single Row Textarea Sharing Tutorial

Yesterday’s Tabular Single Row Radio Play Tutorial‘s web application has two interesting features …

  • lots of use of textarea element placeholder attribute for explaining more complex data entry scenarios … and as of today …
  • a button element with the potential that it’s “innards” (ie. it’s innerHTML) is filled by a dropdown (ie. select element)

… it being our first time trying any HTML button element “innards” that were not always straight text. Is this the “comboBox” style of arrangement we used to see with desktop application GUIs and have long wished to simulate the usefulness of, online?!

Well, we’re not quite sure, but we think we’re going to look into it more into the future. So, what are we storing in this dropdown? We’re offering the user the chance … over to you code


document.getElementById('inp' + potlist[jwq] + '_' + document.getElementById(potlist[jwq]).target).title+='Entries starting with _ can describe ... ' + String.fromCharCode(10) + String.fromCharCode(10);
document.getElementById('inp' + potlist[jwq] + '_' + document.getElementById(potlist[jwq]).target).title+=' Comma separated audio stream only list of your own recallable YouTube IDs playlist' + String.fromCharCode(10);
document.getElementById('inp' + potlist[jwq] + '_' + document.getElementById(potlist[jwq]).target).title+=' Semicolon separated video list of your own recallable YouTube IDs playlist' + String.fromCharCode(10);
document.getElementById('inp' + potlist[jwq] + '_' + document.getElementById(potlist[jwq]).target).title+=' One of these inhouse playlist names above which start with tube' + perusedlist + String.fromCharCode(10);
document.getElementById('inp' + potlist[jwq] + '_' + document.getElementById(potlist[jwq]).target).title+=' YouTube Playlist 34 character identifier' + String.fromCharCode(10);
document.getElementById('inp' + potlist[jwq] + '_' + document.getElementById(potlist[jwq]).target).title+=' Spotify Playlist 22 character identifier' + String.fromCharCode(10);
document.getElementById('inp' + potlist[jwq] + '_' + document.getElementById(potlist[jwq]).target).title+=' Sundry _email _sms _saverecall _http://youtube.com#example' + String.fromCharCode(10);
document.getElementById('inp' + potlist[jwq] + '_' + document.getElementById(potlist[jwq]).target).ondblclick=function(event){ alert(event.target.title); };

… culminating in this new Javascript function …


function underscoresystem(inans, inota) {
var anchor=null, subjh='?subject=Hello';
var outans=inans;
var ytpllen=34; //eval('' + ('PLNtJQ2eJVoAMFocY7LOANvPH3cLyUonin').length);
var onevlen=11;
var sppllen=22;
var inhouse='';
var rperson='';
var mperson='';
var tperson='';
var jnota=inota;
if (outans.trim() != '') {
if (outans.toLowerCase().indexOf('mailto') == 0 || outans.toLowerCase().indexOf('email') == 0 || outans.toLowerCase().indexOf('sms') == 0 || outans.toLowerCase().indexOf('http') == 0 || outans.toLowerCase().indexOf('//') == 0 || outans.toLowerCase().indexOf('www.') == 0 || outans.toLowerCase().indexOf('save') == 0 || outans.toLowerCase().indexOf('recall') == 0) {
outans='_' + inans;
}
if (outans.replace(/^tube/g,'_').substring(0,1) == '_') {
subjh='?subject=' + encodeURIComponent('' + document.title + ' regarding ' + document.URL);
if (inota) {
if (document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target)) {
jnota=document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target);
}
}
if (('' + top.document.URL).indexOf('/swipe_media.htm') != -1) {
subjh='?subject=' + encodeURIComponent('' + document.title + ' regarding ' + document.URL);
if (('' + top.document.URL).indexOf('youtube=') != -1) {
if (('' + top.document.URL).indexOf('audioyoutube=') != -1 && ('' + top.document.URL).indexOf('isradio=') != -1) {
tperson='tuberadioapl_';
} else if (('' + top.document.URL).indexOf('youtube=') != -1 && ('' + top.document.URL).indexOf('isradio=') != -1) {
tperson='tuberadiovpl_';
} else if (('' + top.document.URL).indexOf('audioyoutube=') != -1 && ('' + top.document.URL).indexOf('isradio=') == -1) {
tperson='tubeapl_';
} else {
tperson='tubevpl_';
}
}
} else if ((outans + ' ').substring(0,4) == '____') {
tperson='tuberadioapl_';
outans=outans.replace(/^\_\_\_\_/g,'_');
} else if ((outans + ' ').substring(0,3) == '___') {
tperson='tuberadiovpl_';
outans=outans.replace(/^\_\_\_/g,'_');
} else if ((outans + ' ').substring(0,2) == '__') {
tperson='tubeapl_';
outans=outans.replace(/^\_\_/g,'_');
}
if (outans.indexOf('_recall') == 0 || outans.indexOf('_save') == 0) {
newlsval=tperson + ( ('' + Math.floor(Math.random() * 19897654)) + ('' + Math.floor(Math.random() * 19897654)) + ('' + Math.floor(Math.random() * 19897654)) + '000000000000000000000000000').substring(0,27);
if (perusedlist == '') { perusedlist=' ( and we found )'; }
perusedlist=perusedlist.replace(' )', ' ' + newlsval + ' )');
lastbize(newlsval, document.URL);
window.localStorage.setItem(newlsval, encodeURIComponent(document.URL));
jnota.title+=' ... for future recall reenter in web browser similar textarea playlist name ' + newlsval;
outans='';
if (inota) {
if (document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target)) {
jnota=document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target);
}
jnota.value='';
}
if (document.getElementById('recallable')) {
document.getElementById('recallable').innerHTML=newlsval;
document.getElementById('recallable').style.visibility='visible';
lastrecall=maybeselize(document.URL,lastrecall,newlsval);
}
newlsval='';

} else if (outans.toLowerCase().indexOf('_mailto') == 0 || outans.toLowerCase().indexOf('_email') == 0) {
anchor = document.createElement('a');
if (outans.toLowerCase().replace('_email','_mailto').indexOf('mailto:') != -1 && (outans.toLowerCase().trim() + '?').replace('_email','_mailto').indexOf('mailto:?') == -1) {
anchor.href = 'mailto:' + (outans.toLowerCase().trim() + '?').replace('_email','_mailto').split('mailto:')[1].split('?')[0] + subjh + '&body=' + encodeURIComponent(document.URL);
} else {
anchor.href = 'mailto:' + subjh + '&body=' + encodeURIComponent(document.URL);
}
anchor.style.display='none';
document.body.appendChild(anchor);
anchor.innerHTML='Email';
anchor.target='_top';
anchor.click();
outans='';
if (inota) {
if (document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target)) {
jnota=document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target);
}
jnota.value='';
}

} else if (outans.toLowerCase().indexOf('_sms') == 0) {
subjh='';
anchor = document.createElement('a');
if (outans.toLowerCase().indexOf('sms:') != -1 && (outans.toLowerCase().trim().replace('&','?') + '?').indexOf('sms:?') == -1) {
anchor.href = 'sms:' + (outans.toLowerCase().trim().replace('&','?') + '?').split('sms:')[1].split('?')[0] + subjh + '&body=' + encodeURIComponent(document.URL);
} else {
anchor.href = 'sms:' + subjh + '&body=' + encodeURIComponent(document.URL);
}
anchor.style.display='none';
document.body.appendChild(anchor);
anchor.innerHTML='SMS';
anchor.target='_top';
anchor.click();
outans='';
if (inota) {
if (document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target)) {
jnota=document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target);
}
jnota.value='';
}


} else if (outans.toLowerCase().indexOf('_http') == 0) {
window.open(outans.substring(5).replace(/^s/g,'').replace(/^\:/g,''), '_blank', 'top=50,left=50,width=500,height=500');
outans='';
if (inota) {
if (document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target)) {
jnota=document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target);
}
jnota.value='';
}


} else if (outans.toLowerCase().indexOf('_//') == 0) {
window.open(outans.substring(1), '_blank', 'top=50,left=50,width=500,height=500');
outans='';
if (inota) {
if (document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target)) {
jnota=document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target);
}
jnota.value='';
}


} else if (outans.toLowerCase().indexOf('_www') == 0) {
window.open('//' + outans.substring(1), '_blank', 'top=50,left=50,width=500,height=500');
outans='';
if (inota) {
if (document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target)) {
jnota=document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target);
}
jnota.value='';
}

} else if (outans.indexOf(',') != -1) { // tuberadioapl_
if (eval(eval('' + outans.replace(/\,/g,'').replace(/\;/g,'').length) % 11) == 1) {
if (tperson == '') { tperson='tubeapl_'; }
newlsval=tperson + ( ('' + Math.floor(Math.random() * 19897654)) + ('' + Math.floor(Math.random() * 19897654)) + ('' + Math.floor(Math.random() * 19897654)) + '000000000000000000000000000').substring(0,27);
if (perusedlist == '') { perusedlist=' ( and we found )'; }
perusedlist=perusedlist.replace(' )', ' ' + newlsval + ' )');
lastbize(newlsval, outans.substring(1).replace(/\;/g,','));
window.localStorage.setItem(newlsval, encodeURIComponent(outans.substring(1).replace(/\;/g,',')));
if (inota) {
jnota.title+=' ... for future recall reenter in this web browser similar textarea playlist name ' + newlsval;
}
return underscoresystem(newlsval, inota);
} else if (eval(eval('' + outans.replace(/\;/g,'').replace(/\,/g,'').length) % 11) == 0) {
if (tperson == '') { tperson='tuberapl_'; }
newlsval=tperson + ( ('' + Math.floor(Math.random() * 19897654)) + ('' + Math.floor(Math.random() * 19897654)) + ('' + Math.floor(Math.random() * 19897654)) + '000000000000000000000000000').substring(0,27);
if (perusedlist == '') { perusedlist=' ( and we found )'; }
perusedlist=perusedlist.replace(' )', ' ' + newlsval + ' )');
lastbize(newlsval, outans.substring(0).replace(/\;/g,','));
window.localStorage.setItem(newlsval, encodeURIComponent(outans.substring(0).replace(/\;/g,',')));
if (inota) {
jnota.title+=' ... for future recall reenter in web browser similar textarea playlist name ' + newlsval;
}
return underscoresystem(newlsval, inota);
}
} else if (outans.indexOf(';') != -1) { // tuberadiovpl_
if (eval(eval('' + outans.replace(/\;/g,'').replace(/\,/g,'').length) % 11) == 1) {
if (tperson == '') { tperson='tubevpl_'; }
newlsval=tperson + ( ('' + Math.floor(Math.random() * 19897654)) + ('' + Math.floor(Math.random() * 19897654)) + ('' + Math.floor(Math.random() * 19897654)) + '000000000000000000000000000').substring(0,27);
if (perusedlist == '') { perusedlist=' ( and we found )'; }
perusedlist=perusedlist.replace(' )', ' ' + newlsval + ' )');
window.localStorage.setItem(newlsval, encodeURIComponent(outans.substring(1).replace(/\;/g,',')));
lastbize(newlsval, outans.substring(1).replace(/\;/g,','));
if (inota) {
jnota.title+=' ... for future recall reenter in web browser similar textarea playlist name ' + newlsval;
}
return underscoresystem(newlsval, inota);
} else if (eval(eval('' + outans.replace(/\;/g,'').replace(/\,/g,'').length) % 11) == 0) {
if (tperson == '') { tperson='tubevpl_'; }
newlsval=tperson + ( ('' + Math.floor(Math.random() * 19897654)) + ('' + Math.floor(Math.random() * 19897654)) + ('' + Math.floor(Math.random() * 19897654)) + '000000000000000000000000000').substring(0,27);
if (perusedlist == '') { perusedlist=' ( and we found )'; }
perusedlist=perusedlist.replace(' )', ' ' + newlsval + ' )');
window.localStorage.setItem(newlsval, encodeURIComponent(outans.substring(0).replace(/\;/g,',')));
lastbize(newlsval, outans.substring(0).replace(/\;/g,','));
if (inota) {
jnota.title+=' ... for future recall reenter in web browser similar textarea playlist name ' + newlsval;
}
return underscoresystem(newlsval, inota);
}
} else {
switch ('' + eval('' + outans.length)) {
case '23':
outans=outans.replace(/^\_/g,'');
case '22':
window.open('//open.spotify.com/playlist/' + outans,'_blank'); //,'top=0,left=0,width=" + screen.width + ",height=" + screen.height);
outans='';
if (inota) {
if (document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target)) {
jnota=document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target);
}
jnota.value='';
}
break;


case '35':
outans=outans.replace(/^\_/g,'');
case '34':
window.open('//www.youtube.com/playlist?list=' + outans,'_blank'); //,'top=0,left=0,width=" + screen.width + ",height=" + screen.height);
outans='';
if (inota) {
if (document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target)) {
jnota=document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target);
}
jnota.value='';
}
break;


case '12':
outans=outans.replace(/^\_/g,'');
case '11':
if (('' + top.document.URL).indexOf('youtube=') != -1) {
top.location.href=top.document.URL.split('youtube=')[0] + 'youtube=' + outans;
outans='';
if (inota) {
if (document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target)) {
jnota=document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target);
}
jnota.value='';
}
} else {
underscorewo=window.open("//www.rjmprogramming.com.au/HTMLCSS/karaoke_youtube_api.htm?youtubeid=" + outans + "&justaJUNKudio=&youtube_duration=22234.0&email=&emoji=on&c0=off&i0=0&j0=22234&i1=&j1=&i2=&j2=&i3=&j3=&i4=&j4=&i5=&j5=&i6=&j6=&i7=&j7=&i8=&j8=&i9=&j9=&i10=&j10=&i11=&j11=&i12=&j12=&i13=&j13=&i14=&j14=&i15=&j15=&i16=&j16=&i17=&j17=&i18=&j18=&i19=&j19=&i20=&j20=&i21=&j21=&i22=&j22=&i23=&j23=&i24=&j24=&i25=&j25=&i26=&j26=&i27=&j27=&i28=&j28=&i29=&j29=","_blank","top=10,left=10,width=800,height=800");
outans='';
if (inota) {
if (document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target)) {
jnota=document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target);
jnota.value='';
}
}
}
break;


default:
if (outans.toLowerCase().indexOf('_tube') == 0) { outans=outans.replace(/^\_/g,''); }
if (outans.toLowerCase().indexOf('tuberadiovpl_') == 0) {
inhouse=('' + window.localStorage.getItem(outans)).replace(/^undefined/g,'').replace(/^null/g,'');
newlsval='';
} else if (outans.toLowerCase().indexOf('tuberadioapl_') == 0) {
inhouse=('' + window.localStorage.getItem(outans)).replace(/^undefined/g,'').replace(/^null/g,'');
newlsval='';
} else if (outans.toLowerCase().indexOf('tuberadiopl_') == 0) {
inhouse=('' + window.localStorage.getItem(outans)).replace(/^undefined/g,'').replace(/^null/g,'');
newlsval='';
} else if (outans.toLowerCase().indexOf('tubeapl_') == 0) {
inhouse=('' + window.localStorage.getItem(outans)).replace(/^undefined/g,'').replace(/^null/g,'');
newlsval='';
} else if (outans.toLowerCase().indexOf('tubevpl_') == 0) {
inhouse=('' + window.localStorage.getItem(outans)).replace(/^undefined/g,'').replace(/^null/g,'');
newlsval='';
} else if (outans.toLowerCase().indexOf('tubepl_') == 0) {
inhouse=('' + window.localStorage.getItem(outans)).replace(/^undefined/g,'').replace(/^null/g,'');
newlsval='';
} else if (eval('' + outans.length) == 28) {
inhouse=('' + window.localStorage.getItem('tubepl_' + outans.replace(/^\_/g,''))).replace(/^undefined/g,'').replace(/^null/g,'');
if (inhouse == '') {
inhouse=('' + window.localStorage.getItem('tubevpl_' + outans.replace(/^\_/g,''))).replace(/^undefined/g,'').replace(/^null/g,'');
}
if (inhouse == '') {
mperson='audio'
inhouse=('' + window.localStorage.getItem('tubeapl_' + outans.replace(/^\_/g,''))).replace(/^undefined/g,'').replace(/^null/g,'');
}
if (inhouse == '') {
mperson='isradio=y&audio'
inhouse=('' + window.localStorage.getItem('tuberadioapl_' + outans.replace(/^\_/g,''))).replace(/^undefined/g,'').replace(/^null/g,'');
}
if (inhouse == '') {
mperson='isradio=y&'
inhouse=('' + window.localStorage.getItem('tuberadiovpl_' + outans.replace(/^\_/g,''))).replace(/^undefined/g,'').replace(/^null/g,'');
}
} else if (eval('' + outans.length) == 27) {
inhouse=('' + window.localStorage.getItem('tubepl_' + outans)).replace(/^undefined/g,'').replace(/^null/g,'');
if (inhouse == '') {
inhouse=('' + window.localStorage.getItem('tubevpl_' + outans)).replace(/^undefined/g,'').replace(/^null/g,'');
}
if (inhouse == '') {
mperson='audio'
inhouse=('' + window.localStorage.getItem('tubeapl_' + outans)).replace(/^undefined/g,'').replace(/^null/g,'');
}
if (inhouse == '') {
inhouse=('' + window.localStorage.getItem('tuberadioapl_' + outans)).replace(/^undefined/g,'').replace(/^null/g,'');
}
if (inhouse == '') {
mperson='isradio=y&'
inhouse=('' + window.localStorage.getItem('tuberadiovpl_' + outans)).replace(/^undefined/g,'').replace(/^null/g,'');
}
}
if (inhouse.trim() != '') {
if (decodeURIComponent(inhouse).toLowerCase().indexOf('rjmprogramming.com.au') != -1) {
if (!inota) { return decodeURIComponent(inhouse) + '#' + outans; }
underscorewo=window.open(inhouse + '#' + outans,"_blank","top=0,left=0,width=" + screen.width + ",height=" + screen.height);
outans='';
if (document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target)) {
jnota=document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target);
jnota.value='';
}
} else {
if (!inota) { return "//www.rjmprogramming.com.au/HTMLCSS/swipe_media.html?" + mperson + "youtube=" + encodeURIComponent(decodeURIComponent(inhouse)) + "#" + outans; }
underscorewo=window.open("//www.rjmprogramming.com.au/HTMLCSS/swipe_media.html?" + mperson + "youtube=" + encodeURIComponent(decodeURIComponent(inhouse)) + "#" + outans,"_blank","top=0,left=0,width=" + screen.width + ",height=" + screen.height);
outans='';
if (document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target)) {
jnota=document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target);
jnota.value='';
}
}
}
break;
}
}
}
}
return outans;
}

Yes, the placeholder was struggling with what we wanted to offer as functionality, so we’re putting more into the textarea title attribute. These options allow users to create their own recallable playlists or access existant YouTube or Spotify ones to keep the music rolling in changed swipe_media.html Tabular Single Row Media Gallery helped out by ytaudioonly.js external Javascript helper.


Previous relevant Tabular Single Row Radio Play Tutorial is shown below.

Tabular Single Row Radio Play Tutorial

Tabular Single Row Radio Play Tutorial

We do not expect many readers to have thought yesterday’s YouTube Audio Only Mobile Looping Tutorial that little bit different. It was long in the making, and difficult (at least for us), but a brief tutorial. Too brief for interested parties, and we intended it as a seminal discussion, but it’s meaning got subsumed, if you will, with the goings on of the blog posting thread last talked about with the day before’s Tabular Single Row Image Gallery Linking Tutorial.

You see, the YouTube audio stream only inhouse looping control is an essential thing we needed to tie down for today’s progress in this blog posting thread, that being the first incarnation of …

Radio Play

… sequenced modes of play we’re offering today, as a start, for …

  • non-mobile users
  • using audio stream only button option clicks

So what was (most) …

difficult (at least for us)

… about getting this first Radio Play idea happening? In a word …

Focus

You find yourself wanting to do lots of …


[element].click();

… and …


[element].blur();

… types of work, which work best with focus (and boy, did we need to “focus”?!) We’ve minimised this where we could, but what we highly recommend users of this functionality doing is …

  • be presented with the solo web browser full screen (initial) window with the radio emoji
  • click desired first song link when the song link emojis appear … then …
  • it’s best to make this window small and away from other web browser windows but not overlapping for the best chance of …
  • songs play in sequence and loop back through the list

… within changed swipe_media.html Tabular Single Row Media Gallery helped out by ytaudioonly.js external Javascript helper.


Previous relevant Tabular Single Row Image Gallery Linking Tutorial is shown below.

Tabular Single Row Image Gallery Linking Tutorial

Tabular Single Row Image Gallery Linking Tutorial

After yesterday’s Tabular Single Row YouTube Audio or Video Buttons Tutorial work mainly regarding audio and video media, today we return to those …

  • background WordPress Blog random tutorial images … and link them via a modified 404.php creator’s …
    <?php

    if (strpos(('?' . $_SERVER['QUERY_STRING']), '?rand=') !== false) {
    $huht=@file_get_contents('http://www.rjmprogramming.com.au/HTMLCSS/select_palette.php?putrandom=' . urlencode('?rand=' . $_GET['rand'] . '.' . $pnumis . $ptitle));
    }

    ?>
    … calling on …
  • a modified select_palette.php helper …
    <?php

    if (isset($_GET['putrandom'])) {
    $contis=str_replace(' ','++',str_replace('+',' ',urldecode($_GET['putrandom']))) . "\n";
    $xcurgmt=gmdate("Ymd");
    if (!file_exists($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'media_gallery_swipe_' . $xcurgmt . '.htm')) {
    foreach (glob($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'media_gallery_swipe_' . '*.htm') as $dfilename) {
    unlink($dfilename);
    }
    file_put_contents($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'media_gallery_swipe_' . $xcurgmt . '.htm', $contis);
    } else {
    file_put_contents($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'media_gallery_swipe_' . $xcurgmt . '.htm', file_get_contents($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'media_gallery_swipe_' . $xcurgmt . '.htm') . $contis);
    }
    exit;
    } else if (isset($_GET['getrandom'])) {
    $xcurgmt=gmdate("Ymd");
    $imode=0;
    $contis="";
    $idp="";
    $jdp="";
    $pfix="";
    $sfix="";
    if (file_exists($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'media_gallery_swipe_' . $xcurgmt . '.htm')) {
    $contis=file_get_contents($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'media_gallery_swipe_' . $xcurgmt . '.htm');
    if (strlen($_GET['getrandom']) > 0) {
    $relstuffs=explode(str_replace(' ','++',str_replace('+',' ',strtolower(urldecode($_GET['getrandom'])))) . '.', $contis);
    if (sizeof($relstuffs) > 1) {
    $isub=0;
    $jdp=str_replace('rand=','',str_replace(' ','++',str_replace('+',' ',strtolower(urldecode($_GET['getrandom'])))));
    $imode=1;
    while (substr(substr($relstuffs[-1 + sizeof($relstuffs)],$isub),0,1) >= '0' && substr(substr($relstuffs[-1 + sizeof($relstuffs)],$isub),0,1) <= '9') {
    if ($imode == 0) {
    $jdp.=substr(substr($relstuffs[-1 + sizeof($relstuffs)],$isub),0,1);
    } else {
    $idp.=substr(substr($relstuffs[-1 + sizeof($relstuffs)],$isub),0,1);
    }
    $isub++;
    if (substr(substr($relstuffs[-1 + sizeof($relstuffs)],$isub),0,1) == '.') {
    $imode=1;
    $isub++;
    }
    }
    if (isset($_GET['via'])) {
    $pfix=" if (parent.document.getElementById('" . $_GET['via'] . "')) { parent.document.getElementById('" . $_GET['via'] . "').style.width='100%;'; parent.document.getElementById('" . $_GET['via'] . "').innerHTML+='<iframe style=width:100%;height:800px; src=!!!></iframe>'; } else { ";
    $sfix=" } ";
    }
    if (strtolower(urldecode($_GET['getrandom'])) != urldecode($_GET['getrandom'])) { // Cut to the Chase
    echo "<html><body onload=\"" . str_replace('!!!','/slideshow.html?title=' . explode(" (", explode("\n", explode('=' . $jdp . '.' . $idp, $contis)[1])[0])[0],$pfix) . " parent.window.open('/slideshow.html?title=" . explode(" (", explode("\n", explode('=' . $jdp . '.' . $idp, $contis)[1])[0])[0] . " " . $sfix . " ','_blank','top=200,left=200,width=600,height=600');\"></body></html>";
    exit;
    } else { // WordPress Blog Posting
    echo "<html><body onload=\"" . str_replace('!!!','/ITblog/?p=' . $idp . '#content',$pfix) . " parent.window.open('/ITblog/?p=" . $idp . "#content','_blank','top=200,left=200,width=600,height=600'); " . $sfix . " \"></body></html>";
    exit;
    }
    }
    }
    }
    echo "<html><body><pre>" . $contis . '</pre></body></html>';
    exit;
    }

    ?>
    … called at the parent window by …
  • changed swipe_media.html Tabular Single Row Media Gallery

    function checkmeout(evt, iscuttothechase) {
    if (evt.target.outerHTML.split('>')[0].indexOf('url(') != -1) {
    if (evt.target.outerHTML.split('>')[0].split('url(')[1].split(')')[0].indexOf('?rand=') != -1) {
    if (iscuttothechase) {
    document.getElementById('sparepal').src='/HTMLCSS/select_palette.php?getrandom=' + encodeURIComponent('RAND=' + evt.target.outerHTML.split('>')[0].split('url(')[1].split(')')[0].split('?rand=')[1].split("'")[0].split('"')[0].split(')')[0].split('"')[0]); // + ('&viJUNKa=' + evt.target.id).replace('td','div')
    } else {
    document.getElementById('sparepal').src='/HTMLCSS/select_palette.php?getrandom=' + encodeURIComponent('rand=' + evt.target.outerHTML.split('>')[0].split('url(')[1].split(')')[0].split('?rand=')[1].split("'")[0].split('"')[0].split(')')[0].split('"')[0]); // + ('&viJUNKa=' + evt.target.id).replace('td','div')
    }
    }
    }
    }

… web application, now accepting …

  1. click on one of these WordPress Blog random tutorial images to open window to relevant WordPress Blog posting … or …
  2. right click on one of these WordPress Blog random tutorial images to open window to relevant Cut to the Chase web application or presentation media regarding that blog posting above


Previous relevant Tabular Single Row YouTube Audio or Video Gallery Tutorial is shown below.

Tabular Single Row YouTube Audio or Video Gallery Tutorial

Tabular Single Row YouTube Audio or Video Gallery Tutorial

Today we’ve connected …

… which now have three new functionality options …

  • <–> … link to align the (previously) “Brady Bunch” YouTube iframes into a single row in the same web browser tab
  • <–>A+V … call of yesterday’s Media Gallery web application playing our “inhouse” YouTube iframe video playing web application in a new web browser tab
  • <–>A-V … link to our “inhouse” audio stream only YouTube iframe playing functionality in a new web browser tab

… involving changes to …

  • our changed

    var ytlist='';

    if (('' + document.URL + ('' + location.hash)).indexOf('onerow=') != -1) {
    setTimeout(function(){
    var inis='';
    var iwis=document.getElementById('vplayer1').getBoundingClientRect().width;
    var ifsare=document.getElementsByTagName('iframe');
    for (var jtt=0; jtt<ifsare.length; jtt++) {
    //alert(ifsare[jtt].src);
    if (ifsare[jtt].src.indexOf('/embed/') != -1) {
    if (ytlist == '') {
    ytlist='' + ifsare[jtt].src.split('/embed/')[1].substring(0,11);
    } else {
    ytlist+=',' + ifsare[jtt].src.split('/embed/')[1].substring(0,11);
    }
    }
    ifsare[jtt].style.width='' + iwis + 'px';
    }
    var toho=document.getElementsByTagName('table')[0];
    var tih=toho.innerHTML;
    var newtih=tih;
    //alert(tih);
    var thingos=tih.split('<tr');
    for (var itt=3; itt>=1; itt--) {
    if (itt == 1) {
    inis='<tr' + thingos[itt].split('</tr>')[0] + '</tr>';
    newtih=newtih.replace(inis, inis.replace('</tr>','<!--/tr-->'));
    } else if (itt == 3) {
    inis='<tr' + thingos[itt].split('</tr>')[0] + '</tr>';
    newtih=newtih.replace(inis, inis.replace('<tr>','<!--tr-->'));
    } else {
    inis='<tr' + thingos[itt].split('</tr>')[0] + '</tr>';
    newtih=newtih.replace(inis, inis.replace('<tr>','<!--tr-->').replace('</tr>','<!--/tr-->'));
    }
    }
    toho.innerHTML=newtih;
    toho.style.width='1000%';
    }, 4000);
    }

    setTimeout(function(){
    var antwo='';
    if (ytlist == '') {
    var ifsare=document.getElementsByTagName('iframe');
    for (var jtt=0; jtt<ifsare.length; jtt++) {
    //alert(ifsare[jtt].src);
    if (ifsare[jtt].src.indexOf('/embed/') != -1) {
    if (ytlist == '') {
    ytlist='' + ifsare[jtt].src.split('/embed/')[1].substring(0,11);
    } else {
    ytlist+=',' + ifsare[jtt].src.split('/embed/')[1].substring(0,11);
    }
    }
    }
    }
    if (ytlist != '') {
    antwo+=' <a title="Audio and video plays of YouTube videos" target=_blank href="/HTMLCSS/swipe_media.html?youtube=' + encodeURIComponent(ytlist) + '"><--><sup>A+V</sup></a>';
    antwo+=' <a title="Audio only plays of YouTube videos" target=_blank href="/HTMLCSS/swipe_media.html?audioyoutube=' + encodeURIComponent(ytlist) + '"><--><sub>A-V</sub></a>';
    }
    if (document.URL.indexOf('?') != -1) {
    document.getElementById('wshuffle').innerHTML+=' <a title="Present in one table row" target=_self href="' + document.URL.replace('?', '?onerow=' + Math.floor(Math.random() * 1989786)) + '"><--></a>' + antwo + ' ';
    } else {
    document.getElementById('wshuffle').innerHTML+=' <a title="Present in one table row" target=_self href="' + document.URL + '?onerow=' + Math.floor(Math.random() * 1989786) + '"><--></a>' + antwo + ' ';
    }
    }, 9000);

    youtube_brady_bunch.js being used in our inhouse Disco web application “peer to peer suite” web application “grandparent” level example …
  • “second draft” swipe_media.html Tabular Single Row Image Gallery web application


Previous relevant Tabular Single Row Image Gallery Primer Tutorial is shown below.

Tabular Single Row Image Gallery Primer Tutorial

Tabular Single Row Image Gallery Primer Tutorial

“Tabular Single Row Image Gallery” …

Smabular Single Row Image Gallery

… we’re sure is the reaction of some readers out there, to today’s “starting draft” for an idea we had. Today’s part of the jigsaw we want to explore may be “ho hum” and “so non-mobile”, but we’re hoping the thread appeals to more modern ideas as we go along.

So much for the apologies, and so let’s now look at the basis to this start …

  • media (so far just image) …
  • gallery … presented in …
  • table … HTML element … in …
  • single tr row
  • deliberately overflowing to the right of the screen view of the webpage … and so …
  • scrollable (ie. window scrollable) to … those right hand parts …
  • only “media loaded” …
  • as “scrolled to” or “stumbled upon”

So far the window scrollable detection goes (thanks to this useful link) …


window.onscroll = function (e) {
// called when the window is scrolled.
vspos4=document.body.scrollTop;
vspos3=document.body.scrollLeft;
var vstdn=Math.ceil(eval('' + vspos3) / eval('' + amin));
if (curtdn != vstdn) {
checkthen(vstdn);
}
}

… and the CSS produced “wording (ie. non-media) content” is produced down the bottom left of “inhouse WordPress Blog image cell background” ( possible because of background-size:contain ) we think is interesting …


<style>
td {
border: 1px dotted green;
}

.inhouse {
vertical-align: bottom;
padding-bottom: 20px;
}

.inhouse::after {
content: 'Media Gallery \a RJM Programming \a August, 2025 \a Thanks to Lorem Picsum at https://picsum.photos/ \a ' attr(alt);
white-space: pre-wrap;
}

</style>

… in a “first draft” Tabular Single Row Image Gallery web application for your perusal. Thanks to Lorem Picsum regarding, as so often happens for us, when we’d like beautiful random images to be involved with web applications!

If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.

Posted in eLearning, Event-Driven Programming, Tutorials | Tagged , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , | Leave a comment

Button Innards Primer Tutorial

Button Innards Primer Tutorial

Button Innards Primer Tutorial

Yesterday’s …

… combine, today, starting down, again, the road to “button innards” interest.

We thought the “how we got there” concept of embedding the form elements of data into “button innards” (ie. it’s innerHTML) in our new “button innards” web application interesting. Of course you don’t have to do this simple exercise of calculating time elapsed between two datetimes this way, but what we wanted to show was that with lots of things in web design, by now, there is more than one way to crack an egg …


Previous relevant Bookmark Exporting Filtering Sharing Tutorial is shown below.

Bookmark Exporting Filtering Sharing Tutorial

Bookmark Exporting Filtering Sharing Tutorial

Yesterday’s Making of Ffmpeg Video Overall Effects Tutorial‘s “first draft” feel of our inhouse Bookmark Export Filtering web application showed just that. Yes, there was quite a lot to improve on, the way we saw it being …

  • adding a (local system) file browsing means (called by our <iframe scrolling=no frameborder=0 id=cbi data-style=’border-top:1px solid black;border-bottom:1px solid black;border-left:2px solid yellow;border-right:1px solid yellow;’ style=’width:173px;height:228px;margin-top:-194px;’ src=’/HTMLCSS/client_browsing.htm?totype=html&d=189786754′></iframe> file browsing helper) …

    function yesthreethree(restis) {
    if (document.getElementById('bmkdata')) {
    if (restis.indexOf('data:') == 0) {
    if (restis.indexOf(';base64,') != -1) {
    document.getElementById('bmkdata').value='' + window.atob(restis.split(';base64,')[1]);
    analyze(document.getElementById('bmkdata')); //document.getElementById('bmkdata').blur();
    } else if (restis.indexOf(';utf8,') != -1) {
    document.getElementById('bmkdata').value='' + (restis.split(';utf8,')[1]);
    analyze(document.getElementById('bmkdata')); //document.getElementById('bmkdata').blur();
    }
    } else {
    document.getElementById('bmkdata').value=restis;
    analyze(document.getElementById('bmkdata')); //document.getElementById('bmkdata').blur();
    }
    }
    }

    … by which to add Web Browser Bookmark Exporting Data File Content into that lower HTML textarea element (and unlock the two UL/LI and Table button elements) … as well as …
  • add a details/summary “reveal” means by which the user can show working actual HTML elements in addition to the HTML coding we’ve only be showing (with that “first draft”)
  • add Sharing functionality via either Email or SMS conduits

… and because the amounts of data can be large (and too big for a method=GET HTML form arrangement that clientside HTML/Javascript is capable of servicing) we were glad adding this Sharing functionality that yesterday we’d already started down the line of thinking that the …

  • lower HTML textarea content … would always be associated with …
  • hashtag … representation

… because with these methodologies the web server restrictions on (address bar) URL lengths (ie. error 414) melt away, at least for data lengths we’ve encountered with our testing so far, and that applies also to …

  • “mailto:” “a” URL links to Email a recipient … or …
  • “sms:” “a” URL links to SMS a recipient

… Sharing


var mysubject='My Bookmarked Links ...', xlocationhref='';
if (('' + location.hash).indexOf('bmkdata=') != -1) { locationhash=location.hash; }

function doemail() {
if (document.getElementById('bmkdata').value.trim() != '') {
locationhash='#bmkdata=' + window.btoa(encodeURIComponent(document.getElementById('bmkdata').value));
mysubject='My Bookmarked Links ...';
if (document.getElementById('dtone').value.trim() != '' && document.getElementById('dttwo').value.trim() != '') {
mysubject='My Bookmarked Links from ' + document.getElementById('dtone').value.trim() + ' to ' + document.getElementById('dttwo').value.trim() + ' ... ';
} else if (document.getElementById('dtone').value.trim() != '') {
mysubject='My Bookmarked Links from ' + document.getElementById('dtone').value.trim() + ' ... ';
} else if (document.getElementById('dttwo').value.trim() != '') {
mysubject='My Bookmarked Links up until ' + document.getElementById('dttwo').value.trim() + ' ... ';
}
if (ulli && !utable) {
recipient=prompt('Please enter email address to send to? Will output UL/LI else if some blanks will output Table. Default email Subject is ' + mysubject + ' ... but if you want a different one append a hash (#) followed by your own Subject for the Email.', '');
if (recipient == null) { recipient=''; } else if (recipient.indexOf('@') == -1) { recipient=''; } else if (eval('' + recipient.indexOf('#')) > eval('' + recipient.indexOf('@'))) { mysubject=recipient.split('#')[1]; recipient=recipient.split('#')[0]; }
if (recipient.indexOf(' ') != -1) {
locationhref=document.URL.split('?')[0].split('#')[0] + '?table=y&dtone=' + encodeURIComponent(document.getElementById('dtone').value) + '&dttwo=' + encodeURIComponent(document.getElementById('dttwo').value); // + '#bmkdata=' + encodeURIComponent(document.getElementById('bmkdata').value);
} else {
locationhref=document.URL.split('?')[0].split('#')[0] + '?ulli=y&dtone=' + encodeURIComponent(document.getElementById('dtone').value) + '&dttwo=' + encodeURIComponent(document.getElementById('dttwo').value); // + '#bmkdata=' + encodeURIComponent(document.getElementById('bmkdata').value);
}
xlocationhref=locationhref;
if (recipient.trim() != '') {
if (1 == 1) {
processit();
} else {
document.getElementById('spareshare').href='mailto:' + recipient.replace(/\ /g,'') + '?subject=' + encodeURIComponent(mysubject) + '&body=' + encodeURIComponent(locationhref + locationhash);
document.getElementById('spareshare').click();
recipient='';
}
}
} else if (utable) {
recipient=prompt('Please enter email address to send to? Will output UL/LI else if some blanks will output Table. Default email Subject is ' + mysubject + ' ... but if you want a different one append a hash (#) followed by your own Subject for the Email.', '');
if (recipient == null) { recipient=''; } else if (recipient.indexOf('@') == -1) { recipient=''; } else if (eval('' + recipient.indexOf('#')) > eval('' + recipient.indexOf('@'))) { mysubject=recipient.split('#')[1]; recipient=recipient.split('#')[0]; }
if (recipient.indexOf(' ') != -1) {
locationhref=document.URL.split('?')[0].split('#')[0] + '?table=y&dtone=' + encodeURIComponent(document.getElementById('dtone').value) + '&dttwo=' + encodeURIComponent(document.getElementById('dttwo').value); // + '#bmkdata=' + encodeURIComponent(document.getElementById('bmkdata').value);
} else {
locationhref=document.URL.split('?')[0].split('#')[0] + '?ulli=y&dtone=' + encodeURIComponent(document.getElementById('dtone').value) + '&dttwo=' + encodeURIComponent(document.getElementById('dttwo').value); // + '#bmkdata=' + encodeURIComponent(document.getElementById('bmkdata').value);
}
xlocationhref=locationhref;
if (recipient.trim() != '') {
if (1 == 1) {
processit();
} else {
document.getElementById('spareshare').href='mailto:' + recipient.replace(/\ /g,'') + '?subject=' + encodeURIComponent(mysubject) + '&body=' + encodeURIComponent(locationhref + locationhash);
document.getElementById('spareshare').click();
recipient='';
}
}
}
}
}

function dosms() {
if (document.getElementById('bmkdata').value.trim() != '') {
locationhash='#bmkdata=' + window.btoa(encodeURIComponent(document.getElementById('bmkdata').value));
if (ulli && !utable) {
recipient=prompt('Please enter SMS number to send to? Will output UL/LI else if some blanks will output Table.', '');
if (recipient == null) { recipient=''; } else if (recipient.trim() != '' && recipient.trim().replace(/0/g,'').replace(/1/g,'').replace(/2/g,'').replace(/3/g,'').replace(/4/g,'').replace(/5/g,'').replace(/6/g,'').replace(/7/g,'').replace(/8/g,'').replace(/9/g,'') != '') { recipient=''; }
if (recipient.indexOf(' ') != -1) {
locationhref=document.URL.split('?')[0].split('#')[0] + '?table=y&dtone=' + encodeURIComponent(document.getElementById('dtone').value) + '&dttwo=' + encodeURIComponent(document.getElementById('dttwo').value); // + '#bmkdata=' + encodeURIComponent(document.getElementById('bmkdata').value);
} else {
locationhref=document.URL.split('?')[0].split('#')[0] + '?ulli=y&dtone=' + encodeURIComponent(document.getElementById('dtone').value) + '&dttwo=' + encodeURIComponent(document.getElementById('dttwo').value); // + '#bmkdata=' + encodeURIComponent(document.getElementById('bmkdata').value);
}
xlocationhref=locationhref;
if (recipient.trim() != '') {
if (1 == 1) {
processit();
} else {
document.getElementById('spareshare').href='sms:' + recipient.replace(/\ /g,'') + '&body=' + encodeURIComponent(locationhref + locationhash);
document.getElementById('spareshare').click();
recipient='';
}
}
} else if (utable) {
recipient=prompt('Please enter SMS number to send to? Will output UL/LI else if some blanks will output Table.', '');
if (recipient == null) { recipient=''; } else if (recipient.trim() != '' && recipient.trim().replace(/0/g,'').replace(/1/g,'').replace(/2/g,'').replace(/3/g,'').replace(/4/g,'').replace(/5/g,'').replace(/6/g,'').replace(/7/g,'').replace(/8/g,'').replace(/9/g,'') != '') { recipient=''; }
if (recipient.indexOf(' ') != -1) {
locationhref=document.URL.split('?')[0].split('#')[0] + '?table=y&dtone=' + encodeURIComponent(document.getElementById('dtone').value) + '&dttwo=' + encodeURIComponent(document.getElementById('dttwo').value); // + '#bmkdata=' + encodeURIComponent(document.getElementById('bmkdata').value);
} else {
locationhref=document.URL.split('?')[0].split('#')[0] + '?ulli=y&dtone=' + encodeURIComponent(document.getElementById('dtone').value) + '&dttwo=' + encodeURIComponent(document.getElementById('dttwo').value); // + '#bmkdata=' + encodeURIComponent(document.getElementById('bmkdata').value);
}
xlocationhref=locationhref;
if (recipient.trim() != '') {
if (1 == 1) {
processit();
} else {
document.getElementById('spareshare').href='sms:' + recipient.replace(/\ /g,'') + '&body=' + encodeURIComponent(locationhref + locationhash);
document.getElementById('spareshare').click();
recipient='';
}
}
}
}
}

function fillin() {
if (document.getElementById('rt') && document.getElementById('rd') && document.getElementById('rs')) {
if (document.getElementById('rd').innerHTML == document.getElementById('rs').outerHTML) {
document.getElementById('rd').innerHTML=document.getElementById('rs').outerHTML + document.getElementById('rt').value;
}
}
}

// Coming back from an email or SMS link click ...


if (document.URL.indexOf('?') == -1 && ('' + location.hash).indexOf('bmkdata=') != -1) {
setTimeout(function(){
document.getElementById('resulting').innerHTML=decodeURIComponent(('' + location.hash).split('bmkdata=')[1]).replace('><summary', ' open><summary').replace('<details title=', '<details data-title=');
fillin();
}, 5000);
}

… concepts, happily. Keeping it all “just clientside” means we can be talking meaningfully to a larger chunk of audience … if you’re listening, that is?!

So, again, feel free to try our “second draft” dated_bookmarks.html Dated Bookmark Export web application, yourself, perhaps below.


Previous relevant Making of Ffmpeg Video Overall Effects Tutorial is shown below.

Making of Ffmpeg Video Overall Effects Tutorial

Making of Ffmpeg Video Overall Effects Tutorial

At the end of yesterday’s Ffmpeg Video Overall Effects Tutorial there was an Unordered List …

… of links, am sure a lot of you would guess, were gleaned (within our Google Chrome web browser History (of that day)) Bookmarked (by us) webpages. We actually compiled via (the clunky and fairly slow) …

  • left half (of screen) with (Google Chrome) History showing, and right half with BBEdit Text Editor open at a new (ostensibly empty) file with loads of empty records available, and dragged URL records (identifiable, for us, via an asterisk, indicating a webpage was Bookmarked) from the left into the right to bring over the URLs (only) above, the rest constructed in a more manual way … and another way could have been …
  • use Google Chrome webpage showing Bookmark list and use its Export Bookmarks (no other choice but “All”) to a file that could be waded through to derive the list above … and then we thought of chance to code for …
  • hybrid “inhouse” clientside (ie. HTML/Javascript/CSS) web application …

    … so far asking for the content of a web browser Export Bookmarks operation’s output file’s HTML (in the case of Google Chrome) content in an HTML textarea element (the user can fill in themselves), and filterable via two input type=datetime-local starting and ending datetime(s) of interest (the user can fill in, optionally)

… and we wish we could have got that hour and a half back, from yesterday, via swapping yesterday for today?!

Feel free to try our “first draft” proof of concept Dated Bookmark Export web application, yourself.

Did you know?

Not all web browser brands have any Export Bookmarks functionality, like Google Chrome offers here on macOS. We’re going to be examining others, over time, and try to make our inhouse logic fit in with how that Bookmark data looks, on export, should we find any other Web Browser brands offering this functionality.


Previous relevant Ffmpeg Video Overall Effects Tutorial is shown below.

Ffmpeg Video Overall Effects Tutorial

Ffmpeg Video Overall Effects Tutorial

Today’s work (all on our macOS MAMP local Apache/PHP/MySQL web server environment) is only “toe dipping” in a “great big sea of possibilities” regarding the great ffmpeg‘s “filtering style abilities” further to yesterday’s Ffmpeg Video Subliminal Message Tutorial, but …

  • as you try out things you discover others …
  • can be a foot in the door researching this type of work yourself …

… we’re hoping. And it’s not as if ffmpeg was on it’s own here with the second concept below …

  1. fade in and fade out video effect … inspired by Top 20 best commands for FFmpeg to try …

    ffmpeg -i brush__turkey.m4v -vf "fade=in:0:5,fade=out:73:5" brushturkey_fadein_fadeout.m4v
  2. colour balancing improvements regarding an underexposed video

… as the …

  • Gimp image editor’s abilities (matching a lot of what you read Photoshop can help with too) with Curves helped out … along with …
  • Python expertly designed to link Gimp and ffmpeg “whole of video” manipulations

… enacting …

  1. selection of a video still image, ideally not containing the Brush Turkey …
  2. open image in Gimp
  3. “Aoife”‘esque Colours -> Curves…
  4. opens Adjust Colour Curves subwindow (initially a straight line)
  5. but dragging it to become a curve in a way that brightens the underexposed image to improve … we then …
  6. click + button to Save presets to a name …
  7. controlled by left pointing infilled triangle icon click that Manages Presets … and we ended up with …
  8. bush_-_turkey.presets


  9. and then we discovered this Converts GIMP colour curve to something the FFmpeg can read in the curve filter excellent project, the extraction of the Python there allowing us to go …

    python3 ../gimp_curves_ffmpeg.py

    … to output brush.out

  10. which formed most of the final curves — ffmpeg examples inspired ffmpeg command …

    ffmpeg -y -i brush__turkey.m4v -filter_complex "
    [0:v]
    curves=
    master='0.0/0 0.01171875/0.033751864777061671 0.0234375/0.067435644319434537 0.03515625/0.10098325339242978 0.046875/0.1343266067613586 0.05859375/0.16739761919153215 0.0703125/0.20012820544826168 0.08203125/0.23245028029685835 0.09375/0.26429575850263332 0.10546875/0.29559655483089792 0.1171875/0.32628458404696314 0.12890625/0.35629176091614018 0.140625/0.38555000020374036 0.15234375/0.41399121667507488 0.1640625/0.44154732509545486 0.17578125/0.46815024023019147 0.1875/0.49373187684459596 0.19921875/0.51822414970397945 0.2109375/0.54155897357365324 0.22265625/0.56366826321892849 0.234375/0.58448393340511628 0.24609375/0.6039378988975278 0.2578125/0.62196207446147445 0.26953125/0.63848837486226717 0.28125/0.65344871486521738 0.29296875/0.66677500923563593 0.3046875/0.67964838149075235 0.31640625/0.6910493179152648 0.328125/0.70214399210941336 0.33984375/0.71293769240972005 0.3515625/0.72343570715270744 0.36328125/0.73364332467489723 0.375/0.74356583331281156 0.38671875/0.75320852140297312 0.3984375/0.76257667728190348 0.41015625/0.77167558928612512 0.421875/0.78051054575216006 0.43359375/0.78908683501653032 0.4453125/0.7974097454157586 0.45703125/0.80548456528636625 0.46875/0.81331658296487608 0.48046875/0.82091108678780988 0.4921875/0.82827336509169003 0.50390625/0.83540870621303842 0.515625/0.84232239848837742 0.52734375/0.84901973025422939 0.5390625/0.85550598984711601 0.55078125/0.86178646560355965 0.5625/0.86786644586008233 0.57421875/0.87375121895320629 0.5859375/0.87944607321945378 0.59765625/0.88495629699534695 0.609375/0.89028717861740791 0.62109375/0.89544400642215893 0.6328125/0.90043206874612158 0.64453125/0.90525665392581867 0.65625/0.9099230502977721 0.66796875/0.91443654619850423 0.6796875/0.91880242996453687 0.69140625/0.92302598993239249 0.703125/0.92711251443859277 0.71484375/0.93106729181966053 0.7265625/0.93489561041211733 0.73828125/0.93860275855248565 0.75/0.94219402457728751 0.76171875/0.94567469682304517 0.7734375/0.94905006362628086 0.78515625/0.95232541332351639 0.796875/0.95550603425127423 0.80859375/0.9585972147460764 0.8203125/0.96160424314444504 0.83203125/0.96453240778290228 0.84375/0.96738699699797048 0.85546875/0.97017329912617156 0.8671875/0.97289660250402765 0.87890625/0.97556219546806111 0.890625/0.97817536635479407 0.90234375/0.98074140350074845 0.9140625/0.98326559524244661 0.92578125/0.98575322991641046 0.9375/0.98820959585916268 0.94921875/0.99063998140722487 0.9609375/0.99304967489711937 0.97265625/0.99544396466536833 0.984375/0.9978281390484941 0.99609375/1":red="0.0/0 0.01171875/0.011764705882352943 0.0234375/0.023529411764705879 0.03515625/0.035294117647058816 0.046875/0.047058823529411764 0.05859375/0.058823529411764712 0.0703125/0.07058823529411766 0.08203125/0.082352941176470587 0.09375/0.094117647058823528 0.10546875/0.10588235294117647 0.1171875/0.11764705882352938 0.12890625/0.12941176470588237 0.140625/0.14117647058823532 0.15234375/0.15294117647058825 0.1640625/0.1647058823529412 0.17578125/0.17647058823529413 0.1875/0.18823529411764706 0.19921875/0.20000000000000007 0.2109375/0.21176470588235291 0.22265625/0.22352941176470589 0.234375/0.23529411764705882 0.24609375/0.24705882352941175 0.2578125/0.25882352941176473 0.26953125/0.27058823529411768 0.28125/0.28235294117647064 0.29296875/0.29411764705882348 0.3046875/0.30588235294117649 0.31640625/0.31764705882352934 0.328125/0.3294117647058824 0.33984375/0.3411764705882353 0.3515625/0.35294117647058826 0.36328125/0.3647058823529411 0.375/0.37647058823529411 0.38671875/0.38823529411764712 0.3984375/0.39999999999999997 0.41015625/0.41176470588235292 0.421875/0.42352941176470582 0.43359375/0.43529411764705883 0.4453125/0.44705882352941184 0.45703125/0.45882352941176474 0.46875/0.47058823529411764 0.48046875/0.48235294117647054 0.4921875/0.49411764705882355 0.50390625/0.50588235294117645 0.515625/0.51764705882352946 0.52734375/0.52941176470588236 0.5390625/0.54117647058823526 0.55078125/0.55294117647058827 0.5625/0.56470588235294117 0.57421875/0.57647058823529407 0.5859375/0.58823529411764708 0.59765625/0.59999999999999998 0.609375/0.61176470588235299 0.62109375/0.62352941176470589 0.6328125/0.63529411764705879 0.64453125/0.6470588235294118 0.65625/0.65882352941176481 0.66796875/0.6705882352941176 0.6796875/0.68235294117647061 0.69140625/0.69411764705882351 0.703125/0.70588235294117663 0.71484375/0.71764705882352942 0.7265625/0.7294117647058822 0.73828125/0.74117647058823533 0.75/0.75294117647058822 0.76171875/0.76470588235294112 0.7734375/0.77647058823529425 0.78515625/0.78823529411764703 0.796875/0.80000000000000004 0.80859375/0.81176470588235294 0.8203125/0.82352941176470584 0.83203125/0.83529411764705874 0.84375/0.84705882352941175 0.85546875/0.85882352941176465 0.8671875/0.87058823529411766 0.87890625/0.88235294117647056 0.890625/0.89411764705882357 0.90234375/0.90588235294117636 0.9140625/0.91764705882352937 0.92578125/0.92941176470588238 0.9375/0.94117647058823528 0.94921875/0.95294117647058818 0.9609375/0.96470588235294119 0.97265625/0.97647058823529409 0.984375/0.98823529411764721 0.99609375/1":green="0.0/0 0.01171875/0.011764705882352943 0.0234375/0.023529411764705879 0.03515625/0.035294117647058816 0.046875/0.047058823529411764 0.05859375/0.058823529411764712 0.0703125/0.07058823529411766 0.08203125/0.082352941176470587 0.09375/0.094117647058823528 0.10546875/0.10588235294117647 0.1171875/0.11764705882352938 0.12890625/0.12941176470588237 0.140625/0.14117647058823532 0.15234375/0.15294117647058825 0.1640625/0.1647058823529412 0.17578125/0.17647058823529413 0.1875/0.18823529411764706 0.19921875/0.20000000000000007 0.2109375/0.21176470588235291 0.22265625/0.22352941176470589 0.234375/0.23529411764705882 0.24609375/0.24705882352941175 0.2578125/0.25882352941176473 0.26953125/0.27058823529411768 0.28125/0.28235294117647064 0.29296875/0.29411764705882348 0.3046875/0.30588235294117649 0.31640625/0.31764705882352934 0.328125/0.3294117647058824 0.33984375/0.3411764705882353 0.3515625/0.35294117647058826 0.36328125/0.3647058823529411 0.375/0.37647058823529411 0.38671875/0.38823529411764712 0.3984375/0.39999999999999997 0.41015625/0.41176470588235292 0.421875/0.42352941176470582 0.43359375/0.43529411764705883 0.4453125/0.44705882352941184 0.45703125/0.45882352941176474 0.46875/0.47058823529411764 0.48046875/0.48235294117647054 0.4921875/0.49411764705882355 0.50390625/0.50588235294117645 0.515625/0.51764705882352946 0.52734375/0.52941176470588236 0.5390625/0.54117647058823526 0.55078125/0.55294117647058827 0.5625/0.56470588235294117 0.57421875/0.57647058823529407 0.5859375/0.58823529411764708 0.59765625/0.59999999999999998 0.609375/0.61176470588235299 0.62109375/0.62352941176470589 0.6328125/0.63529411764705879 0.64453125/0.6470588235294118 0.65625/0.65882352941176481 0.66796875/0.6705882352941176 0.6796875/0.68235294117647061 0.69140625/0.69411764705882351 0.703125/0.70588235294117663 0.71484375/0.71764705882352942 0.7265625/0.7294117647058822 0.73828125/0.74117647058823533 0.75/0.75294117647058822 0.76171875/0.76470588235294112 0.7734375/0.77647058823529425 0.78515625/0.78823529411764703 0.796875/0.80000000000000004 0.80859375/0.81176470588235294 0.8203125/0.82352941176470584 0.83203125/0.83529411764705874 0.84375/0.84705882352941175 0.85546875/0.85882352941176465 0.8671875/0.87058823529411766 0.87890625/0.88235294117647056 0.890625/0.89411764705882357 0.90234375/0.90588235294117636 0.9140625/0.91764705882352937 0.92578125/0.92941176470588238 0.9375/0.94117647058823528 0.94921875/0.95294117647058818 0.9609375/0.96470588235294119 0.97265625/0.97647058823529409 0.984375/0.98823529411764721 0.99609375/1":blue="0.0/0 0.01171875/0.011764705882352943 0.0234375/0.023529411764705879 0.03515625/0.035294117647058816 0.046875/0.047058823529411764 0.05859375/0.058823529411764712 0.0703125/0.07058823529411766 0.08203125/0.082352941176470587 0.09375/0.094117647058823528 0.10546875/0.10588235294117647 0.1171875/0.11764705882352938 0.12890625/0.12941176470588237 0.140625/0.14117647058823532 0.15234375/0.15294117647058825 0.1640625/0.1647058823529412 0.17578125/0.17647058823529413 0.1875/0.18823529411764706 0.19921875/0.20000000000000007 0.2109375/0.21176470588235291 0.22265625/0.22352941176470589 0.234375/0.23529411764705882 0.24609375/0.24705882352941175 0.2578125/0.25882352941176473 0.26953125/0.27058823529411768 0.28125/0.28235294117647064 0.29296875/0.29411764705882348 0.3046875/0.30588235294117649 0.31640625/0.31764705882352934 0.328125/0.3294117647058824 0.33984375/0.3411764705882353 0.3515625/0.35294117647058826 0.36328125/0.3647058823529411 0.375/0.37647058823529411 0.38671875/0.38823529411764712 0.3984375/0.39999999999999997 0.41015625/0.41176470588235292 0.421875/0.42352941176470582 0.43359375/0.43529411764705883 0.4453125/0.44705882352941184 0.45703125/0.45882352941176474 0.46875/0.47058823529411764 0.48046875/0.48235294117647054 0.4921875/0.49411764705882355 0.50390625/0.50588235294117645 0.515625/0.51764705882352946 0.52734375/0.52941176470588236 0.5390625/0.54117647058823526 0.55078125/0.55294117647058827 0.5625/0.56470588235294117 0.57421875/0.57647058823529407 0.5859375/0.58823529411764708 0.59765625/0.59999999999999998 0.609375/0.61176470588235299 0.62109375/0.62352941176470589 0.6328125/0.63529411764705879 0.64453125/0.6470588235294118 0.65625/0.65882352941176481 0.66796875/0.6705882352941176 0.6796875/0.68235294117647061 0.69140625/0.69411764705882351 0.703125/0.70588235294117663 0.71484375/0.71764705882352942 0.7265625/0.7294117647058822 0.73828125/0.74117647058823533 0.75/0.75294117647058822 0.76171875/0.76470588235294112 0.7734375/0.77647058823529425 0.78515625/0.78823529411764703 0.796875/0.80000000000000004 0.80859375/0.81176470588235294 0.8203125/0.82352941176470584 0.83203125/0.83529411764705874 0.84375/0.84705882352941175 0.85546875/0.85882352941176465 0.8671875/0.87058823529411766 0.87890625/0.88235294117647056 0.890625/0.89411764705882357 0.90234375/0.90588235294117636 0.9140625/0.91764705882352937 0.92578125/0.92941176470588238 0.9375/0.94117647058823528 0.94921875/0.95294117647058818 0.9609375/0.96470588235294119 0.97265625/0.97647058823529409 0.984375/0.98823529411764721 0.99609375/1'
    [v]" -map '[v]' -an brushturkey_better_colour.m4v

… was crucial to our discoveries today

  1. fade in and fade out video effect …
  2. colour balancing improvements regarding an underexposed video …

Further reading for you here, could involve …


Previous relevant Ffmpeg Video Subliminal Message Tutorial is shown below.

Ffmpeg Video Subliminal Message Tutorial

Ffmpeg Video Subliminal Message Tutorial

Revisiting the brilliant ffmpeg, as discussed at the recent Ffmpeg Install and Public Face Tutorial

  • the other day we were reading the excellent Fastest way to extract frames using ffmpeg? and noted it down for a future discussion … and then today …
  • we were inspired by a Brush Turkey which we videoed via an iPhone’s Camera app’s Video mode of capture option …
  • downloaded to this MacBook Air (via AirDrop … good for Apple sharing when the sizes get big … raw video 1:19s long)

And that’s where we are at here, thinking this would be a good opportunity to try creating a Subliminal Message video. But before we go on and “give the game away” you may want to see the result of our Subliminal Message insertion via ffmpeg theme to our work, in action, below. Unlock or give up to unlock the content below the video quiz below …

What is the secret word?
Raw video … to it’s slides …
ffmpeg -i ../IMG_2784.MOV -r 1/1 %03d.jpg
ffmpeg -i %03d.jpg brush_turkey.m4v
Hard guess?
ffmpeg -r 8 -i %03d.jpg brush-turkey.m4v
Easier guess?
ffmpeg -r 6 -i %03d.jpg brush__turkey.m4v


Previous relevant Ffmpeg Install and Public Face Tutorial is shown below.

Ffmpeg Install and Public Face Tutorial

Ffmpeg Install and Public Face Tutorial

Our recent web server VPS migration can not only be …

  • a migration of functionality (eg. this WordPress blog) … as well as …
  • an opportunity to open up new vistas of serverside functionality

… such as today’s ffmpeg install, which is only feasible because of the …

  • additional diskspace … chance on new web server allows for …
  • chance to install ffmpeg …

    dnf config-manager --set-enabled powertools
    dnf install --nogpgcheck https://mirrors.rpmfusion.org/free/el/rpmfusion-free-release-$(rpm -E %rhel).noarch.rpm -y
    dnf install --nogpgcheck https://mirrors.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-$(rpm -E %rhel).noarch.rpm -y
    dnf install ffmpeg

    … thanks to this great link, along with ImageMagick …

… on this new “public face” (even more public when DNS is applied later).

Codewise this involved …

… further to recent work touching these ideas with Animated GIF Creator Overlayed Images Top Left Tutorial.

See some of this public install of ffmpeg here.


Previous relevant Animated GIF Creator Overlayed Images Top Left Tutorial is shown below.

Animated GIF Creator Overlayed Images Top Left Tutorial

Animated GIF Creator Overlayed Images Top Left Tutorial

To add to the recent Animated GIF Creator Overlayed Images Tutorial‘s user interaction logic, we add a way to control those two “overlay” CSS properties …

  • left
  • top

… but more in the sense that we allow CSS …

  • margin-eft
  • margin-top

… come into the picture, after a dalliance with CSS calc thoughts.

This allows for offsetted images be part of the “overlay mix” that you can retry this at our changed tutorial_to_animated_gif.php inhouse public domain Animated GIF Creator.


Previous relevant Animated GIF Creator Overlayed Images Tutorial is shown below.

Animated GIF Creator Overlayed Images Tutorial

Animated GIF Creator Overlayed Images Tutorial

We wanted to add an “Overlayed Images” functionality component to the “Animated GIF Creator” of Animated GIF Creator Video Intranet Tutorial, today.

The work involves both of the HTML design “big concepts” we are keen on at this blog …

  • overlay … via CSS control of
    1. position:absolute;top:0px;left:0px;
    2. opacity:1.0;
    3. z-index:1;
  • reveal … lately, mostly, via HTML use of …
    1. details
    2. summary

… the latter being the “container” for our interactive input be able to control overlay items 2 and 3, which affect the “overlayed images” output display via the clicking of a new “Overlay Images” button. That button …


<input disabled onclick="overlaythem();" id="overlayit" type="button" title='Overlay Images' value='Overlay Images'></input>

… starts off as disabled … and works with new HTML div elements …


<div id=overlayedj><h1>&nbsp;</h1><br></div><div id=overlayedi></div>

… until at least two images are defined, at which time the button becomes enabled …


function onfit(ithis) {
if (ithis.value == '' && ('' + ithis.placeholder).indexOf(']') != -1) {
ithis.value=('' + ithis.placeholder).split('[')[1].split(']')[0];
}
ithis.type='number';
}

function overlayds(inm, newop, newzi) {
var outdets='';
var divrect=null;
var poslt=' data-style=\"position:absolute;left:px;top:px;\" ';
var reposit='';
if (!document.getElementById('detsum' + ('' + inm))) {
if (document.getElementById('overlayedi').innerHTML == '') {
document.getElementById('overlayedi').title='Overlayed Images Below ... Click for It in New Window ...';
document.getElementById('overlayedj').innerHTML='<h1>Overlayed Images Below ...</h1><br>';
divrect=document.getElementById('overlayedi').getBoundingClientRect();
poslt=' data-style=\"position:absolute;left:' + ('' + divrect.left).split('.')[0].trim() + 'px;top:' + ('' + eval(200 + eval('' + ('' + divrect.top).split('.')[0]))).trim() + 'px;\" ';
} else {
poslt=' data-style=\"' + document.getElementById('detsum1').getAttribute('data-style') + '\" ';
}
outdets='&nbsp;&nbsp;<details ' + poslt + ' id=\"detsum' + ('' + inm) + '\" style=\" display:inline-block; \" open><summary id=\"sumdet' + ('' + inm) + '\">Overlay</summary><input onchange=overlayds(' + inm + ',this.value,String.fromCharCode(32)); onblur=overlayds(' + inm + ',this.value,String.fromCharCode(32)); type=text onfocus=onfit(this); id=\"opacity' + ('' + inm) + '\" style=\" display:inline-block; \" placeholder=\"Opacity [1.00]\" value=\"\" step=0.01 min=0.00 max=1.00></input><br><input onfocus=onfit(this); onchange=overlayds(' + inm + ',String.fromCharCode(32),this.value); onblur=overlayds(' + inm + ',String.fromCharCode(32),this.value); type=text id=\"zindex' + ('' + inm) + '\" style=\" display:inline-block; \" placeholder=\"Z-Index [1]\" value=\"\" min==999 max=999 step=1></input><br></details>';
reposit=poslt.replace(' data-',' ');
reposit=reposit.replace('\"', '\"opacity:1.0;z-index:1;');
if (document.getElementById('overlayedi').innerHTML == '') {
document.getElementById('overlayedi').innerHTML='<img id=\"imgdet' + ('' + inm) + '\" src=\"' + document.getElementById('slideshow' + ('' + inm).replace(/^1$/g,'')).value + '\" ' + reposit + '></img>';
document.getElementById('overlayedi').style.width=('' + document.getElementById('imgdet' + ('' + inm)).width).replace('px','') + 'px';
document.getElementById('overlayedi').style.height=('' + document.getElementById('imgdet' + ('' + inm)).height).replace('px','') + 'px';
document.getElementById('overlayedi').onclick = function(){ var woo=window.open('','_blank','top=100,left=100,width=' + document.getElementById('overlayedi').style.width.replace('px','') + ',height=' + document.getElementById('overlayedi').style.height.replace('px','')); woo.document.write('<html><head><title>Overlayed Images Below ...</title></head><body>' + document.getElementById('overlayedi').outerHTML.replace(/left\:[\ ]*/g,'left:0.0').replace(/top\:[\ ]*/g,'top:0.0') + '</body></html>'); woo.document.title='Overlayed Images Below ...'; };
} else {
document.getElementById('overlayedi').innerHTML+='<img id=\"imgdet' + ('' + inm) + '\" src=\"' + document.getElementById('slideshow' + ('' + inm).replace(/^1$/g,'')).value + '\" ' + reposit + '></img>';
}
} else {
document.getElementById('detsum' + ('' + inm)).style.display='inline-block';
if (newop != ' ') {
if (newop.trim() == '') {
document.getElementById('imgdet' + inm).style.opacity='1.0';
} else {
document.getElementById('imgdet' + inm).style.opacity='' + newop;
}
}
if (newz != ' ') {
if (newz.trim() == '') {
document.getElementById('imgdet' + inm).style.zIndex='1';
} else {
document.getElementById('imgdet' + inm).style.zIndex='' + newzi;
}
}
}
return outdets;
}

function overlaythem() {
var suffidea=1;
while (document.getElementById('slideshow' + ('' + suffidea).replace(/^1$/g, '')).value != '') {
document.getElementById('ours' + ('' + suffidea)).innerHTML+=overlayds(suffidea,'','');
suffidea++;
}
}

You can try this at our changed tutorial_to_animated_gif.php inhouse public domain Animated GIF Creator.


Previous relevant Animated GIF Creator Video Intranet Tutorial is shown below.

Animated GIF Creator Video Intranet Tutorial

Animated GIF Creator Video Intranet Tutorial

With the recent Animated GIF Creator Video Revisit Tutorial (preceding Animated GIF Creator Video Share Tutorial) we wrote …

… one reason being that we do not want to install the wonderful ffmpeg (command line video creation tool) on the RJM Programming domain, but, in macOS, here with MAMP, we are quite happy to live with the Homebrew (Terminal application’s) install …

… setting up what could be “lost functionality”, but today, we come around to either adding a new …


Convert to Video

… dropdown option should all be ritchy ditch, and if not, often we will add new “Advice” dropdown options to remind the user what they’d need to arrange to get to a “Convert to Video” scenario.

Selecting “Convert to Video” sets up a hydrid “Internet/Intranet” feeling scenario where …

  • the user is using our changed tutorial_to_animated_gif.php inhouse public domain Animated GIF Creator containing this new “Convert to Video” option off the “ImageMagick” dropdown …
  • the user defines some image slide data … eg. browsing to create data-URIs (but careful not to do too many) …
  • the user selects that “Convert to Video” option …
  • a window.open popup calls URL like …
    HTTP://localhost:8888/PHP/animegif/tutorial_to_animated_gif.php?video=1687644
    … in a new window …
  • those data-URIs are converted into /tmp/jmtmp0*.[imageExt] files … ready for …
  • ffmpeg commands like …

    ffmpeg -framerate 0.1 -i /tmp/jmtmp%03d.jpeg -c:v libvpx-vp9 -pix_fmt yuva420p -lossless 1 -c:a copy video.webm; ffmpeg -i video.webm video.mov 2>> video.bad

    … be nested in PHP exec (via MAMP local web server incarnation of the inhouse Animated GIF Creator) as a way to create videos …
  • which can be downloaded within that public domain “parent” inhouse Animated GIF Creator session

Which begs the question …


How do we know when to offer the "Convert to Video" option on that dropdown?

This logic is centred around a few useful ideas (with this cross domain scenario ruling out Ajax and Iframe src= definitions, as useful ways to go) …

  1. open the MAMP local web server “HTTP://localhost:8888/PHP/animegif/tutorial_to_animated_gif.php” URLs in an iframe (with onload event logics) pointed at by a window.open second argument (effectively avoiding any loose useful or not popup windows hanging around) …
  2. the most we can ask at the receiver is that window.opener is defined … and if so, just at that discovery …
  3. an image called “amhere.jpg” is created via PHP GD functionality … and back at the “public domain” parent within the iframe onload logic (where with contentWindow or contentDocument do not expect a document.body or even a document) …
  4. we attempt to “hotlink” that MAMP local web server image … as per …

    var tryit='http://localhost:8888/PHP/animegif/amhere.jpg';

    document.getElementById('ctvopt').value='advice';
    document.getElementById('ctvopt').innerHTML='Advice on Convert to Video';

    if (tryit != '') {
    var im=new Image();

    im.onload = function() {
    document.getElementById('ctvopt').value='video';
    console.log('this.height=' + eval('' + this.height));
    if (eval('' + this.height) >= 20) {
    document.getElementById('ctvopt').innerHTML='Convert to Video';
    } else {
    document.getElementById('ctvopt').innerHTML='Convert to Video (but ffmpeg not installed or in unexpected place)';
    }
    document.getElementById('imsel').title='All except Convert to Video, which needs ffmpeg installed, use ImageMagick';
    };


    im.src=tryit;
    tryit='';
    }


Previous relevant Animated GIF Creator Video Revisit Tutorial is shown below.

Animated GIF Creator Video Revisit Tutorial

Animated GIF Creator Video Revisit Tutorial

We hope you realize that our changed tutorial_to_animated_gif.php inhouse Animated GIF Creator (helped out by a changed emailhtml.php inhouse email creator helper serverside PHP web application) can be accessed …

  1. in that public RJM Programming mode of use above … but even better can be …
  2. download relevant code to macOS MAMP local web server places off /Applications/MAMP/htdocs/ $_SERVER[‘DOCUMENT_ROOT’] places …

    … and check the code for the validity of any ImageMagick paths … and if not all these conditions, simulate the same and cobble it together in the code

… one reason being that we do not want to install the wonderful ffmpeg (command line video creation tool) on the RJM Programming domain, but, in macOS, here with MAMP, we are quite happy to live with the Homebrew (Terminal application’s) install …


brew install ffmpeg

… to open a whole new woooooorrrrlllllddd of video creation opportunities using this MAMP local web URL …


HTTP://localhost:8888/PHP/animegif/tutorial_to_animated_gif.php# Animated GIF Creator on MAMP local web server

And so, onto yesterday’s Animated GIF Creator PDF Last Reveal Tutorial we decided to revisit video creation parts of our inhouse Animated GIF Creator on this MacBook Air. We needed to reinstall ffmpeg, and we show that in today’s animated GIF tutorial picture and also created the “video.mov” video below, in the process …

… we tweaked out of “video/mp4” ffmpeg created videos thinking towards “video/webm” or “video.mov” ffmpeg created videos that suit the “few frames but spaced out video” we wanted to achieve for all practical purposes, that “video/mp4” playing too fast for us to see anything much but the first and last slide …

<?php

$videofr=" -r " . (1000 / $delay) . " ";
$videofr=" -r " . (1000 / $delay) . " -filter:v setpts=" . ($delay / 1000) . "*PTS ";
$videomime="video/mp4";
$videoext=".mp4";

$videofr=" -framerate 0.1 ";
$videoext=".webm";
$videomime="video/webm";
$videomidbit="-c:v libvpx-vp9 -pix_fmt yuva420p -lossless 1 -c:a copy";
//$videocmd=$videopath . "ffmpeg -r " . (1000 / $delay) . " -filter:v setpts=" . ($delay / 1000) . "*PTS " . " -i " . dirname(__FILE__) . DIRECTORY_SEPARATOR . "%03d.jpg " . dirname(__FILE__) . DIRECTORY_SEPARATOR . "video.mp4 2> " . dirname(__FILE__) . DIRECTORY_SEPARATOR . "video.bad";
//$svideocmd="ffmpeg -r " . (1000 / $delay) . " -filter:v setpts=" . ($delay / 1000) . "*PTS " . " -i " . "%03d.jpg " . "video.mp4";
$videocmd=$videopath . "ffmpeg " . $videofr . " -i " . dirname(__FILE__) . DIRECTORY_SEPARATOR . "%03d.jpg " . $videomidbit . " " . dirname(__FILE__) . DIRECTORY_SEPARATOR . "video" . $videoext . " 2> " . dirname(__FILE__) . DIRECTORY_SEPARATOR . "video.bad";
$svideocmd="ffmpeg " . $videofr . " -i " . "%03d.jpg " . $videomidbit . " " . "video" . $videoext;
$videocmd.="; " . $videopath . "ffmpeg -i " . " " . dirname(__FILE__) . DIRECTORY_SEPARATOR . "video" . $videoext . " " . dirname(__FILE__) . DIRECTORY_SEPARATOR . "video.mov 2>> " . dirname(__FILE__) . DIRECTORY_SEPARATOR . "video.bad";
$svideocmd.="; " . "ffmpeg -i " . " " . dirname(__FILE__) . DIRECTORY_SEPARATOR . "video" . $videoext . " " . dirname(__FILE__) . DIRECTORY_SEPARATOR . "video.mov 2>> " . dirname(__FILE__) . DIRECTORY_SEPARATOR . "video.bad";
$videohtml="<video title='" . $svideocmd . "' controls id=ivideo type='" . $videomime . "'><source src='video.mov'></source><source src='video" . $videoext . "'></source></video>";
$videosuffix="";

?>


Previous relevant Animated GIF Creator PDF Last Reveal Tutorial is shown below.

Animated GIF Creator PDF Last Reveal Tutorial

Animated GIF Creator PDF Last Reveal Tutorial

As a web application programmer we like buttons. There are “buttons” and there are buttons. Yes, there is an HTML button element, and it and the input type=button element render as that part of a webpage most recognizable to users the world over. You click or tap this button and something usually happens.

But we also enjoy “Emoji Buttons” for we graphically challenged programmers. Using an emoji text and graphic can make span elements or p elements or lots of other HTML elements that have an innerHTML property, be like a very succinct button like entity, also appreciated around here because it takes up so little webpage “real estate”.

And so onto yesterday’s Animated GIF Creator PDF Order Tutorial we set about, today, “revealing” any enduring animated GIF and/or PDF created during a previous session, using Emoji Buttons as the email/SMS sharing action buttons.

We say “revealing” because, like the way “Emoji Buttons” save webpage “real estate”, so can the use of the HTML5 details/summary element combination. It is in that summary “enduring” header part of that combination we can place some “Emoji Buttons”. You will (once you start creating and sharing animated GIFs and/or PDFs) see from our changed tutorial_to_animated_gif.php inhouse Animated GIF Creator (helped out by a changed emailhtml.php inhouse email creator helper serverside PHP web application) that we place three Emoji Buttons …

  1. 📟 SMS (Animated GIF or PDF) Limited relevance period (ie. no data URIs involved, so rely on an absolute URL whose content might change or start not to exist down the track) … via “a” “sms:” link click/tap
  2. 📧 Email (Animated GIF or PDF) Limited relevance period (ie. no data URIs involved, so rely on an absolute URL whose content might change or start not to exist down the track) … via “a” “mailto:” link click/tap
  3. 📧 Email (Animated GIF or PDF) Enduring relevance (ie. data URIs involved, so do not rely on any absolute URL whose content might change or start not to exist down the track) … via PHP mail function means of sending email with HTML attachment containing the relevant Animated GIF or PDF

Yes, “Emoji Buttons” can have their size controlled but not by the usual CSS width and height properties, but by the CSS font-size property. Here is the new Javascript function that those Emoji Button “onclick” logic points to …

<?php eho ”

function askes(isemail, isoab) {
var esask='', izhr=null, izform=null;
var isoa=document.getElementById(isoab.id.replace('b',''));
if (isemail) {
esask=prompt('Please enter email address to send this to', '');
if (esask != null) {
if (esask.indexOf('@') != -1) {
if (isoa.outerHTML.indexOf('<img') == 0) {
//alert('More Animated GIF to come');
izhr = new XMLHttpRequest();
izform=new FormData();
izform.append('to', esask.trim());
izform.append('inline', '" . dirname(__FILE__) . DIRECTORY_SEPARATOR . server_remote_addr() . ".gif" . "');
izform.append('subj', 'My Latest Animated GIF via RJM Programming ... ');
izform.append('tdhuhta', ('<body><div title=\"" . explode('/animegif',$durlis)[0] . '/animegif/' . server_remote_addr() . "\" style=\"overflow:auto;-webkit-overflow-scrolling:touch;height:100%;\"><img style=\"width:100%;height:900px;\" src=\"" . dirname(__FILE__) . DIRECTORY_SEPARATOR . server_remote_addr() . ".gif" . "\"></img></div></body>'));
izhr.open('post', '//www.rjmprogramming.com.au/HTMLCSS/emailhtml.php', true);
izhr.send(izform);
} else if (isoa.outerHTML.indexOf('<a') != 0) {
//alert('More PDF to come');
izhr = new XMLHttpRequest();
izform=new FormData();
izform.append('to', esask.trim());
izform.append('inline', '" . dirname(__FILE__) . DIRECTORY_SEPARATOR . server_remote_addr() . "_animegif.pdf" . "');
izform.append('subj', 'My Latest PDF via Animated GIF via RJM Programming ... ');
izform.append('tdhuhta', ('<body><div title=\"" . explode('/animegif',$durlis)[0] . '/animegif/' . server_remote_addr() . "_\" style=\"overflow:auto;-webkit-overflow-scrolling:touch;height:100%;\"><object style=\"width:100%;height:900px;\" type=\"application/pdf\" data=\"" . dirname(__FILE__) . DIRECTORY_SEPARATOR . server_remote_addr() . "_animegif.pdf" . "\"></object></div></body>'));
izhr.open('post', '//www.rjmprogramming.com.au/HTMLCSS/emailhtml.php', true);
izhr.send(izform);
} else {
isoa.href='mailto:' + esask.trim() + '?' + isoa.href.split('?')[1];
isoa.click();
}
}
}
} else {
esask=prompt('Please enter SMS number to send this to', '');
if (esask != null) {
if ((esask.trim() != '' && esask.trim().replace(/0/g,'').replace(/1/g,'').replace(/2/g,'').replace(/3/g,'').replace(/4/g,'').replace(/5/g,'').replace(/6/g,'').replace(/7/g,'').replace(/8/g,'').replace(/9/g,'') == '')) {
isoa.href='sms:' + esask.trim() + '&' + isoa.href.split('&')[1];
isoa.click();
}
}
}
}

“; ?>

Cute, huh?!


Previous relevant Animated GIF Creator PDF Order Tutorial is shown below.

Animated GIF Creator PDF Order Tutorial

Animated GIF Creator PDF Order Tutorial

Order becomes an interesting subject to us today regarding the PDF conversions possible in amongst the Animated GIF creating of yesterday’s Animated GIF Creator PDF Share Tutorial.

That is because we may have some advanced users out there that want that possibility of differentiating the data of …

  • animated GIF … containing all features asked for, in totality … from the chance for the user to have any of the PDF conversion option sets below …
  • PDF … one of …
    1. no PDF conversion
    2. full PDF conversion … with the user choices regarding raw image content and title and watermarking and ImageMagick and GD modifiers
    3. light PDF conversion … with the user choices regarding just raw image content (the only option out of these last three available before today’s work)
    4. medium PDF conversion … with the user choices regarding just ImageMagick and GD modifiers

… perhaps as a “before and after” tool regarding presentations, maybe?

No dropdowns used here (enforcing an order), just the user’s order in which they choose to select the “PDF conversion” option from the ImageMagick dropdown (in relation to other selections) determining how and when this PDF conversion occurs in the workflow through to creating the animated GIF with our changed tutorial_to_animated_gif.php inhouse Animated GIF Creator serverside PHP web application. Just remember to select PDF Conversion as early as possible to do that “light PDF conversion” option above and last thing if you are interested in “full PDF conversion” (where you can create PDF documents with the bells and whistles ImageMagick and GD modifiers can offer) and today’s tutorial picture is an example of “medium PDF conversion” (when we ordered our settings by first Grayscale, second PDF conversion and last title and watermarking options). Clicking or tapping the ImageMagick link can get the user to the Javascript popup window where they might define the email or SMS recipient for that PDF conversion data file download.


Previous relevant Animated GIF Creator PDF Share Tutorial is shown below.

Animated GIF Creator PDF Share Tutorial

Animated GIF Creator PDF Share Tutorial

To share yesterday’s Animated GIF Creator PDF Conversion Tutorial PDF data formatted image slides (and then onto an animated GIF) would be a step forward, wouldn’t you say?

What sharing conduits do we code for? We always intended …

  • email … but as the day wore on trying to get the usage to work on mobile and non-mobile we decided to relinquish our wish to not have to create a user specific enduring (until that same browser type and user combination share) PDF document for the user request … mainly to get mobile email downloads to be friendly … and so this opened the door for …
  • SMS … to access that enduring PDF as a URL in the SMS message (that becomes a link for the recipient)

… the email methodology used being that “midair feeling” Ajax/FormData approach in our changed tutorial_to_animated_gif.php inhouse Animated GIF Creator serverside PHP web application …

<?php echo ”

function emailhtmlit() {
var induri=ginduri;
var pemail='" . urldecode($_GET['outpdf']) . urldecode($_POST['outpdf']) . "';
if (pemail != null) {
if (pemail.indexOf('@') != -1 || (pemail.trim() != '' && pemail.trim().replace(/0/g,'').replace(/1/g,'').replace(/2/g,'').replace(/3/g,'').replace(/4/g,'').replace(/5/g,'').replace(/6/g,'').replace(/7/g,'').replace(/8/g,'').replace(/9/g,'') == '')) {
if (induri.trim() == '') {
if (induri == '') {
document.getElementById('pdfproposed').src='./animegif.pdf?rand=' + Math.floor(Math.random() * 19854654);
} else {
ginduri='found';
}
setTimeout(emailhtmlit, 15000);
} else {
ginduri='';
var zhr = new XMLHttpRequest();
var zform=new FormData();
if (pemail.indexOf('@') != -1) { zform.append('to', pemail); }
zform.append('inline', '" . dirname(__FILE__) . DIRECTORY_SEPARATOR . "animegif.pdf" . "');
zform.append('subj', 'My PDF version of Animated GIF via RJM Programming ... ');
zform.append('tdhuhta', ('<body><div title=\"" . explode('/animegif',$durlis)[0] . '/animegif/' . server_remote_addr() . "_\" style=\"overflow:auto;-webkit-overflow-scrolling:touch;height:100%;\"><object style=\"width:100%;height:900px;\" type=\"application/pdf\" data=\"" . dirname(__FILE__) . DIRECTORY_SEPARATOR . 'animegif.pdf' . "\"><embed style=\"width:100%;height:900px;\" type=\"application/pdf\" src=\"" . dirname(__FILE__) . DIRECTORY_SEPARATOR . 'animegif.pdf' . "\"></embed></object></div></body>'));
//zform.append('tdhuhta', ('<body><iframe srcdoc=\"" . dirname(__FILE__) . DIRECTORY_SEPARATOR . 'animegif.pdf' . "\"></iframe></body>'));
zhr.open('post', '//www.rjmprogramming.com.au/HTMLCSS/emailhtml.php', true);
zhr.send(zform);
if (pemail.indexOf('@') == -1) {
var hrefp=document.getElementById('pdfsms').href.split('&body=')[0];
hrefp+=pemail.trim() + '&body=' + document.getElementById('pdfsms').href.split('&body=')[1];
document.getElementById('pdfsms').href=hrefp;
document.getElementById('pdfsms').click();
}
}
}
}
}

“; ?>

… and this called on our PHP email creator helper to better interface in its $_POST arguments reading section in our changed emailhtml.php inhouse email creator helper serverside PHP web application …

<?php

$psacv="";
$okayin=true;
$subd="";
$subptitle='';
$subdata="";
$subfile="";
$getpostfound=false;
<br>
foreach( $_POST as $name=>$val ) {
if ($val != "") {
// blah blah blah //file_put_contents("jnv." . $name, "jnv.inv00 " . strlen($phpcont));
if ($name == "tdhuhta" && $subfile != "" && $subdata != "" && strpos(str_replace("+"," ",urldecode($val)), $subfile) !== false) {
if (strpos(str_replace("+"," ",urldecode($val)), ' srcdoc="') !== false || strpos(str_replace("+"," ",urldecode($val)), ' data="') !== false) {
if (strpos(str_replace("+"," ",urldecode($val)), ' title="') !== false) { //file_put_contents('haaa.aaa',explode('/animegif/', explode('"', explode(' title="', str_replace("+"," ",urldecode($val)))[1])[0])[1]);
if (!file_exists('../PHP/animegif/' . explode('/animegif/', explode('"', explode(' title="', str_replace("+"," ",urldecode($val)))[1])[0])[1] . 'animegif.pdf')) {
if (file_exists('../PHP/animegif/animegif.pdf')) {
copy('../PHP/animegif/animegif.pdf', '../PHP/animegif/' . explode('/animegif/', explode('"', explode(' title="', str_replace("+"," ",urldecode($val)))[1])[0])[1] . 'animegif.pdf');
}
}
$psacv=explode('"', explode(' title="', str_replace("+"," ",urldecode($val)))[1])[0] . 'animegif.pdf';
$subptitle='<a target=_blank href="' . explode('"', explode(' title="', str_replace("+"," ",urldecode($val)))[1])[0] . 'animegif.pdf">Mobile whole PDF</a><br>';
}
$vrest=explode('"', explode(' srcdoc="',str_replace("+"," ",urldecode($val)))[1])[0];
$val=urlencode("<body>" . $subptitle . "<iframe style='width:100%;height:95vh;overflow:auto;-webkit-overflow-scrolling:touch;' srcdoc='<div style=width:92%;height:95vh;overflow:auto;-webkit-overflow-scrolling:touch;><object id=myobj style=width:95%;height:95vh; type=application/pdf data=\"" . $subdata . "\"></object></div>'></iframe></body>");
}
// blah blah blah
if ($name == "inline") {
if (strpos(str_replace("+"," ",urldecode($val)), 'animegif.pdf') !== false && isset($_POST['tdhuhta'])) {
if (file_exists(str_replace("+"," ",urldecode($val)))) {
$subfile=str_replace("+"," ",urldecode($val));
$subdata='data:application/pdf;base64,' . base64_encode(file_get_contents(str_replace("+"," ",urldecode($val))));
$val="";
$name="x";
$okayin=false;
}
}
// blah blah blah
}
}

?>

Creating the PDFs got helped out in “reliability terms” via the introduced animegif.php inhouse Wait Around Longer serverside PHP web application.


Previous relevant Animated GIF Creator PDF Conversion Tutorial is shown below.

Animated GIF Creator PDF Conversion Tutorial

Animated GIF Creator PDF Conversion Tutorial

Up to yesterday’s Animated GIF Creator Slide Specific Application Tutorial the recent progress had us …

  • knowing the good places to intervene between the original slide image data being read in and the animated GIF slide output … and …
  • involvement of ImageMagick … so, today, these two help us down the path to …
  • adding PDF as an output format possibility, in addition to the animated GIF and other ideas floated as output formats

… with our changed tutorial_to_animated_gif.php inhouse Animated GIF Creator serverside PHP web application.

We have more “reliability work” and “email sharing work” to go after today’s start, but it primarily called on ImageMagick command line’s talent for a command like …


convert /tmp/imtmp0*.*[gGmMiI]* /tmp/imtmp000.pdf

… to “concatenate” into the one output PDF file (called “/tmp/imtmp000.pdf”) the slides, arranged by our code into that “/tmp/imtmp0*.*[gGmMiI]*” (file specification) arrangement above. Yes, we meant “convert” above, as “mogrify” (batch work) appears not to be able to perform this task.

We hope you stay the course!


Previous relevant Animated GIF Creator Slide Specific Application Tutorial is shown below.

Animated GIF Creator Slide Specific Application Tutorial

Animated GIF Creator Slide Specific Application Tutorial

It’s all fine and good improving on the ImageMagick and GD and Exif functionality modifications like with yesterday’s Animated GIF Creator Exif Rotation Compensation Tutorial, but in reality, if you are going to start creating animated GIFs to explain a process, you are going to want to apply these “slide modifiers” on a slide by slide basis, rather than enforcing a “whole of animated GIF slide set” paradigm, as for the last few days worth of work.

And so, we decided to do what we often do, “sliding in” more functionality (chortle, chortle). We tend to want to …

  • start with hardcoded text (or element) … somewhere … today it happens to be in an HTML span element that once involved just …

    <span id="smyim"></span>

    … and used to get filled, Javascript DOM wise, when needed via …

    document.getElementById('smyim').innerHTML='ImageMagick switches: '; // and yes, it remains that way even now, but read on ...
  • add intelligence (quite often that being onclick logic(s)) to that hardcoded element via …

    <span id=smyim title=Application onclick=applyto(); style=cursor:pointer;text-decoration:underline;></span>
  • that serves the purpose, as the user clicks/taps it (alerted to that fact, perhaps, because we underline the element and add an appropriate cursor when hovering over it (plus a title)), of calling Javascript …

    function applyto() {
    var huhto=prompt('Apply ImageMagick and/or GD to which slides, in comma separated list, counting starting with 1? Defaults to applying to all slides. Comma delimit. Negatives mean all but. Ranges can be specified. For example ... 2,4-7,9', document.getElementById('appliedto').value);
    if (huhto == null) { huhto=''; }
    if (huhto.trim() == '') {
    document.getElementById('appliedto').value='';
    document.getElementById('smyim').title='Application';
    } else {
    document.getElementById('appliedto').value=huhto.trim();
    document.getElementById('smyim').title=huhto.trim();
    }
    }
  • to glean an (often times out of the normal workflow of the web application) informational piece of data, interactively, from the user, via a Javascript prompt popup

So that’s the clientside of this work … “alerting the user to the existance of the functionality” you might say.

And then there’s “the application” of that nuanced user requirement. And that’s where the “inhouse ‘our’ prefix to wrapper function name paradigms” come in handy. We introduced “blanket” functionality thoughts via this approach, and so to “partially undo” that thinking, we make the “our” prefix conditional, as is available to us with our changed tutorial_to_animated_gif.php inhouse Animated GIF Creator serverside PHP web application (helped out by a changed exif_rotation_check.php inhouse Exif detector PHP helper), as per

<?php

function ourcomplicated($inio, $iappl) {
$ideasl=explode(",", str_replace(' ','',$iappl));
$xour="our";
for ($iqa=0; $iqa<sizeof($ideasl); $iqa++) {
if (trim($ideasl[$iqa]) != '') {
$xour="";
if (('-' . $inio) == trim($ideasl[$iqa])) { return ""; }
$ideasr=explode("-", str_replace(' ','',trim($ideasl[$iqa])));
for ($iqb=0; $iqb<sizeof($ideasr); $iqb++) {
if (('' . $inio) == trim($ideasr[$iqb])) {
return "our";
}
if ($iqb == 1) {
if (trim($ideasr[1]) == "") { $ideasr[1]="99999999"; }
if ($inio >= $ideasr[0] && $inio <= $ideasr[1]) { return "our"; }
}
}
}
}
return $xour;
}


?>

teamed with

<?php

$ours="our";
for ($io=1; $io$ours=ourcomplicated($io, $iappliedto);
// blah blah blah
if (strpos($aphoto[0], ";base64,") !== false) {
$gifphp.=str_replace("imagecreatefromjpeg('source01.jpg');", "" . $ours . "imagecreatefromstring(base64_decode('" . explode(";base64,",$aphoto[0])[1] . "'));", str_replace("\$text='';", "\$text=\"" . str_replace("+"," ",urldecode($atext)) . "\";", $eachonestring));
} else if (strpos(strtolower($aphoto[0]), "//") !== false) {
$gifphp.=str_replace("imagecreatefromjpeg('source01.jpg');", "" . $ours . "imagecreatefromstring(@file_get_contents('" . $prefix . $aphoto[0] . "'));", str_replace("\$text='';", "\$text=\"" . str_replace("+"," ",urldecode($atext)) . "\";", $eachone));
} else if (strpos(strtolower($aphoto[0]), ".jp") !== false) {
if (strpos($prefix, "../../") !== false && !file_exists($prefix . $aphoto[0]) && file_exists(str_replace("../../","../",$prefix) . $aphoto[0])) {
$prefix=str_replace("../../","../",$prefix);
}
//file_put_contents('qpqp.qpqp', $eachone . "\n\n" . $atext . "\n\n" . str_replace("\$text='';", "\$text=\"" . str_replace("+"," ",urldecode($atext)) . "\";", $eachone));
$gifphp.=str_replace("imagecreatefromjpeg('source01.jpg');", "" . $ours . "imagecreatefromjpeg('" . $prefix . $aphoto[0] . "');", str_replace("\$text='';", "\$text=\"" . str_replace("+"," ",urldecode($atext)) . "\";", $eachone));
//file_put_contents('qpqpqp.qpqpqp', $gifphp);
} else if (strpos(strtolower($aphoto[0]), ".png") !== false) {
if (strpos($prefix, "../../") !== false && !file_exists($prefix . $aphoto[0]) && file_exists(str_replace("../../","../",$prefix) . $aphoto[0])) {
$prefix=str_replace("../../","../",$prefix);
}
$gifphp.=str_replace("imagecreatefromjpeg('source01.jpg');", "" . $ours . "imagecreatefrompng('" . $prefix . $aphoto[0] . "');", str_replace("\$text='';", "\$text=\"" . str_replace("+"," ",urldecode($atext)) . "\";", $eachone));
} else if (strpos(strtolower($aphoto[0]), ".gif") !== false) {
if (strpos($prefix, "../../") !== false && !file_exists($prefix . $aphoto[0]) && file_exists(str_replace("../../","../",$prefix) . $aphoto[0])) {
$prefix=str_replace("../../","../",$prefix);
}
$gifphp.=str_replace("imagecreatefromjpeg('source01.jpg');", "" . $ours . "imagecreatefromgif('" . $prefix . $aphoto[0] . "');", str_replace("\$text='';", "\$text=\"" . str_replace("+"," ",urldecode($atext)) . "\";", $eachone));
} else if (strpos(strtolower($aphoto[0]), ".bmp") !== false) {
if (strpos($prefix, "../../") !== false && !file_exists($prefix . $aphoto[0]) && file_exists(str_replace("../../","../",$prefix) . $aphoto[0])) {
$prefix=str_replace("../../","../",$prefix);
}
$gifphp.=str_replace("imagecreatefromjpeg('source01.jpg');", "" . $ours . "imagecreatefrombmp('" . $prefix . $aphoto[0] . "');", str_replace("\$text='';", "\$text=\"" . str_replace("+"," ",urldecode($atext)) . "\";", $eachone));
}
// blah blah blah
}

?>

We use these “new abilities” better explaining “the abscence or otherwise of Exif checking”, and the implications of that in the animated GIF creator woooooorrrrrrlllllddd, contrasting the first two slides, showing one with “No Exif checking” (the bad old days) versus “With Exif checking” (the renaissance of liberated thinking in the South South East woooorrrrrlllldddd) in today’s animated GIF presentation.

Get the picture?!


Previous relevant Animated GIF Creator Exif Rotation Compensation Tutorial is shown below.

Animated GIF Creator Exif Rotation Compensation Tutorial

Animated GIF Creator Exif Rotation Compensation Tutorial

The recent couple of days of work like yesterday’s Animated GIF Creator GD Transformations Interfacing Tutorial have given us “rotation functionality” tools to counteract the unusual effects Exif …

Exchangeable image file format (officially Exif, according to JEIDA/JEITA/CIPA specifications) is a standard that specifies the formats for images, sound, and ancillary tags used by digital cameras (including smartphones), scanners and other systems handling image and sound files recorded by digital cameras.

… can have converting mobile device camera created images into animated GIFs via our changed tutorial_to_animated_gif.php inhouse Animated GIF Creator PHP web application.

But with some photos it’s there in the photo’s metadata information letting the future user know what orientation the camera of that mobile device was in as you took the photo. In order to help our animated GIF creator, the first slide image is scoured for Exif metadata and if found, a suitable rotation correction can be applied to the slides there and then. In order to scour for Exif metadata we needed to write a exif_rotation_check.php inhouse Exif detector PHP helper.


Previous relevant Animated GIF Creator GD Transformations Interfacing Tutorial is shown below.

Animated GIF Creator GD Transformations Interfacing Tutorial

Animated GIF Creator GD Transformations Interfacing Tutorial

The PHP GD image library is so much more useful than for the “filters” interfaced to with yesterday’s Animated GIF Creator GD Filter Interfacing Tutorial. Under an “umbrella term” transformations, today we add interfacing to GD functionality …

… into our changed tutorial_to_animated_gif.php inhouse Animated GIF Creator PHP web application. We found it more user friendly to tailor the asking of numerical parameters for these GD calls work via …

<?php

$gfcds='';
$gdfs=[];
if (strpos(($imvgn . $imafn . $imqty . $imgds), '|') !== false) {
$gdfs=explode(';', trim(explode('|', $imvgn . $imafn . $imqty . $imgds)[1]));
for ($itf=0; $itf<sizeof($gdfs); $itf++) {
if (trim($gdfs[$itf]) != '') {
if (trim($gdfs[$itf]) == strtolower(trim($gdfs[$itf]))) {
$gfcds.=chr(10) . " imagefilter(" . "$" . "oimo, IMG_FILTER_" . strtoupper(trim($gdfs[$itf])) . "); " . chr(10);
} else if (trim($gdfs[$itf]) == strtoupper(trim($gdfs[$itf]))) {
$gfcds.=chr(10) . " image" . explode(',',explode(" ",strtolower(trim($gdfs[$itf])))[0])[0] . "(" . "$" . "oimo, IMG_" . str_replace(" ","_",strtoupper(trim( str_replace(explode(' ',$gdfs[$itf])[0] . ' ','',$gdfs[$itf]) ))) . "); " . chr(10);
} else if (strpos(strtoupper(trim($gdfs[$itf])), "SCALE") !== false) {
$gfcds.=chr(10) . " $" . "oimo=image" . explode(',',explode(" ",strtolower(trim($gdfs[$itf])))[0])[0] . "(" . "$" . "oimo" . str_replace(" ","_",(trim( str_replace(explode(',',explode(" ",(trim($gdfs[$itf])))[0])[0],'',$gdfs[$itf]) ))) . "); " . chr(10);
} else if (strpos(strtoupper(trim($gdfs[$itf])), "COPY") === false) {
$gfcds.=chr(10) . " image" . explode(',',explode(" ",strtolower(trim($gdfs[$itf])))[0])[0] . "(" . "$" . "oimo" . str_replace(" ","_",(trim( str_replace(explode(',',explode(" ",(trim($gdfs[$itf])))[0])[0],'',$gdfs[$itf]) ))) . "); " . chr(10);
} else {
$gfcds.=chr(10) . " image" . explode(',',explode(" ",strtolower(trim($gdfs[$itf])))[0])[0] . "(" . "$" . "oimo" . "," . "$" . "oimo" . explode("," . "$" . "oimo", $gdfs[$itf])[1] . "); " . chr(10);
}
}
}
}

?>

… to work with modified PHP writes PHP of the ilk …

<?php echo ”

function ourimagecreatefromstring(\$inidis) {
global \$imvgn, \$imafn, \$imqty, \$imgds, \$gfcds;
if ((\$imvgn . \$imafn . \$imqty . \$imgds) != '' && strpos(\$inidis, ';base64,') !== false) {
\$extis=str_replace('jpeg','jpg',explode('/', explode(';base64,', \$inidis)[0])[1]);
\$inextis=\$extis;
\$sofarout='/tmp/imtmp.' . \$extis;
foreach (glob('/tmp/imtmp.*') as \$imfilename) {
unlink(\$imfilename);
}
file_put_contents(\$sofarout, base64_encode(explode(';base64,', \$inidis)[1]));
\$fzis=filesize(\$sofarout);
if (trim(explode('|', \$imvgn . \$imafn . \$imqty . \$imgds)[0]) != '') {
exec('" . $immogpath . "mogrify ' . explode('|', \$imvgn . \$imafn . \$imqty . \$imgds)[0] . ' /tmp/imtmp.' . \$extis);
}
foreach (glob('/tmp/imtmp.*') as \$imfilename) {
if (filesize(\$imfilename) != \$fzis) { // strpos(\$imfilename, '.' . \$extis) === false ||
\$sofarout=\$imfilename;
\$extis=explode('.', \$imfilename)[1];
}
}
\$oimo=null;
if (strtolower(\$extis) == 'png') {
\$oimo=imagecreatefrompng('/tmp/imtmp.' . \$extis); " . $gfcds . "
} else if (strtolower(\$extis) == 'bmp') {
\$oimo=imagecreatefrombmp('/tmp/imtmp.' . \$extis); " . $gfcds . "
} else if (strtolower(\$extis) == 'gif') {
\$oimo=imagecreatefromgif('/tmp/imtmp.' . \$extis); " . $gfcds . "
} else if (strpos(strtolower(\$extis), 'jp') !== false) {
\$oimo=imagecreatefromjpeg('/tmp/imtmp.' . \$extis); " . $gfcds . "
}
if (\$oimo) { return \$oimo; }
} else if ((\$imvgn . \$imafn . \$imqty . \$imgds) != '') {
\$extis=str_replace('jpeg','jpg','" . $inextis . "');
\$inextis=\$extis;
\$sofarout='/tmp/imtmp.' . \$extis;
foreach (glob('/tmp/imtmp.*') as \$imfilename) {
unlink(\$imfilename);
}
file_put_contents(\$sofarout, \$inidis);
\$fzis=filesize(\$sofarout);
if (strpos(strtolower((\$imvgn . \$imafn . \$imqty . \$imgds)), '-format ') === false) { \$imvgn.=' -format " . str_replace('jpg','jpeg',$inextis) . " '; }
if (trim(explode('|', \$imvgn . \$imafn . \$imqty . \$imgds)[0]) != '') {
exec('" . $immogpath . "mogrify ' . explode('|', \$imvgn . \$imafn . \$imqty . \$imgds)[0] . ' /tmp/imtmp.' . \$extis);
}
foreach (glob('/tmp/imtmp.*') as \$imfilename) {
if (filesize(\$imfilename) != \$fzis) { // strpos(\$imfilename, '.' . \$extis) === false) {
\$sofarout=\$imfilename;
\$extis=explode('.', \$imfilename)[1];
}
}
\$oimo=null;
if (strtolower(\$extis) == 'png') {
\$oimo=imagecreatefrompng('/tmp/imtmp.' . \$extis); " . $gfcds . "
} else if (strtolower(\$extis) == 'bmp') {
\$oimo=imagecreatefrombmp('/tmp/imtmp.' . \$extis); " . $gfcds . "
} else if (strtolower(\$extis) == 'gif') {
\$oimo=imagecreatefromgif('/tmp/imtmp.' . \$extis); " . $gfcds . "
} else if (strpos(strtolower(\$extis), 'jp') !== false) {
\$oimo=imagecreatefromjpeg('/tmp/imtmp.' . \$extis); " . $gfcds . "
}
if (\$oimo) { return \$oimo; }
}
return imagecreatefromstring(\$inidis);
}

“; “?>

… and to get there clientwise, in the Javascript …


function gdadd(oselo) {
var pari=1, thispari='0';
if (oselo.value != '') {
//alert(oselo.value);
var oselovalue=oselo.value.replace(',' + '$' + 'oimo','~' + '$' + 'oimo').split(',')[0];
//alert(oselovalue);
var oseloval=oselo.value;
if (document.getElementById('imgds')) { if (document.getElementById('imgds').value == '') { document.getElementById('imgds').value='|'; } else { document.getElementById('imgds').value+=';'; } }
oseloval=oseloval.replace(',' + '$' + 'oimo','~' + '$' + 'oimo');
oseloval=oseloval.replace(oseloval.split(',')[0], '');
while (oseloval.indexOf(',') != -1) {
//alert(oseloval);
if ((oseloval + ' ').substring(1).split(',')[0].trim() != '') {
if ((' ' + (oseloval + ' ').substring(1).split(',')[0].trim() + ' ').toLowerCase().indexOf(' colour ') != -1) {
thispari=prompt('Enter' + (' ' + (oseloval + ' ').substring(1).split(',')[0].trim() + ' ').toLowerCase().replace(' colour ', ' red,green,blue colour ') + 'parameter for GD ' + oselo.value.split(',')[0] + ' ' + pari + ' of ' + eval(-1 + oselo.value.replace(',' + '$' + 'oimo','').split(',').length) + '?', '0');
if (thispari == null) {
thispari='0';
} else if (thispari.trim() == '') {
thispari='0';
} else if (thispari.indexOf(',') == -1) {
oselovalue+=',' + thispari + '';
} else {
oselovalue+=',imagecolorallocate(' + '$' + 'oimo,' + thispari + ')';
}
} else {
thispari=prompt('Enter ' + (oseloval + ' ').substring(1).split(',')[0].trim() + ' parameter for GD ' + oselo.value.split(',')[0] + ' ' + pari + ' of ' + eval(-1 + oselo.value.replace(',' + '$' + 'oimo','').split(',').length) + '?', '0');
if (thispari == null) {
thispari='0';
} else {
oselovalue+=',' + thispari;
}
}
oseloval=oseloval.replace(',' + (oseloval + ' ').substring(1).split(',')[0].trim(),'').trim();
} else {
thispari=prompt('Enter numerical parameter for GD ' + oselo.value.split(',')[0] + ' ' + pari + ' of ' + eval(-1 + oselo.value.replace(',' + '$' + 'oimo','').split(',').length) + '?', '0');
oseloval=oseloval.replace(',','');
if (thispari == null) {
thispari='0';
} else {
oselovalue+=',' + thispari;
}
}
//oseloval=oseloval.replace(oseloval.split(',')[0] + ',', '');
//oseloval=oseloval.replace(',','');
pari++;
}
if (document.getElementById('gdopt')) {
document.getElementById('gdopt').innerHTML+='  ' + oselovalue.replace('~',',');
}
if (document.getElementById('imgds')) {
document.getElementById('imgds').value+=oselovalue.replace('~',',');
//document.getElementById('imgds').style.display='inline-block';
//document.getElementById('imgds').style.width='300px';
if (document.getElementById('smyim').innerHTML == '') { document.getElementById('smyim').innerHTML='ImageMagick switches: '; }
} else if (document.getElementById('myim')) {
document.getElementById('myim').innerHTML='<span is=smyim>ImageMagick switches: </span><input id=imqty name=imqty type=text style=display:inline-block; value=\"\"></input><input id=imgds name=imgds type=hidden style=display:inline-block; value=\"|' + oselovalue.replace('~',',') + '\"></input>';
document.getElementById('imqty').style.width='300px';
}
oselo.value='';
}
}


Previous relevant Animated GIF Creator GD Filter Interfacing Tutorial is shown below.

Animated GIF Creator GD Filter Interfacing Tutorial

Animated GIF Creator GD Filter Interfacing Tutorial

We are into image modification on the way to creating “compiled” animated GIF images, at the moment. Yesterday’s Animated GIF Creator ImageMagick Interfacing Tutorial got us interfacing (or integrating) …

  • ImageMagick batch processing “mogrify” ideas … and, today, it is the turn of …
  • GD image filters …

… into our changed tutorial_to_animated_gif.php inhouse Animated GIF Creator PHP web application.


Previous relevant Animated GIF Creator ImageMagick Interfacing Tutorial is shown below.

Animated GIF Creator ImageMagick Interfacing Tutorial

Animated GIF Creator ImageMagick Interfacing Tutorial

Yes, you guessed it! On top of yesterday’s ImageMagick Vignette Primer Tutorial, today we want to interface the ImageMagick batch processing “mogrify” ideas into our changed tutorial_to_animated_gif.php inhouse Animated GIF Creator PHP web application.

“Interfacing” (or integrating) into code often has you asking the question …


Where do we intervene to place our logic?

We’ve decided to “wrap” our PHP GD calls …

… into inhouse “our” prefixed function versions as per (PHP writing out PHP) …

<?php echo ”

\$imvgn='" . $imvgn . "'; /" . "/ vignette factor
\$imafn='" . $imafn . "'; /" . "/ affine transformation
\$imqty='" . $imqty . "'; /" . "/ image conversion and/or quality RE jpeg


function ourimagecreatefromstring(\$inidis) {
global \$imvgn, \$imafn, \$imqty;
if ((\$imvgn . \$imafn . \$imqty) != '' && strpos(\$inidis, ';base64,') !== false) {
\$extis=str_replace('jpeg','jpg',explode('/', explode(';base64,', \$inidis)[0])[1]);
\$inextis=\$extis;
\$sofarout='/tmp/imtmp.' . \$extis;
foreach (glob('/tmp/imtmp.*') as \$imfilename) {
unlink(\$imfilename);
}
file_put_contents(\$sofarout, base64_encode(explode(';base64,', \$inidis)[1]));
\$fzis=filesize(\$sofarout);
exec('" . $immogpath . "mogrify ' . \$imvgn . \$imafn . \$imqty . ' /tmp/imtmp.' . \$extis);
foreach (glob('/tmp/imtmp.*') as \$imfilename) {
if (filesize(\$imfilename) != \$fzis) { // strpos(\$imfilename, '.' . \$extis) === false ||
\$sofarout=\$imfilename;
\$extis=explode('.', \$imfilename)[1];
}
}
if (strtolower(\$extis) == 'png') {
return imagecreatefrompng('/tmp/imtmp.' . \$extis);
} else if (strtolower(\$extis) == 'bmp') {
return imagecreatefrombmp('/tmp/imtmp.' . \$extis);
} else if (strtolower(\$extis) == 'gif') {
return imagecreatefromgif('/tmp/imtmp.' . \$extis);
} else if (strpos(strtolower(\$extis), 'jp') !== false) {
return imagecreatefromjpeg('/tmp/imtmp.' . \$extis);
}
} else if ((\$imvgn . \$imafn . \$imqty) != '') {
\$extis=str_replace('jpeg','jpg','" . $inextis . "');
\$inextis=\$extis;
\$sofarout='/tmp/imtmp.' . \$extis;
foreach (glob('/tmp/imtmp.*') as \$imfilename) {
unlink(\$imfilename);
}
file_put_contents(\$sofarout, \$inidis);
\$fzis=filesize(\$sofarout);
if (strpos(strtolower((\$imvgn . \$imafn . \$imqty)), '-format ') === false) { \$imvgn.=' -format " . str_replace('jpg','jpeg',$inextis) . " '; }
exec('" . $immogpath . "mogrify ' . \$imvgn . \$imafn . \$imqty . ' /tmp/imtmp.' . \$extis);
foreach (glob('/tmp/imtmp.*') as \$imfilename) {
if (filesize(\$imfilename) != \$fzis) { // strpos(\$imfilename, '.' . \$extis) === false) {
\$sofarout=\$imfilename;
\$extis=explode('.', \$imfilename)[1];
}
}
if (strtolower(\$extis) == 'png') {
return imagecreatefrompng('/tmp/imtmp.' . \$extis);
} else if (strtolower(\$extis) == 'bmp') {
return imagecreatefrombmp('/tmp/imtmp.' . \$extis);
} else if (strtolower(\$extis) == 'gif') {
return imagecreatefromgif('/tmp/imtmp.' . \$extis);
} else if (strpos(strtolower(\$extis), 'jp') !== false) {
return imagecreatefromjpeg('/tmp/imtmp.' . \$extis);
}
}
return imagecreatefromstring(\$inidis);
}

function ourimagecreatefromjpeg(\$inidis) {
global \$imvgn, \$imafn, \$imqty;
if ((\$imvgn . \$imafn . \$imqty) != '') {
\$extis='jpg';
\$inextis=\$extis;
\$sofarout='/tmp/imtmp.' . \$extis;
foreach (glob('/tmp/imtmp.*') as \$imfilename) {
unlink(\$imfilename);
}
file_put_contents(\$sofarout, \$inidis);
\$fzis=filesize(\$sofarout);
exec('" . $immogpath . "mogrify ' . \$imvgn . \$imafn . \$imqty . ' /tmp/imtmp.' . \$extis);
foreach (glob('/tmp/imtmp.*') as \$imfilename) {
if (filesize(\$imfilename) != \$fzis) { // strpos(\$imfilename, '.' . \$extis) === false) {
\$sofarout=\$imfilename;
\$extis=explode('.', \$imfilename)[1];
}
}
if (strtolower(\$extis) == 'png') {
return imagecreatefrompng('/tmp/imtmp.' . \$extis);
} else if (strtolower(\$extis) == 'bmp') {
return imagecreatefrombmp('/tmp/imtmp.' . \$extis);
} else if (strtolower(\$extis) == 'gif') {
return imagecreatefromgif('/tmp/imtmp.' . \$extis);
} else if (strpos(strtolower(\$extis), 'jp') !== false) {
return imagecreatefromjpeg('/tmp/imtmp.' . \$extis);
}
}
return imagecreatefromjpeg(\$inidis);
}

function ourimagecreatefrompng(\$inidis) {
global \$imvgn, \$imafn, \$imqty;
if ((\$imvgn . \$imafn . \$imqty) != '') {
\$extis='png';
\$inextis=\$extis;
\$sofarout='/tmp/imtmp.' . \$extis;
foreach (glob('/tmp/imtmp.*') as \$imfilename) {
unlink(\$imfilename);
}
file_put_contents(\$sofarout, \$inidis);
\$fzis=filesize(\$sofarout);
exec('" . $immogpath . "mogrify ' . \$imvgn . \$imafn . \$imqty . ' /tmp/imtmp.' . \$extis);
foreach (glob('/tmp/imtmp.*') as \$imfilename) {
if (filesize(\$imfilename) != \$fzis) { // strpos(\$imfilename, '.' . \$extis) === false) {
\$sofarout=\$imfilename;
\$extis=explode('.', \$imfilename)[1];
}
}
if (strtolower(\$extis) == 'png') {
return imagecreatefrompng('/tmp/imtmp.' . \$extis);
} else if (strtolower(\$extis) == 'bmp') {
return imagecreatefrombmp('/tmp/imtmp.' . \$extis);
} else if (strtolower(\$extis) == 'gif') {
return imagecreatefromgif('/tmp/imtmp.' . \$extis);
} else if (strpos(strtolower(\$extis), 'jp') !== false) {
return imagecreatefromjpeg('/tmp/imtmp.' . \$extis);
}
}
return imagecreatefrompng(\$inidis);
}

function ourimagecreatefromgif(\$inidis) {
global \$imvgn, \$imafn, \$imqty;
if ((\$imvgn . \$imafn . \$imqty) != '') {
\$extis='gif';
\$inextis=\$extis;
\$sofarout='/tmp/imtmp.' . \$extis;
foreach (glob('/tmp/imtmp.*') as \$imfilename) {
unlink(\$imfilename);
}
file_put_contents(\$sofarout, \$inidis);
\$fzis=filesize(\$sofarout);
exec('" . $immogpath . "mogrify ' . \$imvgn . \$imafn . \$imqty . ' /tmp/imtmp.' . \$extis);
foreach (glob('/tmp/imtmp.*') as \$imfilename) {
if (filesize(\$imfilename) != \$fzis) { // strpos(\$imfilename, '.' . \$extis) === false) {
\$sofarout=\$imfilename;
\$extis=explode('.', \$imfilename)[1];
}
}
if (strtolower(\$extis) == 'png') {
return imagecreatefrompng('/tmp/imtmp.' . \$extis);
} else if (strtolower(\$extis) == 'bmp') {
return imagecreatefrombmp('/tmp/imtmp.' . \$extis);
} else if (strtolower(\$extis) == 'gif') {
return imagecreatefromgif('/tmp/imtmp.' . \$extis);
} else if (strpos(strtolower(\$extis), 'jp') !== false) {
return imagecreatefromjpeg('/tmp/imtmp.' . \$extis);
}
}
return imagecreatefromgif(\$inidis);
}

function ourimagecreatefrombmp(\$inidis) {
global \$imvgn, \$imafn, \$imqty;
if ((\$imvgn . \$imafn . \$imqty) != '') {
\$extis='bmp';
\$inextis=\$extis;
\$sofarout='/tmp/imtmp.' . \$extis;
foreach (glob('/tmp/imtmp.*') as \$imfilename) {
unlink(\$imfilename);
}
file_put_contents(\$sofarout, \$inidis);
\$fzis=filesize(\$sofarout);
exec('" . $immogpath . "mogrify ' . \$imvgn . \$imafn . \$imqty . ' /tmp/imtmp.' . \$extis);
foreach (glob('/tmp/imtmp.*') as \$imfilename) {
if (filesize(\$imfilename) != \$fzis) { // strpos(\$imfilename, '.' . \$extis) === false) {
\$sofarout=\$imfilename;
\$extis=explode('.', \$imfilename)[1];
}
}
if (strtolower(\$extis) == 'png') {
return imagecreatefrompng('/tmp/imtmp.' . \$extis);
} else if (strtolower(\$extis) == 'bmp') {
return imagecreatefrombmp('/tmp/imtmp.' . \$extis);
} else if (strtolower(\$extis) == 'gif') {
return imagecreatefromgif('/tmp/imtmp.' . \$extis);
} else if (strpos(strtolower(\$extis), 'jp') !== false) {
return imagecreatefromjpeg('/tmp/imtmp.' . \$extis);
}
}
return imagecreatefrombmp(\$inidis);
}

“; ?>

… and change existant calls into (equivalent inhouse) “our” function calls as above.


Previous relevant ImageMagick Vignette Primer Tutorial is shown below.

ImageMagick Vignette Primer Tutorial

ImageMagick Vignette Primer Tutorial

Continuing on with the ImageMagick batch processing “mogrify” ideas of yesterday’s ImageMagick Batch Image Conversion Affine Transformation Tutorial and the “vignette” image editing ideas of Gimp Vignette Primer Tutorial, as below, today, we took some pet photos with an iPad’s Camera app and shared them off the Photos app via two Mail sharing option emails containing seven attachments each. Using an iPad, the JPEG “jpg” output files were too big for our inhouse Animated GIF Creator PHP web application to handle, and so to perform the …

  • animated GIF presentation, off these downloaded email photo attachments … and along the way …
  • quality adjusted them (yes, “mogrify” does not stuff JPG to JPG conversions, and we used “mogrify” -quality 20% switch here) … and …
  • rotate them 180 degrees (“mogrify” uses switches -affine -1,0,0,-1,0,0 -transform +repage here) … and …
  • vignette 50% (“mogrify” uses switch -vignette 50 here)

… on the way to compiling into an animated GIF image, and we turned to ImageMagick again, using its affine transformation talents, along with its awesome vignetting talents …




… where the last two dropdown options will be similar, the last showing the input image into ImageMagick can be an animated GIF that is truely treated like an animated GIF.

By the way, should you be interested in photo orientation off a mobile device camera, have a read of PHP Exif Image Information Revisit Tutorial.

Nala and Luna and Charlie bid you a fond farewell!


Previous relevant Gimp Vignette Primer Tutorial is shown below.

Gimp Vignette Primer Tutorial

Gimp Vignette Primer Tutorial

The last time we talked about the miraculous, redolent and amazing image editor called Gimp am sure there was someone in a shower … it stands to reason … and one of those showerers, surely, would have been singing The Gimp Song … and if not … why not? … but we digress … anyway we had the Gimp Transparency Primer Tutorial as shown below go into some image transparency issues with Gimp.

In today’s tutorial we make use of a great tutorial (even so far as with direct quotes below) called Add a Vignette to a Photograph with GIMP (thanks) to try a photographic technique called vignetting on one of the photographs we added, recently, into the mix of those of the Custom Header Image mix at this blog … specifically the one of Nala, the dog, on the door ledge. Need to warn you here and now that if there was the time all over again, it would be better achieved that second time around, but this is not the point with learning, but rather getting some starting point with a great “product” like Gimp, and trying it yourself, once you have a method. It boils down to:

  1. Open Gimp graphical editor application
  2. File->Open … pick your image file
  3. Layer->New Layer (we’ll call “Vg”) … pick Foreground Colour
  4. In the Layers dialog, click on your “Vg” layer to select it, and select Soft light from the “Mode” drop-down box
  5. Right click on your “Vg” layer and go to Add Layer Mask. In the dialog that pops up, you want “Initialise Layer Mask to” set to “White (full opacity)”. Click “Add”
  6. Below Opacity bar select Link icon next to Eye icon, which will already be showing
  7. Use the freeform select tool (press F to bring this up) and draw a selection somewhere around the primary point of interest in your photo
  8. Use your bucket tool (Shift+B) and click within the selection to fill it
  9. Deselect your selection with Select->None
  10. Go to Filters->Blur->Gaussian Blur. In the dialog that comes up, you want “Radius” set to a very large amount; a tenth of the longest edge of the photo is not too much
  11. Click on your “Vg” layer to select it (if it isn’t already selected), and then slide the opacity slider towards the right until the effect is subtle enough. Our (ever so subtle) example of Nala, in the tutorial, used an opacity of about 66%
  12. Click Export button in two windows (NB. this overwrites the image file, so if this is not desirable, export to a different image file name and/or type)

Here is an image comparison link.

As with most Gimp ideas, jump in and give it a go, as you’ll find your own ways and means of using this great product … am pretty sure.

Link to Gimp “spiritual home” … here.
Link to Gimp forum … here.


Previous relevant Gimp Transparency Primer Tutorial is shown below.

Gimp Transparency Primer Tutorial

Gimp Transparency Primer Tutorial

Here is a tutorial that adds to a previous Gimp Layers Primer Tutorial as shown below, and gives you more insight into the massive possibilities of using a sophisticated image editor and use layers with various amounts of transparency, especially suited to use with png image files.

Today’s tutorial where we construct a Birthday Card that needs tweaking for the words in front to be seen a bit more clearly, by making the image behind a bit more transparent, changes the transparency of a single image via:

  1. Open Gimp graphical editor application
  2. File->Open Layers … pick your image file
  3. If Layers window not showing, make it show via Windows->Layers – Brushes
  4. Below Opacity bar select Link icon next to Eye icon, which will already be showing
  5. Change Opacity bar setting to a value of Transparency (100% is Opaque, 0% is Transparent) that suits … today we do 70%
  6. File->Export
  7. Click Export button in two windows (NB. this overwrites the image file, so if this is not desirable, export to a different image file name and/or type)

As with most Gimp ideas, jump in and give it a go, as you’ll find your own ways and means of using this great product … am pretty sure.

Link to Gimp “spiritual home” … here.
Link to Gimp forum … here.


Previous relevant Gimp Layers Primer Tutorial is shown below.

Gimp Layers Primer Tutorial

Gimp Layers Primer Tutorial

Here is a tutorial that gives you an insight into the massive possibilities of using a sophisticated image editor and use layers with various amounts of transparency, especially suited to use with png image files.

Transparency (or its obverse, opacity) can be used to have the one image achieve several “ends” (ie. purposes). Although it is a bit of a clumsy example in the tutorial, you can see that the technique can be used for artistic purposes … often called “Photoshopping” (named after the more famous, and also brilliant, rival product, Photoshop).

Lots of those classic “Photoshopping” techniques can be achieved in Gimp, and some other tutorials at this blog touch on that.

Am sure you can imagine what the concept of a layer is with regard to image manipulation. Within Gimp, for beginners not used to this concept, you find yourself underestimating and underplaying what can be achieved with the various layers of a multi-layered image. In simplistic terms each layer has the functionality in Gimp to be treated as a whole new image, and this is the best way to think of it when trying to achieve what you want to achieve with Gimp.

Link to Gimp “spiritual home” … here.
Link to Gimp forum … here.

If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.

Posted in eLearning, Event-Driven Programming, Tutorials | Tagged , , , , , , , , , , , , | Leave a comment

Tabular Single Row Textarea Sharing Tutorial

Tabular Single Row Textarea Sharing Tutorial

Tabular Single Row Textarea Sharing Tutorial

Yesterday’s Tabular Single Row Radio Play Tutorial‘s web application has two interesting features …

  • lots of use of textarea element placeholder attribute for explaining more complex data entry scenarios … and as of today …
  • a button element with the potential that it’s “innards” (ie. it’s innerHTML) is filled by a dropdown (ie. select element)

… it being our first time trying any HTML button element “innards” that were not always straight text. Is this the “comboBox” style of arrangement we used to see with desktop application GUIs and have long wished to simulate the usefulness of, online?!

Well, we’re not quite sure, but we think we’re going to look into it more into the future. So, what are we storing in this dropdown? We’re offering the user the chance … over to you code


document.getElementById('inp' + potlist[jwq] + '_' + document.getElementById(potlist[jwq]).target).title+='Entries starting with _ can describe ... ' + String.fromCharCode(10) + String.fromCharCode(10);
document.getElementById('inp' + potlist[jwq] + '_' + document.getElementById(potlist[jwq]).target).title+=' Comma separated audio stream only list of your own recallable YouTube IDs playlist' + String.fromCharCode(10);
document.getElementById('inp' + potlist[jwq] + '_' + document.getElementById(potlist[jwq]).target).title+=' Semicolon separated video list of your own recallable YouTube IDs playlist' + String.fromCharCode(10);
document.getElementById('inp' + potlist[jwq] + '_' + document.getElementById(potlist[jwq]).target).title+=' One of these inhouse playlist names above which start with tube' + perusedlist + String.fromCharCode(10);
document.getElementById('inp' + potlist[jwq] + '_' + document.getElementById(potlist[jwq]).target).title+=' YouTube Playlist 34 character identifier' + String.fromCharCode(10);
document.getElementById('inp' + potlist[jwq] + '_' + document.getElementById(potlist[jwq]).target).title+=' Spotify Playlist 22 character identifier' + String.fromCharCode(10);
document.getElementById('inp' + potlist[jwq] + '_' + document.getElementById(potlist[jwq]).target).title+=' Sundry _email _sms _saverecall _http://youtube.com#example' + String.fromCharCode(10);
document.getElementById('inp' + potlist[jwq] + '_' + document.getElementById(potlist[jwq]).target).ondblclick=function(event){ alert(event.target.title); };

… culminating in this new Javascript function …


function underscoresystem(inans, inota) {
var anchor=null, subjh='?subject=Hello';
var outans=inans;
var ytpllen=34; //eval('' + ('PLNtJQ2eJVoAMFocY7LOANvPH3cLyUonin').length);
var onevlen=11;
var sppllen=22;
var inhouse='';
var rperson='';
var mperson='';
var tperson='';
var jnota=inota;
if (outans.trim() != '') {
if (outans.toLowerCase().indexOf('mailto') == 0 || outans.toLowerCase().indexOf('email') == 0 || outans.toLowerCase().indexOf('sms') == 0 || outans.toLowerCase().indexOf('http') == 0 || outans.toLowerCase().indexOf('//') == 0 || outans.toLowerCase().indexOf('www.') == 0 || outans.toLowerCase().indexOf('save') == 0 || outans.toLowerCase().indexOf('recall') == 0) {
outans='_' + inans;
}
if (outans.replace(/^tube/g,'_').substring(0,1) == '_') {
subjh='?subject=' + encodeURIComponent('' + document.title + ' regarding ' + document.URL);
if (inota) {
if (document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target)) {
jnota=document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target);
}
}
if (('' + top.document.URL).indexOf('/swipe_media.htm') != -1) {
subjh='?subject=' + encodeURIComponent('' + document.title + ' regarding ' + document.URL);
if (('' + top.document.URL).indexOf('youtube=') != -1) {
if (('' + top.document.URL).indexOf('audioyoutube=') != -1 && ('' + top.document.URL).indexOf('isradio=') != -1) {
tperson='tuberadioapl_';
} else if (('' + top.document.URL).indexOf('youtube=') != -1 && ('' + top.document.URL).indexOf('isradio=') != -1) {
tperson='tuberadiovpl_';
} else if (('' + top.document.URL).indexOf('audioyoutube=') != -1 && ('' + top.document.URL).indexOf('isradio=') == -1) {
tperson='tubeapl_';
} else {
tperson='tubevpl_';
}
}
} else if ((outans + ' ').substring(0,4) == '____') {
tperson='tuberadioapl_';
outans=outans.replace(/^\_\_\_\_/g,'_');
} else if ((outans + ' ').substring(0,3) == '___') {
tperson='tuberadiovpl_';
outans=outans.replace(/^\_\_\_/g,'_');
} else if ((outans + ' ').substring(0,2) == '__') {
tperson='tubeapl_';
outans=outans.replace(/^\_\_/g,'_');
}
if (outans.indexOf('_recall') == 0 || outans.indexOf('_save') == 0) {
newlsval=tperson + ( ('' + Math.floor(Math.random() * 19897654)) + ('' + Math.floor(Math.random() * 19897654)) + ('' + Math.floor(Math.random() * 19897654)) + '000000000000000000000000000').substring(0,27);
if (perusedlist == '') { perusedlist=' ( and we found )'; }
perusedlist=perusedlist.replace(' )', ' ' + newlsval + ' )');
lastbize(newlsval, document.URL);
window.localStorage.setItem(newlsval, encodeURIComponent(document.URL));
jnota.title+=' ... for future recall reenter in web browser similar textarea playlist name ' + newlsval;
outans='';
if (inota) {
if (document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target)) {
jnota=document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target);
}
jnota.value='';
}
if (document.getElementById('recallable')) {
document.getElementById('recallable').innerHTML=newlsval;
document.getElementById('recallable').style.visibility='visible';
lastrecall=maybeselize(document.URL,lastrecall,newlsval);
}
newlsval='';

} else if (outans.toLowerCase().indexOf('_mailto') == 0 || outans.toLowerCase().indexOf('_email') == 0) {
anchor = document.createElement('a');
if (outans.toLowerCase().replace('_email','_mailto').indexOf('mailto:') != -1 && (outans.toLowerCase().trim() + '?').replace('_email','_mailto').indexOf('mailto:?') == -1) {
anchor.href = 'mailto:' + (outans.toLowerCase().trim() + '?').replace('_email','_mailto').split('mailto:')[1].split('?')[0] + subjh + '&body=' + encodeURIComponent(document.URL);
} else {
anchor.href = 'mailto:' + subjh + '&body=' + encodeURIComponent(document.URL);
}
anchor.style.display='none';
document.body.appendChild(anchor);
anchor.innerHTML='Email';
anchor.target='_top';
anchor.click();
outans='';
if (inota) {
if (document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target)) {
jnota=document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target);
}
jnota.value='';
}

} else if (outans.toLowerCase().indexOf('_sms') == 0) {
subjh='';
anchor = document.createElement('a');
if (outans.toLowerCase().indexOf('sms:') != -1 && (outans.toLowerCase().trim().replace('&','?') + '?').indexOf('sms:?') == -1) {
anchor.href = 'sms:' + (outans.toLowerCase().trim().replace('&','?') + '?').split('sms:')[1].split('?')[0] + subjh + '&body=' + encodeURIComponent(document.URL);
} else {
anchor.href = 'sms:' + subjh + '&body=' + encodeURIComponent(document.URL);
}
anchor.style.display='none';
document.body.appendChild(anchor);
anchor.innerHTML='SMS';
anchor.target='_top';
anchor.click();
outans='';
if (inota) {
if (document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target)) {
jnota=document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target);
}
jnota.value='';
}


} else if (outans.toLowerCase().indexOf('_http') == 0) {
window.open(outans.substring(5).replace(/^s/g,'').replace(/^\:/g,''), '_blank', 'top=50,left=50,width=500,height=500');
outans='';
if (inota) {
if (document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target)) {
jnota=document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target);
}
jnota.value='';
}


} else if (outans.toLowerCase().indexOf('_//') == 0) {
window.open(outans.substring(1), '_blank', 'top=50,left=50,width=500,height=500');
outans='';
if (inota) {
if (document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target)) {
jnota=document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target);
}
jnota.value='';
}


} else if (outans.toLowerCase().indexOf('_www') == 0) {
window.open('//' + outans.substring(1), '_blank', 'top=50,left=50,width=500,height=500');
outans='';
if (inota) {
if (document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target)) {
jnota=document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target);
}
jnota.value='';
}

} else if (outans.indexOf(',') != -1) { // tuberadioapl_
if (eval(eval('' + outans.replace(/\,/g,'').replace(/\;/g,'').length) % 11) == 1) {
if (tperson == '') { tperson='tubeapl_'; }
newlsval=tperson + ( ('' + Math.floor(Math.random() * 19897654)) + ('' + Math.floor(Math.random() * 19897654)) + ('' + Math.floor(Math.random() * 19897654)) + '000000000000000000000000000').substring(0,27);
if (perusedlist == '') { perusedlist=' ( and we found )'; }
perusedlist=perusedlist.replace(' )', ' ' + newlsval + ' )');
lastbize(newlsval, outans.substring(1).replace(/\;/g,','));
window.localStorage.setItem(newlsval, encodeURIComponent(outans.substring(1).replace(/\;/g,',')));
if (inota) {
jnota.title+=' ... for future recall reenter in this web browser similar textarea playlist name ' + newlsval;
}
return underscoresystem(newlsval, inota);
} else if (eval(eval('' + outans.replace(/\;/g,'').replace(/\,/g,'').length) % 11) == 0) {
if (tperson == '') { tperson='tuberapl_'; }
newlsval=tperson + ( ('' + Math.floor(Math.random() * 19897654)) + ('' + Math.floor(Math.random() * 19897654)) + ('' + Math.floor(Math.random() * 19897654)) + '000000000000000000000000000').substring(0,27);
if (perusedlist == '') { perusedlist=' ( and we found )'; }
perusedlist=perusedlist.replace(' )', ' ' + newlsval + ' )');
lastbize(newlsval, outans.substring(0).replace(/\;/g,','));
window.localStorage.setItem(newlsval, encodeURIComponent(outans.substring(0).replace(/\;/g,',')));
if (inota) {
jnota.title+=' ... for future recall reenter in web browser similar textarea playlist name ' + newlsval;
}
return underscoresystem(newlsval, inota);
}
} else if (outans.indexOf(';') != -1) { // tuberadiovpl_
if (eval(eval('' + outans.replace(/\;/g,'').replace(/\,/g,'').length) % 11) == 1) {
if (tperson == '') { tperson='tubevpl_'; }
newlsval=tperson + ( ('' + Math.floor(Math.random() * 19897654)) + ('' + Math.floor(Math.random() * 19897654)) + ('' + Math.floor(Math.random() * 19897654)) + '000000000000000000000000000').substring(0,27);
if (perusedlist == '') { perusedlist=' ( and we found )'; }
perusedlist=perusedlist.replace(' )', ' ' + newlsval + ' )');
window.localStorage.setItem(newlsval, encodeURIComponent(outans.substring(1).replace(/\;/g,',')));
lastbize(newlsval, outans.substring(1).replace(/\;/g,','));
if (inota) {
jnota.title+=' ... for future recall reenter in web browser similar textarea playlist name ' + newlsval;
}
return underscoresystem(newlsval, inota);
} else if (eval(eval('' + outans.replace(/\;/g,'').replace(/\,/g,'').length) % 11) == 0) {
if (tperson == '') { tperson='tubevpl_'; }
newlsval=tperson + ( ('' + Math.floor(Math.random() * 19897654)) + ('' + Math.floor(Math.random() * 19897654)) + ('' + Math.floor(Math.random() * 19897654)) + '000000000000000000000000000').substring(0,27);
if (perusedlist == '') { perusedlist=' ( and we found )'; }
perusedlist=perusedlist.replace(' )', ' ' + newlsval + ' )');
window.localStorage.setItem(newlsval, encodeURIComponent(outans.substring(0).replace(/\;/g,',')));
lastbize(newlsval, outans.substring(0).replace(/\;/g,','));
if (inota) {
jnota.title+=' ... for future recall reenter in web browser similar textarea playlist name ' + newlsval;
}
return underscoresystem(newlsval, inota);
}
} else {
switch ('' + eval('' + outans.length)) {
case '23':
outans=outans.replace(/^\_/g,'');
case '22':
window.open('//open.spotify.com/playlist/' + outans,'_blank'); //,'top=0,left=0,width=" + screen.width + ",height=" + screen.height);
outans='';
if (inota) {
if (document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target)) {
jnota=document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target);
}
jnota.value='';
}
break;


case '35':
outans=outans.replace(/^\_/g,'');
case '34':
window.open('//www.youtube.com/playlist?list=' + outans,'_blank'); //,'top=0,left=0,width=" + screen.width + ",height=" + screen.height);
outans='';
if (inota) {
if (document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target)) {
jnota=document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target);
}
jnota.value='';
}
break;


case '12':
outans=outans.replace(/^\_/g,'');
case '11':
if (('' + top.document.URL).indexOf('youtube=') != -1) {
top.location.href=top.document.URL.split('youtube=')[0] + 'youtube=' + outans;
outans='';
if (inota) {
if (document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target)) {
jnota=document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target);
}
jnota.value='';
}
} else {
underscorewo=window.open("//www.rjmprogramming.com.au/HTMLCSS/karaoke_youtube_api.htm?youtubeid=" + outans + "&justaJUNKudio=&youtube_duration=22234.0&email=&emoji=on&c0=off&i0=0&j0=22234&i1=&j1=&i2=&j2=&i3=&j3=&i4=&j4=&i5=&j5=&i6=&j6=&i7=&j7=&i8=&j8=&i9=&j9=&i10=&j10=&i11=&j11=&i12=&j12=&i13=&j13=&i14=&j14=&i15=&j15=&i16=&j16=&i17=&j17=&i18=&j18=&i19=&j19=&i20=&j20=&i21=&j21=&i22=&j22=&i23=&j23=&i24=&j24=&i25=&j25=&i26=&j26=&i27=&j27=&i28=&j28=&i29=&j29=","_blank","top=10,left=10,width=800,height=800");
outans='';
if (inota) {
if (document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target)) {
jnota=document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target);
jnota.value='';
}
}
}
break;


default:
if (outans.toLowerCase().indexOf('_tube') == 0) { outans=outans.replace(/^\_/g,''); }
if (outans.toLowerCase().indexOf('tuberadiovpl_') == 0) {
inhouse=('' + window.localStorage.getItem(outans)).replace(/^undefined/g,'').replace(/^null/g,'');
newlsval='';
} else if (outans.toLowerCase().indexOf('tuberadioapl_') == 0) {
inhouse=('' + window.localStorage.getItem(outans)).replace(/^undefined/g,'').replace(/^null/g,'');
newlsval='';
} else if (outans.toLowerCase().indexOf('tuberadiopl_') == 0) {
inhouse=('' + window.localStorage.getItem(outans)).replace(/^undefined/g,'').replace(/^null/g,'');
newlsval='';
} else if (outans.toLowerCase().indexOf('tubeapl_') == 0) {
inhouse=('' + window.localStorage.getItem(outans)).replace(/^undefined/g,'').replace(/^null/g,'');
newlsval='';
} else if (outans.toLowerCase().indexOf('tubevpl_') == 0) {
inhouse=('' + window.localStorage.getItem(outans)).replace(/^undefined/g,'').replace(/^null/g,'');
newlsval='';
} else if (outans.toLowerCase().indexOf('tubepl_') == 0) {
inhouse=('' + window.localStorage.getItem(outans)).replace(/^undefined/g,'').replace(/^null/g,'');
newlsval='';
} else if (eval('' + outans.length) == 28) {
inhouse=('' + window.localStorage.getItem('tubepl_' + outans.replace(/^\_/g,''))).replace(/^undefined/g,'').replace(/^null/g,'');
if (inhouse == '') {
inhouse=('' + window.localStorage.getItem('tubevpl_' + outans.replace(/^\_/g,''))).replace(/^undefined/g,'').replace(/^null/g,'');
}
if (inhouse == '') {
mperson='audio'
inhouse=('' + window.localStorage.getItem('tubeapl_' + outans.replace(/^\_/g,''))).replace(/^undefined/g,'').replace(/^null/g,'');
}
if (inhouse == '') {
mperson='isradio=y&audio'
inhouse=('' + window.localStorage.getItem('tuberadioapl_' + outans.replace(/^\_/g,''))).replace(/^undefined/g,'').replace(/^null/g,'');
}
if (inhouse == '') {
mperson='isradio=y&'
inhouse=('' + window.localStorage.getItem('tuberadiovpl_' + outans.replace(/^\_/g,''))).replace(/^undefined/g,'').replace(/^null/g,'');
}
} else if (eval('' + outans.length) == 27) {
inhouse=('' + window.localStorage.getItem('tubepl_' + outans)).replace(/^undefined/g,'').replace(/^null/g,'');
if (inhouse == '') {
inhouse=('' + window.localStorage.getItem('tubevpl_' + outans)).replace(/^undefined/g,'').replace(/^null/g,'');
}
if (inhouse == '') {
mperson='audio'
inhouse=('' + window.localStorage.getItem('tubeapl_' + outans)).replace(/^undefined/g,'').replace(/^null/g,'');
}
if (inhouse == '') {
inhouse=('' + window.localStorage.getItem('tuberadioapl_' + outans)).replace(/^undefined/g,'').replace(/^null/g,'');
}
if (inhouse == '') {
mperson='isradio=y&'
inhouse=('' + window.localStorage.getItem('tuberadiovpl_' + outans)).replace(/^undefined/g,'').replace(/^null/g,'');
}
}
if (inhouse.trim() != '') {
if (decodeURIComponent(inhouse).toLowerCase().indexOf('rjmprogramming.com.au') != -1) {
if (!inota) { return decodeURIComponent(inhouse) + '#' + outans; }
underscorewo=window.open(inhouse + '#' + outans,"_blank","top=0,left=0,width=" + screen.width + ",height=" + screen.height);
outans='';
if (document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target)) {
jnota=document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target);
jnota.value='';
}
} else {
if (!inota) { return "//www.rjmprogramming.com.au/HTMLCSS/swipe_media.html?" + mperson + "youtube=" + encodeURIComponent(decodeURIComponent(inhouse)) + "#" + outans; }
underscorewo=window.open("//www.rjmprogramming.com.au/HTMLCSS/swipe_media.html?" + mperson + "youtube=" + encodeURIComponent(decodeURIComponent(inhouse)) + "#" + outans,"_blank","top=0,left=0,width=" + screen.width + ",height=" + screen.height);
outans='';
if (document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target)) {
jnota=document.getElementById('inp' + inota.id + '_' + document.getElementById(inota.id).target);
jnota.value='';
}
}
}
break;
}
}
}
}
return outans;
}

Yes, the placeholder was struggling with what we wanted to offer as functionality, so we’re putting more into the textarea title attribute. These options allow users to create their own recallable playlists or access existant YouTube or Spotify ones to keep the music rolling in changed swipe_media.html Tabular Single Row Media Gallery helped out by ytaudioonly.js external Javascript helper.


Previous relevant Tabular Single Row Radio Play Tutorial is shown below.

Tabular Single Row Radio Play Tutorial

Tabular Single Row Radio Play Tutorial

We do not expect many readers to have thought yesterday’s YouTube Audio Only Mobile Looping Tutorial that little bit different. It was long in the making, and difficult (at least for us), but a brief tutorial. Too brief for interested parties, and we intended it as a seminal discussion, but it’s meaning got subsumed, if you will, with the goings on of the blog posting thread last talked about with the day before’s Tabular Single Row Image Gallery Linking Tutorial.

You see, the YouTube audio stream only inhouse looping control is an essential thing we needed to tie down for today’s progress in this blog posting thread, that being the first incarnation of …

Radio Play

… sequenced modes of play we’re offering today, as a start, for …

  • non-mobile users
  • using audio stream only button option clicks

So what was (most) …

difficult (at least for us)

… about getting this first Radio Play idea happening? In a word …

Focus

You find yourself wanting to do lots of …


[element].click();

… and …


[element].blur();

… types of work, which work best with focus (and boy, did we need to “focus”?!) We’ve minimised this where we could, but what we highly recommend users of this functionality doing is …

  • be presented with the solo web browser full screen (initial) window with the radio emoji
  • click desired first song link when the song link emojis appear … then …
  • it’s best to make this window small and away from other web browser windows but not overlapping for the best chance of …
  • songs play in sequence and loop back through the list

… within changed swipe_media.html Tabular Single Row Media Gallery helped out by ytaudioonly.js external Javascript helper.


Previous relevant Tabular Single Row Image Gallery Linking Tutorial is shown below.

Tabular Single Row Image Gallery Linking Tutorial

Tabular Single Row Image Gallery Linking Tutorial

After yesterday’s Tabular Single Row YouTube Audio or Video Buttons Tutorial work mainly regarding audio and video media, today we return to those …

  • background WordPress Blog random tutorial images … and link them via a modified 404.php creator’s …
    <?php

    if (strpos(('?' . $_SERVER['QUERY_STRING']), '?rand=') !== false) {
    $huht=@file_get_contents('http://www.rjmprogramming.com.au/HTMLCSS/select_palette.php?putrandom=' . urlencode('?rand=' . $_GET['rand'] . '.' . $pnumis . $ptitle));
    }

    ?>
    … calling on …
  • a modified select_palette.php helper …
    <?php

    if (isset($_GET['putrandom'])) {
    $contis=str_replace(' ','++',str_replace('+',' ',urldecode($_GET['putrandom']))) . "\n";
    $xcurgmt=gmdate("Ymd");
    if (!file_exists($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'media_gallery_swipe_' . $xcurgmt . '.htm')) {
    foreach (glob($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'media_gallery_swipe_' . '*.htm') as $dfilename) {
    unlink($dfilename);
    }
    file_put_contents($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'media_gallery_swipe_' . $xcurgmt . '.htm', $contis);
    } else {
    file_put_contents($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'media_gallery_swipe_' . $xcurgmt . '.htm', file_get_contents($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'media_gallery_swipe_' . $xcurgmt . '.htm') . $contis);
    }
    exit;
    } else if (isset($_GET['getrandom'])) {
    $xcurgmt=gmdate("Ymd");
    $imode=0;
    $contis="";
    $idp="";
    $jdp="";
    $pfix="";
    $sfix="";
    if (file_exists($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'media_gallery_swipe_' . $xcurgmt . '.htm')) {
    $contis=file_get_contents($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'media_gallery_swipe_' . $xcurgmt . '.htm');
    if (strlen($_GET['getrandom']) > 0) {
    $relstuffs=explode(str_replace(' ','++',str_replace('+',' ',strtolower(urldecode($_GET['getrandom'])))) . '.', $contis);
    if (sizeof($relstuffs) > 1) {
    $isub=0;
    $jdp=str_replace('rand=','',str_replace(' ','++',str_replace('+',' ',strtolower(urldecode($_GET['getrandom'])))));
    $imode=1;
    while (substr(substr($relstuffs[-1 + sizeof($relstuffs)],$isub),0,1) >= '0' && substr(substr($relstuffs[-1 + sizeof($relstuffs)],$isub),0,1) <= '9') {
    if ($imode == 0) {
    $jdp.=substr(substr($relstuffs[-1 + sizeof($relstuffs)],$isub),0,1);
    } else {
    $idp.=substr(substr($relstuffs[-1 + sizeof($relstuffs)],$isub),0,1);
    }
    $isub++;
    if (substr(substr($relstuffs[-1 + sizeof($relstuffs)],$isub),0,1) == '.') {
    $imode=1;
    $isub++;
    }
    }
    if (isset($_GET['via'])) {
    $pfix=" if (parent.document.getElementById('" . $_GET['via'] . "')) { parent.document.getElementById('" . $_GET['via'] . "').style.width='100%;'; parent.document.getElementById('" . $_GET['via'] . "').innerHTML+='<iframe style=width:100%;height:800px; src=!!!></iframe>'; } else { ";
    $sfix=" } ";
    }
    if (strtolower(urldecode($_GET['getrandom'])) != urldecode($_GET['getrandom'])) { // Cut to the Chase
    echo "<html><body onload=\"" . str_replace('!!!','/slideshow.html?title=' . explode(" (", explode("\n", explode('=' . $jdp . '.' . $idp, $contis)[1])[0])[0],$pfix) . " parent.window.open('/slideshow.html?title=" . explode(" (", explode("\n", explode('=' . $jdp . '.' . $idp, $contis)[1])[0])[0] . " " . $sfix . " ','_blank','top=200,left=200,width=600,height=600');\"></body></html>";
    exit;
    } else { // WordPress Blog Posting
    echo "<html><body onload=\"" . str_replace('!!!','/ITblog/?p=' . $idp . '#content',$pfix) . " parent.window.open('/ITblog/?p=" . $idp . "#content','_blank','top=200,left=200,width=600,height=600'); " . $sfix . " \"></body></html>";
    exit;
    }
    }
    }
    }
    echo "<html><body><pre>" . $contis . '</pre></body></html>';
    exit;
    }

    ?>
    … called at the parent window by …
  • changed swipe_media.html Tabular Single Row Media Gallery

    function checkmeout(evt, iscuttothechase) {
    if (evt.target.outerHTML.split('>')[0].indexOf('url(') != -1) {
    if (evt.target.outerHTML.split('>')[0].split('url(')[1].split(')')[0].indexOf('?rand=') != -1) {
    if (iscuttothechase) {
    document.getElementById('sparepal').src='/HTMLCSS/select_palette.php?getrandom=' + encodeURIComponent('RAND=' + evt.target.outerHTML.split('>')[0].split('url(')[1].split(')')[0].split('?rand=')[1].split("'")[0].split('"')[0].split(')')[0].split('"')[0]); // + ('&viJUNKa=' + evt.target.id).replace('td','div')
    } else {
    document.getElementById('sparepal').src='/HTMLCSS/select_palette.php?getrandom=' + encodeURIComponent('rand=' + evt.target.outerHTML.split('>')[0].split('url(')[1].split(')')[0].split('?rand=')[1].split("'")[0].split('"')[0].split(')')[0].split('"')[0]); // + ('&viJUNKa=' + evt.target.id).replace('td','div')
    }
    }
    }
    }

… web application, now accepting …

  1. click on one of these WordPress Blog random tutorial images to open window to relevant WordPress Blog posting … or …
  2. right click on one of these WordPress Blog random tutorial images to open window to relevant Cut to the Chase web application or presentation media regarding that blog posting above


Previous relevant Tabular Single Row YouTube Audio or Video Gallery Tutorial is shown below.

Tabular Single Row YouTube Audio or Video Gallery Tutorial

Tabular Single Row YouTube Audio or Video Gallery Tutorial

Today we’ve connected …

… which now have three new functionality options …

  • <–> … link to align the (previously) “Brady Bunch” YouTube iframes into a single row in the same web browser tab
  • <–>A+V … call of yesterday’s Media Gallery web application playing our “inhouse” YouTube iframe video playing web application in a new web browser tab
  • <–>A-V … link to our “inhouse” audio stream only YouTube iframe playing functionality in a new web browser tab

… involving changes to …

  • our changed

    var ytlist='';

    if (('' + document.URL + ('' + location.hash)).indexOf('onerow=') != -1) {
    setTimeout(function(){
    var inis='';
    var iwis=document.getElementById('vplayer1').getBoundingClientRect().width;
    var ifsare=document.getElementsByTagName('iframe');
    for (var jtt=0; jtt<ifsare.length; jtt++) {
    //alert(ifsare[jtt].src);
    if (ifsare[jtt].src.indexOf('/embed/') != -1) {
    if (ytlist == '') {
    ytlist='' + ifsare[jtt].src.split('/embed/')[1].substring(0,11);
    } else {
    ytlist+=',' + ifsare[jtt].src.split('/embed/')[1].substring(0,11);
    }
    }
    ifsare[jtt].style.width='' + iwis + 'px';
    }
    var toho=document.getElementsByTagName('table')[0];
    var tih=toho.innerHTML;
    var newtih=tih;
    //alert(tih);
    var thingos=tih.split('<tr');
    for (var itt=3; itt>=1; itt--) {
    if (itt == 1) {
    inis='<tr' + thingos[itt].split('</tr>')[0] + '</tr>';
    newtih=newtih.replace(inis, inis.replace('</tr>','<!--/tr-->'));
    } else if (itt == 3) {
    inis='<tr' + thingos[itt].split('</tr>')[0] + '</tr>';
    newtih=newtih.replace(inis, inis.replace('<tr>','<!--tr-->'));
    } else {
    inis='<tr' + thingos[itt].split('</tr>')[0] + '</tr>';
    newtih=newtih.replace(inis, inis.replace('<tr>','<!--tr-->').replace('</tr>','<!--/tr-->'));
    }
    }
    toho.innerHTML=newtih;
    toho.style.width='1000%';
    }, 4000);
    }

    setTimeout(function(){
    var antwo='';
    if (ytlist == '') {
    var ifsare=document.getElementsByTagName('iframe');
    for (var jtt=0; jtt<ifsare.length; jtt++) {
    //alert(ifsare[jtt].src);
    if (ifsare[jtt].src.indexOf('/embed/') != -1) {
    if (ytlist == '') {
    ytlist='' + ifsare[jtt].src.split('/embed/')[1].substring(0,11);
    } else {
    ytlist+=',' + ifsare[jtt].src.split('/embed/')[1].substring(0,11);
    }
    }
    }
    }
    if (ytlist != '') {
    antwo+=' <a title="Audio and video plays of YouTube videos" target=_blank href="/HTMLCSS/swipe_media.html?youtube=' + encodeURIComponent(ytlist) + '"><--><sup>A+V</sup></a>';
    antwo+=' <a title="Audio only plays of YouTube videos" target=_blank href="/HTMLCSS/swipe_media.html?audioyoutube=' + encodeURIComponent(ytlist) + '"><--><sub>A-V</sub></a>';
    }
    if (document.URL.indexOf('?') != -1) {
    document.getElementById('wshuffle').innerHTML+=' <a title="Present in one table row" target=_self href="' + document.URL.replace('?', '?onerow=' + Math.floor(Math.random() * 1989786)) + '"><--></a>' + antwo + ' ';
    } else {
    document.getElementById('wshuffle').innerHTML+=' <a title="Present in one table row" target=_self href="' + document.URL + '?onerow=' + Math.floor(Math.random() * 1989786) + '"><--></a>' + antwo + ' ';
    }
    }, 9000);

    youtube_brady_bunch.js being used in our inhouse Disco web application “peer to peer suite” web application “grandparent” level example …
  • “second draft” swipe_media.html Tabular Single Row Image Gallery web application


Previous relevant Tabular Single Row Image Gallery Primer Tutorial is shown below.

Tabular Single Row Image Gallery Primer Tutorial

Tabular Single Row Image Gallery Primer Tutorial

“Tabular Single Row Image Gallery” …

Smabular Single Row Image Gallery

… we’re sure is the reaction of some readers out there, to today’s “starting draft” for an idea we had. Today’s part of the jigsaw we want to explore may be “ho hum” and “so non-mobile”, but we’re hoping the thread appeals to more modern ideas as we go along.

So much for the apologies, and so let’s now look at the basis to this start …

  • media (so far just image) …
  • gallery … presented in …
  • table … HTML element … in …
  • single tr row
  • deliberately overflowing to the right of the screen view of the webpage … and so …
  • scrollable (ie. window scrollable) to … those right hand parts …
  • only “media loaded” …
  • as “scrolled to” or “stumbled upon”

So far the window scrollable detection goes (thanks to this useful link) …


window.onscroll = function (e) {
// called when the window is scrolled.
vspos4=document.body.scrollTop;
vspos3=document.body.scrollLeft;
var vstdn=Math.ceil(eval('' + vspos3) / eval('' + amin));
if (curtdn != vstdn) {
checkthen(vstdn);
}
}

… and the CSS produced “wording (ie. non-media) content” is produced down the bottom left of “inhouse WordPress Blog image cell background” ( possible because of background-size:contain ) we think is interesting …


<style>
td {
border: 1px dotted green;
}

.inhouse {
vertical-align: bottom;
padding-bottom: 20px;
}

.inhouse::after {
content: 'Media Gallery \a RJM Programming \a August, 2025 \a Thanks to Lorem Picsum at https://picsum.photos/ \a ' attr(alt);
white-space: pre-wrap;
}

</style>

… in a “first draft” Tabular Single Row Image Gallery web application for your perusal. Thanks to Lorem Picsum regarding, as so often happens for us, when we’d like beautiful random images to be involved with web applications!

If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.

Posted in eLearning, Event-Driven Programming, Tutorials | Tagged , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , | Leave a comment

Tabular Single Row Radio Play Tutorial

Tabular Single Row Radio Play Tutorial

Tabular Single Row Radio Play Tutorial

We do not expect many readers to have thought yesterday’s YouTube Audio Only Mobile Looping Tutorial that little bit different. It was long in the making, and difficult (at least for us), but a brief tutorial. Too brief for interested parties, and we intended it as a seminal discussion, but it’s meaning got subsumed, if you will, with the goings on of the blog posting thread last talked about with the day before’s Tabular Single Row Image Gallery Linking Tutorial.

You see, the YouTube audio stream only inhouse looping control is an essential thing we needed to tie down for today’s progress in this blog posting thread, that being the first incarnation of …

Radio Play

… sequenced modes of play we’re offering today, as a start, for …

  • non-mobile users
  • using audio stream only button option clicks

So what was (most) …

difficult (at least for us)

… about getting this first Radio Play idea happening? In a word …

Focus

You find yourself wanting to do lots of …


[element].click();

… and …


[element].blur();

… types of work, which work best with focus (and boy, did we need to “focus”?!) We’ve minimised this where we could, but what we highly recommend users of this functionality doing is …

  • be presented with the solo web browser full screen (initial) window with the radio emoji
  • click desired first song link when the song link emojis appear … then …
  • it’s best to make this window small and away from other web browser windows but not overlapping for the best chance of …
  • songs play in sequence and loop back through the list

… within changed swipe_media.html Tabular Single Row Media Gallery helped out by ytaudioonly.js external Javascript helper.


Previous relevant Tabular Single Row Image Gallery Linking Tutorial is shown below.

Tabular Single Row Image Gallery Linking Tutorial

Tabular Single Row Image Gallery Linking Tutorial

After yesterday’s Tabular Single Row YouTube Audio or Video Buttons Tutorial work mainly regarding audio and video media, today we return to those …

  • background WordPress Blog random tutorial images … and link them via a modified 404.php creator’s …
    <?php

    if (strpos(('?' . $_SERVER['QUERY_STRING']), '?rand=') !== false) {
    $huht=@file_get_contents('http://www.rjmprogramming.com.au/HTMLCSS/select_palette.php?putrandom=' . urlencode('?rand=' . $_GET['rand'] . '.' . $pnumis . $ptitle));
    }

    ?>
    … calling on …
  • a modified select_palette.php helper …
    <?php

    if (isset($_GET['putrandom'])) {
    $contis=str_replace(' ','++',str_replace('+',' ',urldecode($_GET['putrandom']))) . "\n";
    $xcurgmt=gmdate("Ymd");
    if (!file_exists($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'media_gallery_swipe_' . $xcurgmt . '.htm')) {
    foreach (glob($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'media_gallery_swipe_' . '*.htm') as $dfilename) {
    unlink($dfilename);
    }
    file_put_contents($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'media_gallery_swipe_' . $xcurgmt . '.htm', $contis);
    } else {
    file_put_contents($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'media_gallery_swipe_' . $xcurgmt . '.htm', file_get_contents($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'media_gallery_swipe_' . $xcurgmt . '.htm') . $contis);
    }
    exit;
    } else if (isset($_GET['getrandom'])) {
    $xcurgmt=gmdate("Ymd");
    $imode=0;
    $contis="";
    $idp="";
    $jdp="";
    $pfix="";
    $sfix="";
    if (file_exists($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'media_gallery_swipe_' . $xcurgmt . '.htm')) {
    $contis=file_get_contents($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'media_gallery_swipe_' . $xcurgmt . '.htm');
    if (strlen($_GET['getrandom']) > 0) {
    $relstuffs=explode(str_replace(' ','++',str_replace('+',' ',strtolower(urldecode($_GET['getrandom'])))) . '.', $contis);
    if (sizeof($relstuffs) > 1) {
    $isub=0;
    $jdp=str_replace('rand=','',str_replace(' ','++',str_replace('+',' ',strtolower(urldecode($_GET['getrandom'])))));
    $imode=1;
    while (substr(substr($relstuffs[-1 + sizeof($relstuffs)],$isub),0,1) >= '0' && substr(substr($relstuffs[-1 + sizeof($relstuffs)],$isub),0,1) <= '9') {
    if ($imode == 0) {
    $jdp.=substr(substr($relstuffs[-1 + sizeof($relstuffs)],$isub),0,1);
    } else {
    $idp.=substr(substr($relstuffs[-1 + sizeof($relstuffs)],$isub),0,1);
    }
    $isub++;
    if (substr(substr($relstuffs[-1 + sizeof($relstuffs)],$isub),0,1) == '.') {
    $imode=1;
    $isub++;
    }
    }
    if (isset($_GET['via'])) {
    $pfix=" if (parent.document.getElementById('" . $_GET['via'] . "')) { parent.document.getElementById('" . $_GET['via'] . "').style.width='100%;'; parent.document.getElementById('" . $_GET['via'] . "').innerHTML+='<iframe style=width:100%;height:800px; src=!!!></iframe>'; } else { ";
    $sfix=" } ";
    }
    if (strtolower(urldecode($_GET['getrandom'])) != urldecode($_GET['getrandom'])) { // Cut to the Chase
    echo "<html><body onload=\"" . str_replace('!!!','/slideshow.html?title=' . explode(" (", explode("\n", explode('=' . $jdp . '.' . $idp, $contis)[1])[0])[0],$pfix) . " parent.window.open('/slideshow.html?title=" . explode(" (", explode("\n", explode('=' . $jdp . '.' . $idp, $contis)[1])[0])[0] . " " . $sfix . " ','_blank','top=200,left=200,width=600,height=600');\"></body></html>";
    exit;
    } else { // WordPress Blog Posting
    echo "<html><body onload=\"" . str_replace('!!!','/ITblog/?p=' . $idp . '#content',$pfix) . " parent.window.open('/ITblog/?p=" . $idp . "#content','_blank','top=200,left=200,width=600,height=600'); " . $sfix . " \"></body></html>";
    exit;
    }
    }
    }
    }
    echo "<html><body><pre>" . $contis . '</pre></body></html>';
    exit;
    }

    ?>
    … called at the parent window by …
  • changed swipe_media.html Tabular Single Row Media Gallery

    function checkmeout(evt, iscuttothechase) {
    if (evt.target.outerHTML.split('>')[0].indexOf('url(') != -1) {
    if (evt.target.outerHTML.split('>')[0].split('url(')[1].split(')')[0].indexOf('?rand=') != -1) {
    if (iscuttothechase) {
    document.getElementById('sparepal').src='/HTMLCSS/select_palette.php?getrandom=' + encodeURIComponent('RAND=' + evt.target.outerHTML.split('>')[0].split('url(')[1].split(')')[0].split('?rand=')[1].split("'")[0].split('"')[0].split(')')[0].split('"')[0]); // + ('&viJUNKa=' + evt.target.id).replace('td','div')
    } else {
    document.getElementById('sparepal').src='/HTMLCSS/select_palette.php?getrandom=' + encodeURIComponent('rand=' + evt.target.outerHTML.split('>')[0].split('url(')[1].split(')')[0].split('?rand=')[1].split("'")[0].split('"')[0].split(')')[0].split('"')[0]); // + ('&viJUNKa=' + evt.target.id).replace('td','div')
    }
    }
    }
    }

… web application, now accepting …

  1. click on one of these WordPress Blog random tutorial images to open window to relevant WordPress Blog posting … or …
  2. right click on one of these WordPress Blog random tutorial images to open window to relevant Cut to the Chase web application or presentation media regarding that blog posting above


Previous relevant Tabular Single Row YouTube Audio or Video Gallery Tutorial is shown below.

Tabular Single Row YouTube Audio or Video Gallery Tutorial

Tabular Single Row YouTube Audio or Video Gallery Tutorial

Today we’ve connected …

… which now have three new functionality options …

  • <–> … link to align the (previously) “Brady Bunch” YouTube iframes into a single row in the same web browser tab
  • <–>A+V … call of yesterday’s Media Gallery web application playing our “inhouse” YouTube iframe video playing web application in a new web browser tab
  • <–>A-V … link to our “inhouse” audio stream only YouTube iframe playing functionality in a new web browser tab

… involving changes to …

  • our changed

    var ytlist='';

    if (('' + document.URL + ('' + location.hash)).indexOf('onerow=') != -1) {
    setTimeout(function(){
    var inis='';
    var iwis=document.getElementById('vplayer1').getBoundingClientRect().width;
    var ifsare=document.getElementsByTagName('iframe');
    for (var jtt=0; jtt<ifsare.length; jtt++) {
    //alert(ifsare[jtt].src);
    if (ifsare[jtt].src.indexOf('/embed/') != -1) {
    if (ytlist == '') {
    ytlist='' + ifsare[jtt].src.split('/embed/')[1].substring(0,11);
    } else {
    ytlist+=',' + ifsare[jtt].src.split('/embed/')[1].substring(0,11);
    }
    }
    ifsare[jtt].style.width='' + iwis + 'px';
    }
    var toho=document.getElementsByTagName('table')[0];
    var tih=toho.innerHTML;
    var newtih=tih;
    //alert(tih);
    var thingos=tih.split('<tr');
    for (var itt=3; itt>=1; itt--) {
    if (itt == 1) {
    inis='<tr' + thingos[itt].split('</tr>')[0] + '</tr>';
    newtih=newtih.replace(inis, inis.replace('</tr>','<!--/tr-->'));
    } else if (itt == 3) {
    inis='<tr' + thingos[itt].split('</tr>')[0] + '</tr>';
    newtih=newtih.replace(inis, inis.replace('<tr>','<!--tr-->'));
    } else {
    inis='<tr' + thingos[itt].split('</tr>')[0] + '</tr>';
    newtih=newtih.replace(inis, inis.replace('<tr>','<!--tr-->').replace('</tr>','<!--/tr-->'));
    }
    }
    toho.innerHTML=newtih;
    toho.style.width='1000%';
    }, 4000);
    }

    setTimeout(function(){
    var antwo='';
    if (ytlist == '') {
    var ifsare=document.getElementsByTagName('iframe');
    for (var jtt=0; jtt<ifsare.length; jtt++) {
    //alert(ifsare[jtt].src);
    if (ifsare[jtt].src.indexOf('/embed/') != -1) {
    if (ytlist == '') {
    ytlist='' + ifsare[jtt].src.split('/embed/')[1].substring(0,11);
    } else {
    ytlist+=',' + ifsare[jtt].src.split('/embed/')[1].substring(0,11);
    }
    }
    }
    }
    if (ytlist != '') {
    antwo+=' <a title="Audio and video plays of YouTube videos" target=_blank href="/HTMLCSS/swipe_media.html?youtube=' + encodeURIComponent(ytlist) + '"><--><sup>A+V</sup></a>';
    antwo+=' <a title="Audio only plays of YouTube videos" target=_blank href="/HTMLCSS/swipe_media.html?audioyoutube=' + encodeURIComponent(ytlist) + '"><--><sub>A-V</sub></a>';
    }
    if (document.URL.indexOf('?') != -1) {
    document.getElementById('wshuffle').innerHTML+=' <a title="Present in one table row" target=_self href="' + document.URL.replace('?', '?onerow=' + Math.floor(Math.random() * 1989786)) + '"><--></a>' + antwo + ' ';
    } else {
    document.getElementById('wshuffle').innerHTML+=' <a title="Present in one table row" target=_self href="' + document.URL + '?onerow=' + Math.floor(Math.random() * 1989786) + '"><--></a>' + antwo + ' ';
    }
    }, 9000);

    youtube_brady_bunch.js being used in our inhouse Disco web application “peer to peer suite” web application “grandparent” level example …
  • “second draft” swipe_media.html Tabular Single Row Image Gallery web application


Previous relevant Tabular Single Row Image Gallery Primer Tutorial is shown below.

Tabular Single Row Image Gallery Primer Tutorial

Tabular Single Row Image Gallery Primer Tutorial

“Tabular Single Row Image Gallery” …

Smabular Single Row Image Gallery

… we’re sure is the reaction of some readers out there, to today’s “starting draft” for an idea we had. Today’s part of the jigsaw we want to explore may be “ho hum” and “so non-mobile”, but we’re hoping the thread appeals to more modern ideas as we go along.

So much for the apologies, and so let’s now look at the basis to this start …

  • media (so far just image) …
  • gallery … presented in …
  • table … HTML element … in …
  • single tr row
  • deliberately overflowing to the right of the screen view of the webpage … and so …
  • scrollable (ie. window scrollable) to … those right hand parts …
  • only “media loaded” …
  • as “scrolled to” or “stumbled upon”

So far the window scrollable detection goes (thanks to this useful link) …


window.onscroll = function (e) {
// called when the window is scrolled.
vspos4=document.body.scrollTop;
vspos3=document.body.scrollLeft;
var vstdn=Math.ceil(eval('' + vspos3) / eval('' + amin));
if (curtdn != vstdn) {
checkthen(vstdn);
}
}

… and the CSS produced “wording (ie. non-media) content” is produced down the bottom left of “inhouse WordPress Blog image cell background” ( possible because of background-size:contain ) we think is interesting …


<style>
td {
border: 1px dotted green;
}

.inhouse {
vertical-align: bottom;
padding-bottom: 20px;
}

.inhouse::after {
content: 'Media Gallery \a RJM Programming \a August, 2025 \a Thanks to Lorem Picsum at https://picsum.photos/ \a ' attr(alt);
white-space: pre-wrap;
}

</style>

… in a “first draft” Tabular Single Row Image Gallery web application for your perusal. Thanks to Lorem Picsum regarding, as so often happens for us, when we’d like beautiful random images to be involved with web applications!

If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.

Posted in eLearning, Event-Driven Programming, Tutorials | Tagged , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , | Leave a comment

YouTube Audio Only Mobile Looping Tutorial

YouTube Audio Only Mobile Looping Tutorial

YouTube Audio Only Mobile Looping Tutorial

Further to the recent External Javascript YouTube Audio of Video Research Tutorial

  • we have made the textarea text stand out more
  • the loop lines up to any looping tick presented
  • we’ve improved the looping logic

… in the changed karaoke_youtube_api.htm inhouse YouTube video interfacer calling the modified and further improved stop_start_youtube.html YouTube API caller.


Previous relevant External Javascript YouTube Audio of Video Research Tutorial is shown below.

External Javascript YouTube Audio of Video Research Tutorial

External Javascript YouTube Audio of Video Research Tutorial

In the same line of thinking as yesterday’s External Javascript YouTube Audio of Video Switch Tutorial we probably have a little more room in that textarea (user interactions menu) for a couple more switch/class hotkey options, in the research line of thinking, we’ll call …

G=Google
W=Wikipedia

… the first having an obvious connection, where the title of a YouTube video is likely to resonate with Google.

But do you ever “go fishing” in Wikipedia? It won’t give up on you even if you are asking for strange information, that is, suggesting other avenues to research using “words, basically”.

And so, like with yesterday (and it’s work augmented a bit), we’ve got to say the Javascript function playingvideo‘s switch and case based logic stuck out because the coding involves words that relate to functionality far better than an if code structure. And so all we needed to do for our change, between the Javascript’s switch and first case was add …


case 'Y':
if (document.URL.indexOf('start=') != -1 && document.URL.indexOf('start=0') == -1) {
window.open('//www.youtube.com/watch?v=' + vid + '&t=' + document.URL.split('start=')[1].split('&')[0].split('#')[0] + 's', '_blank', 'top=100,left=100,width=600,height=600');
} else {

window.open('//www.youtube.com/watch?v=' + vid, '_blank', 'top=100,left=100,width=600,height=600');
}
parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).value='';
break;

case 'G':
window.open('//www.google.com/search?q=' + encodeURIComponent(parent.document.getElementsByTagName('h1')[0].innerHTML), '_blank', 'top=110,left=110,width=600,height=600');
parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).value='';
break;


case 'W':
window.open('//wikipedia.org/wiki/' + encodeURIComponent(parent.document.getElementsByTagName('h1')[0].innerHTML), '_blank', 'top=120,left=120,width=600,height=600');
parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).value='';
break;


… still only involving changes to the modified stop_start_youtube.html YouTube API caller to make happen.


Previous relevant External Javascript YouTube Audio of Video Switch Tutorial is shown below.

External Javascript YouTube Audio of Video Switch Tutorial

External Javascript YouTube Audio of Video Switch Tutorial

If we say …

  1. switch … and then …
  2. case

… related to Javascript coding, what’s the reaction around here? Well, we’d say …

One of the most relatable and easily revisited modus operandi, within Javascript, to pick up where you left off or add more

Doesn’t exactly “roll off the tongue”, but we’ll leave that for you should you read this blog posting, and agree?!

In a similar line of thinking as External Javascript YouTube Audio of Video Snippet Tutorial, what did we want to achieve with today’s modification to YouTube Audio of Video Stream Play Only web application, is, once the user is into the YouTube play and you get to that textarea menu that works like a hotkey (and we can thank that for what must have been clear and relatable thinking that day) is to add a Y hotkey possibility to open a popup window back to a YouTube based play of the video concerned.

We’ve got to say the Javascript function playingvideo‘s switch and case based logic stuck out because the coding involves words that relate to functionality far better than an if code structure. And so all we needed to do for our change, between the Javascript’s switch and first case was add …


case 'Y':
window.open('//www.youtube.com/watch?v=' + vid, '_blank', 'top=100,left=100,width=600,height=600');
parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).value='';
break;


… and only involving changes to the modified stop_start_youtube.html YouTube API caller to make happen.


Previous relevant External Javascript YouTube Audio of Video Snippet Tutorial is shown below.

External Javascript YouTube Audio of Video Snippet Tutorial

External Javascript YouTube Audio of Video Snippet Tutorial

Given the current Play Audio Stream of Selected YouTube Video In Place functionality talked about, last, at External Javascript YouTube Audio of Video Numericals Tutorial occurs “in place” there’s a good chance what the user may want to describe is either …

  • audio starting at a given timed position …
  • audio starting at a given timed position and ending at another timed position … ie. an audio snippet

. Well, today, we’re allowing for either possibility above to value add to our work.

So, YouTube URLs are already possible in the first of the modes above, such as the URL …


https://www.youtube.com/watch?v=cLsgc8S33dE&t=21m25s

… and we augment that possibility by stopping the videoaudio starting at that same starting point but making use of hashtag thinking to add …


https://www.youtube.com/watch?v=cLsgc8S33dE&t=21m25s#d=5

… used by this link or …


https://www.youtube.com/watch?v=cLsgc8S33dE&t=21m25s#e=21m30s

… means …


altend='22223';
spos='0';
if (('' + audioonlyas[iuhg].href).split('>')[0].split('youtube.com/watch?v=')[1].replace('#t','&t').indexOf('&t=') != -1) { // &t=2m37s
sposspare=('' + audioonlyas[iuhg].href).split('>')[0].split('youtube.com/watch?v=')[1].replace('#t','&t').split('&t=')[1].split('&')[0].split('#')[0].split('"')[0].split("'")[0].split('>')[0];
if (sposspare.indexOf(':') != -1) {
for (idel=eval(-1 + sposspare.split(':').length); idel>=0; idel--) {
spos='' + eval(eval('' + spos) + eval(deltv[idel] * eval('' + sposspare.split(':')[idel] )));
}
} else {
//alert(sposspare);
for (idel=3; idel>=0; idel--) {
if (sposspare.indexOf(delts[idel]) != -1) {
spos='' + eval(eval('' + spos) + eval(deltv[idel] * eval('' + sposspare.split(delts[idel])[0].slice(-3).replace(delts[0],'').replace(delts[1],'').replace(delts[2],'').replace(delts[3],'') )));
} else if (idel == 3 && sposspare.indexOf(delts[2]) == -1 && sposspare.indexOf(delts[1]) == -1 && sposspare.indexOf(delts[0]) == -1) {
spos='' + sposspare;
}
}
}
}
if (('' + audioonlyas[iuhg].href).split('>')[0].split('youtube.com/watch?v=')[1].indexOf('#e=') != -1) { // &t=2m37s
sposspare=('' + audioonlyas[iuhg].href).split('>')[0].split('youtube.com/watch?v=')[1].split('#e=')[1].split('&')[0].split('#')[0].split('"')[0].split("'")[0].split('>')[0];
if (sposspare.indexOf(':') != -1) {
altend='0.000';
for (idel=eval(-1 + sposspare.split(':').length); idel>=0; idel--) {
altend='' + eval(eval('' + altend) + eval(deltv[idel] * eval('' + sposspare.split(':')[idel] )));
}
} else {
altend='0.000';
for (idel=3; idel>=0; idel--) {
if (sposspare.indexOf(delts[idel]) != -1) {
altend='' + eval(eval('' + altend) + eval(deltv[idel] * eval('' + sposspare.split(delts[idel])[0].slice(-3).replace(delts[0],'').replace(delts[1],'').replace(delts[2],'').replace(delts[3],'') )));
} else if (idel == 3 && sposspare.indexOf(delts[2]) == -1 && sposspare.indexOf(delts[1]) == -1 && sposspare.indexOf(delts[0]) == -1) {
altend='' + eval(eval('' + altend) + eval('' + sposspare));
}
}
}
}
if (('' + audioonlyas[iuhg].href).split('>')[0].split('youtube.com/watch?v=')[1].indexOf('#d') != -1) { // &t=2m37s
if (('' + audioonlyas[iuhg].href).split('>')[0].split('youtube.com/watch?v=')[1].split('#d')[1].indexOf('=') != -1) { // &t=2m37s
sposspare=('' + audioonlyas[iuhg].outerHTML).split('>')[0].split('youtube.com/watch?v=')[1].split('#d')[1].split('=')[1].split('&')[0].split('#')[0].split('"')[0].split("'")[0].split('>')[0];
if (sposspare.indexOf(':') != -1) {
altend=spos.split('.')[0] + '.000';
for (idel=eval(-1 + sposspare.split(':').length); idel>=0; idel--) {
altend='' + eval(eval('' + altend) + eval(deltv[idel] * eval('' + sposspare.split(':')[idel] )));
}
} else {
altend=spos.split('.')[0] + '.000';
for (idel=3; idel>=0; idel--) {
if (sposspare.indexOf(delts[idel]) != -1) {
altend='' + eval(eval('' + altend) + eval(deltv[idel] * eval('' + sposspare.split(delts[idel])[0].slice(-3).replace(delts[0],'').replace(delts[1],'').replace(delts[2],'').replace(delts[3],'') )));
} else if (idel == 3 && sposspare.indexOf(delts[2]) == -1 && sposspare.indexOf(delts[1]) == -1 && sposspare.indexOf(delts[0]) == -1) {
altend='' + eval(eval('' + altend) + eval('' + sposspare));
}
}
}
}
//alert('spos=' + spos + ' and altend=' + altend);
}

… by which you can define a 5 second snippet of YouTube cLsgc8S33dE audio stream (of video) starting at 21m 25s be played, perhaps looping, in our changed external Javascript ytaudioonly.js external Javascript supports the changed karaoke_youtube_api.htm inhouse YouTube video interfacer calling the modified stop_start_youtube.html YouTube API caller in our quest to play YouTube audio “in place” in useful ways via …


<script type='text/javascript' src='//www.rjmprogramming.com.au/ytaudioonly.js'></script>

… within the head section of a webpage massaging how a link such as


<a target="_blank" class="audioytplay" title="https://www.youtube.com/watch?v=cLsgc8S33dE" href="https://www.youtube.com/watch?v=cLsgc8S33dE&t=21m25s#d=5" rel="noopener">this link</a>

… behaves.


Previous relevant External Javascript YouTube Audio of Video Numericals Tutorial is shown below.

External Javascript YouTube Audio of Video Numericals Tutorial

External Javascript YouTube Audio of Video Numericals Tutorial

Regarding yesterday’s External Javascript YouTube Audio of Video Fallback Tutorial 📻🎶 (&#128251;&#127926;) emoji (non-mobile showing) title attribute now goes something like …

Right click opens in new window the video and audio but normal click just plays audio in place. Numerical only entry in textarea seeks that audio timing position. Numerical space search text does YouTube search of search text to create the numerical number of audio only YouTube video links. Eg. 7 octopus anatomy

… and the purple functionality has been going two days now, because we found it convenient debugging the fallback logic, while the blue is today’s new functionality which opens the door to a user creating their own dynamically created audio stream part of YouTube video playing links presented close to yesterday’s textarea element information … perhaps three doors down from MacArthur Park?

This new hierarchical layer had us questioning, again, our “grandchild” logic penchant of referring to the layer containing these link references like …


top.document.getElementById('ajaxxx_myajaxxx').placeholder

… when, now, it could be the case, sandwiched between, can be this new hierarchical layer. And so, the awkward feeling …


parent.parent.document.getElementById('ajaxxx_myajaxxx').placeholder

… is the better and more precise way a “grandchild” can refer to a “grandparent” exclusively. Of course, in hindsight, on a project, these hierarchy possibilities would probably be mapped out for every eventuality, and the penchant for a programmer to willy-nilly use top.document everywhere, could be put under the microscope. But, please don’t declare war on all top.document reference thinking … for instance, to share data among many such layers of web application functionality, it can be effectively shared in …


top.document.title

… as just one example of effective top.document referencing. There is also the issue that parent.parent.document type references can make someone maintaining the code later suspect the codeline as a bug (and maybe a codeline comment could help).

The new Javascript function needed for this goes …


function ytsearch(intysidea) {
var afternums='', isanum=true, beforenums='', wasph='';
for (var ihj=0; ihj<intysidea.length; ihj++) {
if (isanum) {
if (intysidea.substring(ihj).substring(0,1) < '0' || intysidea.substring(ihj).substring(0,1) > '9') {
isanum=false;
if (intysidea.substring(ihj).substring(0,1) != ' ') {
afternums+=intysidea.substring(ihj).substring(0,1);
}
} else {
beforenums+=intysidea.substring(ihj).substring(0,1);
}
} else {
afternums+=intysidea.substring(ihj).substring(0,1);
}
}
parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).value='';
if (afternums.trim() != '') {
if (parent.parent.document.getElementById('yts' + location.hash.replace(/\#/g,'').substring(3).split('_')[0])) {
wasph=parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).placeholder;
parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).placeholder='';
parent.parent.document.getElementById('yts' + location.hash.replace(/\#/g,'').substring(3).split('_')[0]).src='//www.rjmprogramming.com.au/HTMLCSS/karaoke_youtube_api.htm?youtubeid=++++++++++++' + encodeURIComponent(afternums) + '&audioonlys=' + (beforenums.trim() == '' ? '5' : beforenums) + '&paridis=' + ouraidis + '&wasph=' + encodeURIComponent(wasph) + '#tonlyaudios';
parent.parent.document.getElementById('' + location.hash.replace(/\#/g,'').substring(3).split('_')[0]).scrollIntoView();
} else if (top.document.getElementById('ldi' + location.hash.replace(/\#/g,'').substring(3).split('_')[0])) {
wasph=parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).placeholder;
parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).placeholder='';
parent.parent.document.getElementById('ldi' + location.hash.replace(/\#/g,'').substring(3).split('_')[0]).innerHTML+='<iframe style=height:250px; id="yts' + + ouraidis + '" src="' + '//www.rjmprogramming.com.au/HTMLCSS/karaoke_youtube_api.htm?youtubeid=++++++++++++' + encodeURIComponent(afternums) + '&audioonlys=' + (beforenums.trim() == '' ? '5' : beforenums) + '&paridis=' + ouraidis + '&wasph=' + encodeURIComponent(wasph) + '#tonlyaudios"></iframe>';
parent.parent.document.getElementById('' + location.hash.replace(/\#/g,'').substring(3).split('_')[0]).scrollIntoView();
parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).placeholder=wasph;
} else {
wasph=parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).placeholder;
parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).placeholder='';
parent.parent.document.getElementById('' + location.hash.replace(/\#/g,'').substring(3).split('_')[0]).innerHTML+='<iframe style=height:250px; id="yts' + + ouraidis + '" src="' + '//www.rjmprogramming.com.au/HTMLCSS/karaoke_youtube_api.htm?youtubeid=++++++++++++' + encodeURIComponent(afternums) + '&audioonlys=' + (beforenums.trim() == '' ? '5' : beforenums) + '&paridis=' + ouraidis + '&wasph=' + encodeURIComponent(wasph) + '#tonlyaudios"></iframe>';
parent.parent.document.getElementById('' + location.hash.replace(/\#/g,'').substring(3).split('_')[0]).scrollIntoView();
parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).placeholder=wasph;
}
}
}

… and connected to that non-onblur event approach …


function playingvideo() {
inplaying=true;
if (thatisit) { inplaying=false; return ''; }
psuf='';
if (startagain) {
if (1 == 6 && navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
psuf=' via button reclick ' + String.fromCodePoint(10004);
} else {
psuf=' ' + String.fromCodePoint(10004);
}
}
if (('' + location.hash).replace(/^undefined/g,'').replace(/^null/g,'').replace(/\#/g,'') != '') {
if (eval('' + duration) == 0 && Math.round(player.getCurrentTime()) < 1) {
if (one == 1 || onepause != 1) {
if (1 == 4) { player.pauseVideo(); }
} else {
player.playVideo();
}
if (!inplaying) { inplaying=true; setTimeout(playingvideo, 1000); }
} else {
if (parent.parent.document.getElementById(location.hash.replace(/\#/g,''))) {
if (('' + parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).getAttribute('data-val')).replace(/^undefined/g,'').replace(/^null/g,'') != '') {
parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).value= parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).getAttribute('data-val');
parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).setAttribute('data-val','');
}
switch (('' + parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).value.toUpperCase() + ' ').substring(0,1)) {
case 'L':
if (numericalssamecount <= 0) {
startagain=true;
if (('' + window.sessionStorage.getItem('loop_' + vid.split(',')[0])).replace(/^undefined/g,'').replace(/^null/g,'').trim() == '') {
setInterval(retry, 5000);
} else {
window.sessionStorage.removeItem('loop_' + vid);
}
window.sessionStorage.setItem('loop_' + vid, 'y');
psuf='';
if (startagain) {
psuf=' ' + String.fromCodePoint(10004);
}
dostumps=false;
parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).value='';
} else {
numericalssamecount++;
}
break;

case 'S':
if (numericalssamecount <= 0) {
startagain=false;
psuf='';
if (startagain) {
psuf=' ' + String.fromCodePoint(10004);
}
dostumps=true;
player.stopVideo();
parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).value='';
try {
window.sessionStorage.removeItem('loop_' + vid);
} catch(hdgf) { }
} else {
numericalssamecount++;
}
break;

case 'P':
if (numericalssamecount <= 0) {
if (one == 1 || onepause != 1) {
player.pauseVideo();
} else {
player.playVideo();
}
parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).value='';
} else {
numericalssamecount++;
}
break;

case 'M':
if (numericalssamecount <= 0) {
player.mute();
parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).removeAttribute('data-mute');
parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).setAttribute('data-mute', 'y');
mletter='M';
uletter='u';
parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).value='';
} else {
numericalssamecount++;
}
break;

case 'U':
if (numericalssamecount <= 0) {
player.unMute();
parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).removeAttribute('data-mute');
parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).setAttribute('data-mute', '');
mletter='m';
uletter='U';
parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).value='';
} else {
numericalssamecount++;
}
break;

case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':

if (2 == 2 || !navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
if (numericals == '') {
numericalssamecount=1;
numericals=parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).value;
setTimeout(sanitycheck, 12000);
} else if (parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).value == numericals) {
numericalssamecount++;
if (numericalssamecount >= 10) {
if (numericals.replace(/0/g,'').replace(/1/g,'').replace(/2/g,'').replace(/3/g,'').replace(/4/g,'').replace(/5/g,'').replace(/6/g,'').replace(/7/g,'').replace(/8/g,'').replace(/9/g,'').trim() == '') {
if (eval(numericals) >= 0 && eval(numericals) <= eval('' + duration)) {
player.seekTo(eval(numericals.trim()));
}
parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).value='';
numericals='';
numericalssamecount=0;
//top.document.title='ZerO';
} else {
ytsearch(parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).value);
numericals='';
numericalssamecount=0;
//top.document.title='ZeRO';
}

}
} else {
numericalssamecount=1;
numericals=parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).value;
setTimeout(sanitycheck, 12000);
}
}
break;

default:
if (numericalssamecount > 0) {
numericalssamecount++;
}
break;
}
if (parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).placeholder.replace('/p','').indexOf('/') != -1) {
if (startagain && eval(2.2 + Math.round(player.getCurrentTime())) > Math.floor(eval('' + duration)) && eval('' + duration) > 0) {
thatisit=true;
lastokn=0;
//alert(4);
if (('' + window.sessionStorage.getItem('loop_' + vid.split(',')[0])).replace(/^undefined/g,'').replace(/^null/g,'').trim() != '') {
//alert(44);
window.sessionStorage.removeItem('loop_' + vid.split(',')[0]);
}
window.sessionStorage.setItem('loop_' + vid.split(',')[0], 'y');
//alert(444);
secscnt=eval(0.001 + duration);
if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).setAttribute('data-loop','y');
setTimeout(function(){
if (1 == 11) {
setTimeout(startVideo, playtime + delay);
thatisit=false; setTimeout(playingvideo, 1900);
} else {
var huhc=false;
// huhc=confirm('Okay to loop?');
if (huhc && 1 == 7) {
player.seekTo(0.01);
secscnt=0.01;
oursecscnt=0.01;
player.playVideo();
thatisit=false; setTimeout(playingvideo, 1900);
} else if (9 == 5) {
window.parent.focus();
parent.location.href=parent.document.URL.split('&random=')[0] + '&random=' + Math.floor(Math.random() * 1987865) + '&startagain=y' + ('' + location.hash).replace(/^undefined/g,'').replace(/^null/g,'').replace(/^\#$/g,'');
window.parent.scrollTo(0,0);
} else {
player.seekTo(1);
thatisit=false; setTimeout(playingvideo, 3000);
setTimeout(retry, 5000);
//alert(4444);
}
} }, 1500);
inplaying=false;
return '';
} else {
parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).setAttribute('data-loop','y');
setTimeout(function(){ window.top.focus(); parent.parent.document.getElementById(location.hash.replace(/\#/g,'').substring(3).split('_')[0]).click(); }, 1500);
inplaying=false;
return '';
}
}
if (one == 1 || onepause != 1) {
if (eval('' + duration) == 0) { duration=player.getDuration(); }
parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).placeholder='' + Math.round(player.getCurrentTime()) + '/' + duration + ' ... ' + 'P=pause/play S=stop M=' + mletter + 'ute U=' + uletter + 'nmute L=loop' + psuf;
} else {
if (eval('' + duration) == 0) { duration=player.getDuration(); }
parent.parent.document.getElementById(location.hash.replace(/\#/g,'')).placeholder='' + Math.round(player.getCurrentTime()) + '/' + duration + ' ... ' + 'P=play/pause S=stop M=' + mletter + 'ute U=' + uletter + 'nmute L=loop' + psuf;
setTimeout(addablank, 3000);
}
setTimeout(playingvideo, 1000);
}
}
}
}
}

… in our changed external Javascript ytaudioonly.js external Javascript supports the changed karaoke_youtube_api.htm inhouse YouTube video interfacer calling the modified stop_start_youtube.html YouTube API caller in our quest to play YouTube audio “in place” in a useful way.


Previous relevant External Javascript YouTube Audio of Video Fallback Tutorial is shown below.

External Javascript YouTube Audio of Video Fallback Tutorial

External Javascript YouTube Audio of Video Fallback Tutorial

Further to yesterday’s External Javascript YouTube Audio of Video Looping Tutorial work regarding the Play Audio Stream of Selected YouTube Video In Place functionality we’re currently working on …

  • the timing of getting some mobile platform looping going is fortunate … and it means, with far less complication, we can organize …
  • the “red button” (mobile) or “link” (non-mobile) can serve as a fallback option when the user is in looping mode of YouTube Audio Stream Part of Video play and there is an interruption to that playing

… because there are a million and one reasons your YouTube video can get interrupted, such as …

  • window focus leaves the window of the playing YouTube video
  • seems like some mobile time limit is going on too
  • dormancy to sleep screen
  • focus regarding the textarea elements, we suspect

… etcetera etcetera etcetera … and there will could be good reasons the operating system behaves the way it does (as well as, as far as it goes here, we’ve been known to have “bad hair days”, even “very little hair days”).

But with a fallback option there, to re-click that originating “red button” (mobile) or “link” (non-mobile) is the chance to continue on with looping, so far not always back where you were, but who knows what the future brings?!

Also, organization wise, what has made all this easier, was to


function playingvideo() {
psuf='';
if (startagain) {
if (1 == 6 && navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
psuf=' via button reclick ' + String.fromCodePoint(10004);
} else {
psuf=' ' + String.fromCodePoint(10004);
}
}
if (('' + location.hash).replace(/^undefined/g,'').replace(/^null/g,'').replace(/\#/g,'') != '') {
if (eval('' + duration) == 0 && Math.round(player.getCurrentTime()) < 1) {
if (one == 1 || onepause != 1) {
if (1 == 4) { player.pauseVideo(); }
} else {
player.playVideo();
}
setTimeout(playingvideo, 1000);
} else {
if (top.document.getElementById(location.hash.replace(/\#/g,''))) {
if (('' + top.document.getElementById(location.hash.replace(/\#/g,'')).getAttribute('data-val')).replace(/^undefined/g,'').replace(/^null/g,'') != '') {
top.document.getElementById(location.hash.replace(/\#/g,'')).value= top.document.getElementById(location.hash.replace(/\#/g,'')).getAttribute('data-val');
top.document.getElementById(location.hash.replace(/\#/g,'')).setAttribute('data-val','');
}
switch (('' + top.document.getElementById(location.hash.replace(/\#/g,'')).value.toUpperCase() + ' ').substring(0,1)) {
case 'L':
if (numericalssamecount <= 0) {
startagain=true;
if (('' + window.sessionStorage.getItem('loop_' + vid.split(',')[0])).replace(/^undefined/g,'').replace(/^null/g,'').trim() == '') {
setInterval(retry, 5000);
} else {
window.sessionStorage.removeItem('loop_' + vid, 'y');
}
window.sessionStorage.setItem('loop_' + vid, 'y');
psuf='';
if (startagain) {
psuf=' ' + String.fromCodePoint(10004);
}
dostumps=false;
top.document.getElementById(location.hash.replace(/\#/g,'')).value='';
} else {
numericalssamecount++;
}
break;

case 'S':
if (numericalssamecount <= 0) {
startagain=false;
psuf='';
if (startagain) {
psuf=' ' + String.fromCodePoint(10004);
}
dostumps=true;
player.stopVideo();
top.document.getElementById(location.hash.replace(/\#/g,'')).value='';
try {
window.sessionStorage.removeItem('loop_' + vid);
} catch(hdgf) { }
} else {
numericalssamecount++;
}
break;

case 'P':
if (numericalssamecount <= 0) {
if (one == 1 || onepause != 1) {
player.pauseVideo();
} else {
player.playVideo();
}
top.document.getElementById(location.hash.replace(/\#/g,'')).value='';
} else {
numericalssamecount++;
}
break;

case 'M':
if (numericalssamecount <= 0) {
player.mute();
mletter='M';
uletter='u';
top.document.getElementById(location.hash.replace(/\#/g,'')).value='';
} else {
numericalssamecount++;
}
break;

case 'U':
if (numericalssamecount <= 0) {
player.unMute();
mletter='m';
uletter='U';
top.document.getElementById(location.hash.replace(/\#/g,'')).value='';
} else {
numericalssamecount++;
}
break;

case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
if (2 == 2 || !navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
if (numericals == '') {
numericalssamecount=1;
numericals=top.document.getElementById(location.hash.replace(/\#/g,'')).value;
setTimeout(sanitycheck, 12000);
} else if (top.document.getElementById(location.hash.replace(/\#/g,'')).value == numericals) {
numericalssamecount++;
if (numericalssamecount >= 10) {
if (numericals.replace(/0/g,'').replace(/1/g,'').replace(/2/g,'').replace(/3/g,'').replace(/4/g,'').replace(/5/g,'').replace(/6/g,'').replace(/7/g,'').replace(/8/g,'').replace(/9/g,'').trim() == '') {
if (eval(numericals) >= 0 && eval(numericals) <= eval('' + duration)) {
player.seekTo(eval(numericals.trim()));
}
top.document.getElementById(location.hash.replace(/\#/g,'')).value='';
numericals='';
numericalssamecount=0;
}
}
} else {
numericalssamecount=1;
numericals=top.document.getElementById(location.hash.replace(/\#/g,'')).value;
setTimeout(sanitycheck, 12000);
}
}
break;

default:
if (numericalssamecount > 0) {
numericalssamecount++;
}
break;
}
if (top.document.getElementById(location.hash.replace(/\#/g,'')).placeholder.indexOf('/') != -1) {
if (startagain && eval(2 + Math.round(player.getCurrentTime())) > eval('' + duration) && eval('' + duration) > 0) {
secscnt=eval(0.001 + duration);
if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
top.document.getElementById(location.hash.replace(/\#/g,'')).setAttribute('data-loop','y');
setTimeout(function(){
if (1 == 11) {
setTimeout(startVideo, playtime + delay);
setTimeout(playingvideo, 1900);
} else {
var huhc=false;
// huhc=confirm('Okay to loop?');
if (huhc && 1 == 7) {
player.seekTo(0.01);
secscnt=0.01;
oursecscnt=0.01;
player.playVideo();
setTimeout(playingvideo, 1900);
} else if (9 == 5) {
window.parent.focus();
parent.location.href=parent.document.URL.split('&random=')[0] + '&random=' + Math.floor(Math.random() * 1987865) + '&startagain=y' + ('' + location.hash).replace(/^undefined/g,'').replace(/^null/g,'').replace(/^\#$/g,'');
window.parent.scrollTo(0,0);
} else {
player.seekTo(1);
setTimeout(playingvideo, 3000);
setTimeout(retry, 5000);
}
} }, 1500);
return '';
} else {
top.document.getElementById(location.hash.replace(/\#/g,'')).setAttribute('data-loop','y');
setTimeout(function(){ window.top.focus(); top.document.getElementById(location.hash.replace(/\#/g,'').substring(3).split('_')[0]).click(); }, 1500);
return '';
}
}
if (one == 1 || onepause != 1) {
if (eval('' + duration) == 0) { duration=player.getDuration(); }
top.document.getElementById(location.hash.replace(/\#/g,'')).placeholder='' + Math.round(player.getCurrentTime()) + '/' + duration + ' ... ' + 'P=pause/play S=stop M=' + mletter + 'ute U=' + uletter + 'nmute L=loop' + psuf;
} else {
if (eval('' + duration) == 0) { duration=player.getDuration(); }
top.document.getElementById(location.hash.replace(/\#/g,'')).placeholder='' + Math.round(player.getCurrentTime()) + '/' + duration + ' ... ' + 'P=play/pause S=stop M=' + mletter + 'ute U=' + uletter + 'nmute L=loop' + psuf;
setTimeout(addablank, 3000);
}
setTimeout(playingvideo, 1000);
}
}
}
}
}

… start using the web browser’s session storage smarts as an overseeing data source we can better rely on. With this in place it was so much more robust to work out when to invoke our fallback thinking new Javascript function …


function retry() {
if (top.document.getElementById(location.hash.replace(/\#/g,''))) {
if (('' + top.document.getElementById(location.hash.replace(/\#/g,'')).placeholder).indexOf('0/0 ...') == 0) {
if (top.document.getElementById(location.hash.replace(/\#/g,'')).placeholder.indexOf(' to continue looping') == -1) {
if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
top.document.getElementById(location.hash.replace(/\#/g,'')).placeholder+=' try click of red button to continue looping';
} else {
top.document.getElementById(location.hash.replace(/\#/g,'')).placeholder+=' try click of link to continue looping';
}
window.parent.focus();
parent.location.href=parent.document.URL.split('&random=')[0] + '&random=' + Math.floor(Math.random() * 1987865) + '&startagain=y' + ('' + location.hash).replace(/^undefined/g,'').replace(/^null/g,'').replace(/^\#$/g,'');
window.parent.scrollTo(0,0);
}
} else if (('' + top.document.getElementById(location.hash.replace(/\#/g,'')).placeholder).indexOf('P=pause/play') != -1) {
if (prevretry == '') {
prevretry=top.document.getElementById(location.hash.replace(/\#/g,'')).placeholder;
} else if (prevretry == top.document.getElementById(location.hash.replace(/\#/g,'')).placeholder) {
if (top.document.getElementById(location.hash.replace(/\#/g,'')).placeholder.indexOf(' to continue looping') == -1) {
if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
top.document.getElementById(location.hash.replace(/\#/g,'')).placeholder+=' ... try click of red button to continue looping';
} else {
top.document.getElementById(location.hash.replace(/\#/g,'')).placeholder+=' ... try click of link to continue looping';
}
}
} else {
prevretry=top.document.getElementById(location.hash.replace(/\#/g,'')).placeholder;
}
} else if (('' + top.document.getElementById(location.hash.replace(/\#/g,'')).placeholder).indexOf('P=play/pause') != -1) {
if (prevretry == '') {
prevretry=top.document.getElementById(location.hash.replace(/\#/g,'')).placeholder;
} else if (prevretry == top.document.getElementById(location.hash.replace(/\#/g,'')).placeholder) {
if (top.document.getElementById(location.hash.replace(/\#/g,'')).placeholder.indexOf(' to continue looping') == -1) {
if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
top.document.getElementById(location.hash.replace(/\#/g,'')).placeholder+=' ... try click of red button to continue looping';
} else {
top.document.getElementById(location.hash.replace(/\#/g,'')).placeholder+=' ... try click of link to continue looping';
}
}
} else {
prevretry=top.document.getElementById(location.hash.replace(/\#/g,'')).placeholder;
}
}
}
}

… for our so far in the day unchanged external Javascript ytaudioonly.js external Javascript supports the changed karaoke_youtube_api.htm inhouse YouTube video interfacer calling the modified stop_start_youtube.html YouTube API caller in our quest to play YouTube audio “in place” in a useful way.


Previous relevant External Javascript YouTube Audio of Video Looping Tutorial is shown below.

External Javascript YouTube Audio of Video Looping Tutorial

External Javascript YouTube Audio of Video Looping Tutorial

Of yesterday’s External Javascript YouTube Audio of Video Emoji Tutorial

  1. pause
  2. play
  3. loop
  4. stop
  5. progress perhapsyes

… list of suggested “controls” for our Play Audio Stream of Selected YouTube Video In Place functionality, am sure of most interest was the loop one. Well, it certainly was for us, anyway.

We weren’t sure whether we could get around the actual tap needed on mobile platforms to just apply …


player.seekTo(0);
player.playVideo();

… as we near the end of the video. Alas, no, we need the red button (ie. the transparent YouTube video) to be retapped to get anywhere … so sad.

But non-mobile platform usages can loop effectively, and might help out users, who, like me, occasionally get obsessed with a YouTube music video (such as Morricone – Gabriel’s Oboe from The Mission, Maja Łagowska – oboe, conducted by Andrzej Kucybała) … hence the radio and musical note emojis 📻🎶 (&#128251;&#127926;) we started using yesterday.

Another plan we had to ask for menu operations via a window.prompt a lot of users will be relieved to hear, didn’t work either, and so we had to redesign, finally settling on HTML textarea elements whereby …

  • information and instructions are placed in its placeholder attribute … and …
  • like a hotkey (but not needing onkeydown or onkeyup or onkeypress event logic intervention) user audio control instructions are unique regarding first character, so way down at the grandchild level we have …

    function playingvideo() {
    psuf='';
    if (startagain) {
    if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
    psuf=' via button reclick ' + String.fromCodePoint(10004);
    } else {
    psuf=' ' + String.fromCodePoint(10004);
    }
    }
    if (('' + location.hash).replace(/^undefined/g,'').replace(/^null/g,'').replace(/\#/g,'') != '') {
    if (eval('' + duration) == 0 && Math.round(player.getCurrentTime()) < 1) {
    if (one == 1 || onepause != 1) {
    if (1 == 4) { player.pauseVideo(); }
    } else {
    player.playVideo();
    }
    setTimeout(playingvideo, 1000);
    } else {
    if (top.document.getElementById(location.hash.replace(/\#/g,''))) {
    if (('' + top.document.getElementById(location.hash.replace(/\#/g,'')).getAttribute('data-val')).replace(/^undefined/g,'').replace(/^null/g,'') != '') {
    top.document.getElementById(location.hash.replace(/\#/g,'')).value= top.document.getElementById(location.hash.replace(/\#/g,'')).getAttribute('data-val');
    top.document.getElementById(location.hash.replace(/\#/g,'')).setAttribute('data-val','');
    }
    switch (('' + top.document.getElementById(location.hash.replace(/\#/g,'')).value.toUpperCase() + ' ').substring(0,1)) {
    case 'L':
    startagain=true;
    psuf='';
    if (startagain) {
    psuf=' ' + String.fromCodePoint(10004);
    }
    dostumps=false;
    top.document.getElementById(location.hash.replace(/\#/g,'')).value='';
    break;

    case 'S':
    startagain=false;
    psuf='';
    if (startagain) {
    psuf=' ' + String.fromCodePoint(10004);
    }
    dostumps=true;
    player.stopVideo();
    top.document.getElementById(location.hash.replace(/\#/g,'')).value='';
    break;

    case 'P':
    if (one == 1 || onepause != 1) {
    player.pauseVideo();
    } else {
    player.playVideo();
    }
    top.document.getElementById(location.hash.replace(/\#/g,'')).value='';
    break;

    case 'M':
    player.mute();
    mletter='M';
    uletter='u';
    top.document.getElementById(location.hash.replace(/\#/g,'')).value='';
    break;

    case 'U':
    player.unMute();
    mletter='m';
    uletter='U';
    top.document.getElementById(location.hash.replace(/\#/g,'')).value='';
    break;


    default:
    break;
    }

    if (top.document.getElementById(location.hash.replace(/\#/g,'')).placeholder.indexOf('/') != -1) {
    if (startagain && eval(2 + Math.round(player.getCurrentTime())) > eval('' + duration) && eval('' + duration) > 0) {
    secscnt=eval(0.001 + duration);
    if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
    top.document.getElementById(location.hash.replace(/\#/g,'')).setAttribute('data-loop','y');
    setTimeout(function(){
    if (1 == 11) {
    setTimeout(startVideo, playtime + delay);
    setTimeout(playingvideo, 1900);
    } else {
    var huhc=false;
    // huhc=confirm('Okay to loop?');
    if (huhc && 1 == 7) {
    player.seekTo(0.01);
    secscnt=0.01;
    oursecscnt=0.01;
    player.playVideo();
    setTimeout(playingvideo, 1900);
    } else {
    window.parent.focus();
    parent.location.href=parent.document.URL.split('&random=')[0] + '&random=' + Math.floor(Math.random() * 1987865) + '&startagain=y' + ('' + location.hash).replace(/^undefined/g,'').replace(/^null/g,'').replace(/^\#$/g,'');
    }
    } }, 1500);
    return '';
    } else {
    top.document.getElementById(location.hash.replace(/\#/g,'')).setAttribute('data-loop','y');
    setTimeout(function(){ window.top.focus(); top.document.getElementById(location.hash.replace(/\#/g,'').substring(3).split('_')[0]).click(); }, 1500);
    return '';
    }
    }
    if (one == 1 || onepause != 1) {
    if (eval('' + duration) == 0) { duration=player.getDuration(); }
    top.document.getElementById(location.hash.replace(/\#/g,'')).placeholder='' + Math.round(player.getCurrentTime()) + '/' + duration + ' ... ' + 'P=pause/play S=stop M=' + mletter + 'ute U=' + uletter + 'nmute L=loop' + psuf;
    } else {
    if (eval('' + duration) == 0) { duration=player.getDuration(); }
    top.document.getElementById(location.hash.replace(/\#/g,'')).placeholder='' + Math.round(player.getCurrentTime()) + '/' + duration + ' ... ' + 'P=play/pause S=stop M=' + mletter + 'ute U=' + uletter + 'nmute L=loop' + psuf;
    }
    setTimeout(playingvideo, 1000);
    }
    }
    }
    }
    }

    … does a good job acting like those keyboard events

… for today’s fourth draft external Javascript ytaudioonly.js external Javascript supports the changed karaoke_youtube_api.htm inhouse YouTube video interfacer calling the modified stop_start_youtube.html YouTube API caller in our quest to play YouTube audio “in place” in a useful way.

Stop Press

UnLess attended mobile looping can work with the kludge (we suspect our bug or code design flaw) …


player.seekTo(1);
player.playVideo();

… and we hope nobody’s playing “Name That Sound” with the replays.


Previous relevant External Javascript YouTube Audio of Video Looping Tutorial is shown below.

External Javascript YouTube Audio of Video Looping Tutorial

External Javascript YouTube Audio of Video Looping Tutorial

Of yesterday’s External Javascript YouTube Audio of Video Emoji Tutorial

  1. pause
  2. play
  3. loop
  4. stop
  5. progress perhapsyes

… list of suggested “controls” for our Play Audio Stream of Selected YouTube Video In Place functionality, am sure of most interest was the loop one. Well, it certainly was for us, anyway.

We weren’t sure whether we could get around the actual tap needed on mobile platforms to just apply …


player.seekTo(0);
player.playVideo();

… as we near the end of the video. Alas, no, we need the red button (ie. the transparent YouTube video) to be retapped to get anywhere … so sad.

But non-mobile platform usages can loop effectively, and might help out users, who, like me, occasionally get obsessed with a YouTube music video (such as Morricone – Gabriel’s Oboe from The Mission, Maja Łagowska – oboe, conducted by Andrzej Kucybała) … hence the radio and musical note emojis 📻🎶 (&#128251;&#127926;) we started using yesterday.

Another plan we had to ask for menu operations via a window.prompt a lot of users will be relieved to hear, didn’t work either, and so we had to redesign, finally settling on HTML textarea elements whereby …

  • information and instructions are placed in its placeholder attribute … and …
  • like a hotkey (but not needing onkeydown or onkeyup or onkeypress event logic intervention) user audio control instructions are unique regarding first character, so way down at the grandchild level we have …

    function playingvideo() {
    psuf='';
    if (startagain) {
    if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
    psuf=' via button reclick ' + String.fromCodePoint(10004);
    } else {
    psuf=' ' + String.fromCodePoint(10004);
    }
    }
    if (('' + location.hash).replace(/^undefined/g,'').replace(/^null/g,'').replace(/\#/g,'') != '') {
    if (eval('' + duration) == 0 && Math.round(player.getCurrentTime()) < 1) {
    if (one == 1 || onepause != 1) {
    if (1 == 4) { player.pauseVideo(); }
    } else {
    player.playVideo();
    }
    setTimeout(playingvideo, 1000);
    } else {
    if (top.document.getElementById(location.hash.replace(/\#/g,''))) {
    if (('' + top.document.getElementById(location.hash.replace(/\#/g,'')).getAttribute('data-val')).replace(/^undefined/g,'').replace(/^null/g,'') != '') {
    top.document.getElementById(location.hash.replace(/\#/g,'')).value= top.document.getElementById(location.hash.replace(/\#/g,'')).getAttribute('data-val');
    top.document.getElementById(location.hash.replace(/\#/g,'')).setAttribute('data-val','');
    }
    switch (('' + top.document.getElementById(location.hash.replace(/\#/g,'')).value.toUpperCase() + ' ').substring(0,1)) {
    case 'L':
    startagain=true;
    psuf='';
    if (startagain) {
    psuf=' ' + String.fromCodePoint(10004);
    }
    dostumps=false;
    top.document.getElementById(location.hash.replace(/\#/g,'')).value='';
    break;

    case 'S':
    startagain=false;
    psuf='';
    if (startagain) {
    psuf=' ' + String.fromCodePoint(10004);
    }
    dostumps=true;
    player.stopVideo();
    top.document.getElementById(location.hash.replace(/\#/g,'')).value='';
    break;

    case 'P':
    if (one == 1 || onepause != 1) {
    player.pauseVideo();
    } else {
    player.playVideo();
    }
    top.document.getElementById(location.hash.replace(/\#/g,'')).value='';
    break;

    case 'M':
    player.mute();
    mletter='M';
    uletter='u';
    top.document.getElementById(location.hash.replace(/\#/g,'')).value='';
    break;

    case 'U':
    player.unMute();
    mletter='m';
    uletter='U';
    top.document.getElementById(location.hash.replace(/\#/g,'')).value='';
    break;


    default:
    break;
    }

    if (top.document.getElementById(location.hash.replace(/\#/g,'')).placeholder.indexOf('/') != -1) {
    if (startagain && eval(2 + Math.round(player.getCurrentTime())) > eval('' + duration) && eval('' + duration) > 0) {
    secscnt=eval(0.001 + duration);
    if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
    top.document.getElementById(location.hash.replace(/\#/g,'')).setAttribute('data-loop','y');
    setTimeout(function(){
    if (1 == 11) {
    setTimeout(startVideo, playtime + delay);
    setTimeout(playingvideo, 1900);
    } else {
    var huhc=false;
    // huhc=confirm('Okay to loop?');
    if (huhc && 1 == 7) {
    player.seekTo(0.01);
    secscnt=0.01;
    oursecscnt=0.01;
    player.playVideo();
    setTimeout(playingvideo, 1900);
    } else {
    window.parent.focus();
    parent.location.href=parent.document.URL.split('&random=')[0] + '&random=' + Math.floor(Math.random() * 1987865) + '&startagain=y' + ('' + location.hash).replace(/^undefined/g,'').replace(/^null/g,'').replace(/^\#$/g,'');
    }
    } }, 1500);
    return '';
    } else {
    top.document.getElementById(location.hash.replace(/\#/g,'')).setAttribute('data-loop','y');
    setTimeout(function(){ window.top.focus(); top.document.getElementById(location.hash.replace(/\#/g,'').substring(3).split('_')[0]).click(); }, 1500);
    return '';
    }
    }
    if (one == 1 || onepause != 1) {
    if (eval('' + duration) == 0) { duration=player.getDuration(); }
    top.document.getElementById(location.hash.replace(/\#/g,'')).placeholder='' + Math.round(player.getCurrentTime()) + '/' + duration + ' ... ' + 'P=pause/play S=stop M=' + mletter + 'ute U=' + uletter + 'nmute L=loop' + psuf;
    } else {
    if (eval('' + duration) == 0) { duration=player.getDuration(); }
    top.document.getElementById(location.hash.replace(/\#/g,'')).placeholder='' + Math.round(player.getCurrentTime()) + '/' + duration + ' ... ' + 'P=play/pause S=stop M=' + mletter + 'ute U=' + uletter + 'nmute L=loop' + psuf;
    }
    setTimeout(playingvideo, 1000);
    }
    }
    }
    }
    }

    … does a good job acting like those keyboard events

… for today’s fourth draft external Javascript ytaudioonly.js external Javascript supports the changed karaoke_youtube_api.htm inhouse YouTube video interfacer calling the modified stop_start_youtube.html YouTube API caller in our quest to play YouTube audio “in place” in a useful way.

Stop Press

UnLess attended mobile looping can work with the kludge (we suspect our bug or code design flaw) …


player.seekTo(1);
player.playVideo();

… and we hope nobody’s playing “Name That Sound” with the replays.


Previous relevant External Javascript YouTube Audio of Video Emoji Tutorial is shown below.

External Javascript YouTube Audio of Video Emoji Tutorial

External Javascript YouTube Audio of Video Emoji Tutorial

Onto yesterday’s External Javascript YouTube Audio of Video Mobile Helper Tutorial, today, we’ve …

  • further shored up the mobile platform playing of the audio stream of a YouTube video, as requested …
  • added display (usefulness only, so far) emojis 📻🎶 (&#128251;&#127926;) into the “underlay” button displays, as today’s work, leading up to, tomorrow …
  • the emoji tap/clicks will lead the user to a menu of further options (as often displayed with video controls) …
    1. pause
    2. play
    3. loop
    4. stop
    5. progress … perhaps

… where today’s third draft external Javascript ytaudioonly.js external Javascript supports the changed karaoke_youtube_api.htm inhouse YouTube video interfacer in our quest to play YouTube audio “in place” in a useful way.


Previous relevant External Javascript YouTube Audio of Video Mobile Helper Tutorial is shown below.

External Javascript YouTube Audio of Video Mobile Helper Tutorial

External Javascript YouTube Audio of Video Mobile Helper Tutorial

After the start yesterday’s External Javascript YouTube Audio of Video Helper Tutorial gave us with our External Javascript YouTube Audio of Video Helper we’ve progressed making the mobile platform interfacing less flaky, but more testing is needed.

Introducing a general delay into our changed karaoke_youtube_api.htm inhouse YouTube video interfacer part of the solution turned things around here.

To delay, say by 13.5 seconds, even great swathes of code …


setTimeout(function(){
// Start of "great swathes of code"
// ...
// End of "great swathes of code"
}, 13500);

… is one of those ideas we’re still pinching ourselves about how effective it can be (let alone passing in arguments at the function() bit). We’re forever filling “great swathes of code” with global Javascript variables but today’s “great swathe” works okay with non global Javascript variables in there, and we’re thinking we have to be more trusting of the brilliant setTimeout (and setInterval) Javascript techniques of introducing a delay into the flow of your Javascript. Of course, we could also delay the work until the document.body onload event, but we wanted to get in early with what the code is trying to achieve here … we’ll see.

Perhaps a good adage here is …

Trust the process.
Trust the wonders of (in the case of iOS, Safari) Web Browser Web Inspector debugging to test ideas you start out being unsure of.

… with our ongoing second draft external Javascript ytaudioonly.js external Javascript ongoing current project … so Wake Me Up Before You Go-Go.


Previous relevant External Javascript YouTube Audio of Video Helper Tutorial is shown below.

External Javascript YouTube Audio of Video Helper Tutorial

External Javascript YouTube Audio of Video Helper Tutorial

It is not that surprising that the next step onto the progress of yesterday’s Making of Clickaround Maps Google Chart Geo Chart Mobile Integration Tutorial would involve us developing…

  • an external Javascript …
  • helper for “in place” …
  • audio play …
  • of that stream of a YouTube video … via …
  • user linked script call …

    <script type='text/javascript' src='//www.rjmprogramming.com.au/ytaudioonly.js'></script>

    … helping out …
  • HTML “a” link with class=audioytplay and a mention of https://www.youtube.com/watch?v=[YouTubeID] … eg.

    <p>Oops, <a class="audioytplay" target="_blank" title="?" href='https://www.youtube.com/watch?v=gBzJGckMYO4' rel="noopener"><strike>that's all</strike>sorry, folks</a></p>
  • to be, via onclick event, playing “in place” the audio part of that YouTube referenced [YouTubeID] video

Developing this is definitely more than a one day job (especially getting mobile platforms working), but today’s “first draft” ytaudioonly.js external Javascript, along with the help of …

… is our start to this project. Try it yourself below …

Oops, that's allsorry, folks


Previous relevant Making of Clickaround Maps Google Chart Geo Chart Mobile Integration Tutorial is shown below.

Making of Clickaround Maps Google Chart Geo Chart Mobile Integration Tutorial

Making of Clickaround Maps Google Chart Geo Chart Mobile Integration Tutorial

As far as CSS styling goes with our web application work, personally speaking, it is one of …

Give it a bit of oompha!

… moments in coding we think we learn more from, than reading about CSS. That, and, usually StackOverflow, thanks, where examples of achieving some styling ambition teach us a lot too.

Yesterday, with Clickaround Maps Google Chart Geo Chart Mobile Integration Tutorial, we decided to “put a bit of oompha” into that “two bell emoji” ( ie. 🔔🔔 ) link “double buzzer” sound “production number”, and wanted to break down what we ended up with, for readers …

Our first try … okay for non-mobile … not as good for mobile …

<a id="aja" target="myja" title="" onmouseover="if (!navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) { this.title=' '; this.target='myja'; } " onclick="if (!navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i) && this.title == '') { this.title=' '; this.target='myja'; document.getElementById('myja').src=this.href; } setTimeout(function(){ document.getElementById('aja').target='_blank'; },100);" href="//www.rjmprogramming.com.au/HTMLCSS/karaoke_youtube_api.htm?youtubeid=7XMW6Z_Oq38&jusJUNKtaudio=&youtube_duration=2.000&email=&email=&emoji=on&c0=on&i0=0&j0=2&i1=&j1=&i2=&j2=&i3=&j3=&i4=&j4=&i5=&j5=&i6=&j6=&i7=&j7=&i8=&j8=&i9=&j9=&i10=&j10=&i11=&j11=&i12=&j12=&i13=&j13=&i14=&j14=&i15=&j15=&i16=&j16=&i17=&j17=&i18=&j18=&i19=&j19=&i20=&j20=&i21=&j21=&i22=&j22=&i23=&j23=&i24=&j24=&i25=&j25=&i26=&j26=&i27=&j27=&i28=&j28=&i29=&j29=" rel="noopener">&#128276;&#128276;</a>

… begets …

🔔🔔

Our second try … okay for non-mobile … better for mobile …

<a id="aja" target="myja" title="" onmouseover="if (!navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) { this.title=' '; this.target='myja'; } " onclick="if (!navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i) { this.title == '') { this.title=' '; this.target='myja'; document.getElementById('myja').src=this.href; } setTimeout(function(){ document.getElementById('aja').target='_blank'; },100); }" href="//www.rjmprogramming.com.au/HTMLCSS/karaoke_youtube_api.htm?youtubeid=7XMW6Z_Oq38&justJUNKaudio=&youtube_duration=2.000&email=&email=&emoji=on&c0=on&i0=0&j0=2&i1=&j1=&i2=&j2=&i3=&j3=&i4=&j4=&i5=&j5=&i6=&j6=&i7=&j7=&i8=&j8=&i9=&j9=&i10=&j10=&i11=&j11=&i12=&j12=&i13=&j13=&i14=&j14=&i15=&j15=&i16=&j16=&i17=&j17=&i18=&j18=&i19=&j19=&i20=&j20=&i21=&j21=&i22=&j22=&i23=&j23=&i24=&j24=&i25=&j25=&i26=&j26=&i27=&j27=&i28=&j28=&i29=&j29=" rel="noopener">&#128276;&#128276;</a>
<iframe onload="if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) { if (this.src.indexOf('About_Us.') != -1) { document.getElementById('aja').target='myja';
this.src=document.getElementById('aja').href + '&rand=' + Math.floor(Math.random() * 1989786); } } " id="myja" name="myja" src="/About_Us.html" style="display:none;"></iframe>

… begets …

🔔🔔

… working better because of tweaked karaoke_youtube_api.htm
inhouse YouTube video interfacer‘s new


if (window.top) {
if (document.URL.indexOf('youtubeid=7XMW6Z_Oq38&') != -1 && navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {
setTimeout(function(){
if (document.getElementById('audioejkaraoke')) {
document.getElementById('audioejkaraoke').title=' ' + document.getElementById('audioejkaraoke').title;
document.getElementById('audioejkaraoke').value=String.fromCodePoint(128276) + String.fromCodePoint(128276);
document.getElementById('audioejkaraoke').style.position='absolute';
document.getElementById('audioejkaraoke').style.left='0px';
document.getElementById('audioejkaraoke').style.top='0px';
document.getElementById('audioejkaraoke').style.backgroundColor='transparent';
document.getElementById('audioejkaraoke').style.zIndex='99';
document.getElementById('repeat').value=String.fromCodePoint(128276) + String.fromCodePoint(128276);
document.getElementById('repeat').style.position='absolute';
document.getElementById('repeat').style.left='0px';
document.getElementById('repeat').style.top='-10px';
document.getElementById('repeat').style.backgroundColor='transparent';
document.getElementById('repeat').style.zIndex='199';
document.getElementById('myiframe').style.position='absolute';
document.getElementById('myiframe').style.left='-100px';
document.getElementById('myiframe').style.top='-100px';
document.getElementById('myiframe').style.zIndex='299';
//document.getElementById('myiframe').style.backgroundColor='transparent';
document.getElementById('myiframe').style.opacity='0.0';
if (aaconto) {
aaconto.getElementById('player').style.opacity='0.0';
} else {
aaset=true;
}
document.body.style.backgroundColor='transparent';
} else {
setInterval(function(){
if (document.getElementById('audioejkaraoke')) {
if (('' + document.getElementById('audioejkaraoke').title + ' ').substring(0,1) != ' ') {
document.getElementById('audioejkaraoke').title=' ' + document.getElementById('audioejkaraoke').title;
document.getElementById('audioejkaraoke').value=String.fromCodePoint(128276) + String.fromCodePoint(128276);
document.getElementById('audioejkaraoke').style.position='absolute';
document.getElementById('audioejkaraoke').style.left='0px';
document.getElementById('audioejkaraoke').style.top='0px';
document.getElementById('audioejkaraoke').style.backgroundColor='transparent';
document.getElementById('audioejkaraoke').style.zIndex='99';
document.getElementById('repeat').value=String.fromCodePoint(128276) + String.fromCodePoint(128276);
document.getElementById('repeat').style.position='absolute';
document.getElementById('repeat').style.left='0px';
document.getElementById('repeat').style.top='-10px';
document.getElementById('repeat').style.backgroundColor='transparent';
document.getElementById('repeat').style.zIndex='199';
document.getElementById('myiframe').style.position='absolute';
document.getElementById('myiframe').style.left='-100px';
document.getElementById('myiframe').style.top='-100px';
document.getElementById('myiframe').style.zIndex='299';
//document.getElementById('myiframe').style.backgroundColor='transparent';
document.getElementById('myiframe').style.opacity='0.0';
if (aaconto) {
aaconto.getElementById('player').style.opacity='0.0';
} else {
aaset=true;
}
document.body.style.backgroundColor='transparent';
}
}
}, 1000);
}
if (top.document.getElementById('aja')) {
var boxis=top.document.getElementById('aja').getBoundingClientRect();
//alert('boxis.left=' + boxis.left + ' ' + top.document.getElementById('aja').innerHTML);
if (top.document.getElementById('aja').innerHTML.indexOf('<iframe') == -1) {
//alert('Boxis.left=' + boxis.left);
top.document.getElementById('myja').style.width='' + eval(2 * boxis.width) + 'px';
top.document.getElementById('myja').style.height='' + eval(1 * boxis.height) + 'px';
setTimeout(function(){
top.document.getElementById('aja').innerHTML=top.document.getElementById('myja').outerHTML.replace('/About_Us.html',top.document.getElementById('aja').href).replace(' onload=',' data-onload=').replace(' id=',' data-id=').replace(' name=',' name-id=').replace('none;','inline-block;');
}, 2000);
} else if (3 == 4) {
top.document.getElementById('myja').style.position='absolute';
top.document.getElementById('myja').style.left='' + boxis.left + 'px';
top.document.getElementById('myja').style.top='' + boxis.top + 'px';
top.document.getElementById('myja').style.width='' + boxis.width + 'px';
top.document.getElementById('myja').style.height='' + boxis.height + 'px';
top.document.getElementById('myja').style.display='block';
top.document.getElementById('myja').style.zIndex='99';
//top.document.getElementById('aja').innerHTML='  ';
}
}
}, 1000);
}

if (top.document.URL.indexOf('/esp_ornot_esp.') != -1 || parent.document.URL.indexOf('/esp_ornot_esp.') != -1) {
if (top.document.title.indexOf(' justaudio ') != -1) {
asuffis='&justaudio=&';
bsuffis=' name=justaudio ';
}
}
}

Let’s start with …

Why can’t we just link to a YouTube video URL webpage off any old platform or web browser incarnation?

Well, you could! But we wanted a less obvious approach (and we were not sure about mobile platforms, trying this), only relevant for scenarios where you are only interested in the audio stream of a YouTube video (it should be noted), that is hiding from the reader “the mechanics” of what we are doing (to get a cheap giggle … there, are you happy now?!).

What does Javascript if (!navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) { } if test achieve?

If this test returns true we have detected a non-mobile platform/web browser scenario.

What does the HTML target attribute of an a HTML element do?

That target attribute determines the “navigational place” of the href attribute URL of that a link where …

  1. _blank opens in a new window
  2. _self clobbers current window
  3. _top adds a new (tabbed) window (perhaps from the viewpoint of a child HTML iframe window)
  4. other named target point to the name attribute of an HTML iframe element, presumably, in the current window

What does HTML code snippet onload=”if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) { if (this.src.indexOf(‘About_Us.’) != -1) { document.getElementById(‘aja’).target=’myja’;
this.src=document.getElementById(‘aja’).href + ‘&rand=’ + Math.floor(Math.random() * 1989786); } } “
do as the onload event logic of the “second version” iframe incarnation?

We decided that we needed to get assistance from our inhouse YouTube video interfacing player, when it came to mobile platforms and web browsers, to get to a point where …

  • unbeknown to such mobile users
  • when they tap the 🔔🔔 “buzzer” button emojis …
  • it is arranged from the child iframe inhouse YouTube video interfacing player web application using “overlay” concepts …
    1. position: absolute
    2. opacity
    3. z-index
    4. top and left positioning
    5. width and height dimensioning
    6. 🔔🔔 into some button content

    … that what they are tapping is a YouTube video element

  • looking like 🔔🔔 at levels of a smaller z-index seen through opacity:0.0 higher z-index levels, the topmost transparent but high z-index one being the YouTube video element which is that webpage area’s “action item” … if you will

Huh?!

On mobile platforms, media cannot play, these days, unless it is as a direct result of a user tap (excluding programmatically produced taps). See all this in action, with thanks to FreeConvert, below …

And so, yes … was it worth it? Perhaps not to do with the job at hand, but for future reference, we’re happy to give this added oompha to this effort.

If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.

Posted in eLearning, Event-Driven Programming, Tutorials | Tagged , , , , , , , , , , , , , | Leave a comment

Tabular Single Row Image Gallery Linking Tutorial

Tabular Single Row Image Gallery Linking Tutorial

Tabular Single Row Image Gallery Linking Tutorial

After yesterday’s Tabular Single Row YouTube Audio or Video Buttons Tutorial work mainly regarding audio and video media, today we return to those …

  • background WordPress Blog random tutorial images … and link them via a modified 404.php creator’s …
    <?php

    if (strpos(('?' . $_SERVER['QUERY_STRING']), '?rand=') !== false) {
    $huht=@file_get_contents('http://www.rjmprogramming.com.au/HTMLCSS/select_palette.php?putrandom=' . urlencode('?rand=' . $_GET['rand'] . '.' . $pnumis . $ptitle));
    }

    ?>
    … calling on …
  • a modified select_palette.php helper …
    <?php

    if (isset($_GET['putrandom'])) {
    $contis=str_replace(' ','++',str_replace('+',' ',urldecode($_GET['putrandom']))) . "\n";
    $xcurgmt=gmdate("Ymd");
    if (!file_exists($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'media_gallery_swipe_' . $xcurgmt . '.htm')) {
    foreach (glob($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'media_gallery_swipe_' . '*.htm') as $dfilename) {
    unlink($dfilename);
    }
    file_put_contents($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'media_gallery_swipe_' . $xcurgmt . '.htm', $contis);
    } else {
    file_put_contents($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'media_gallery_swipe_' . $xcurgmt . '.htm', file_get_contents($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'media_gallery_swipe_' . $xcurgmt . '.htm') . $contis);
    }
    exit;
    } else if (isset($_GET['getrandom'])) {
    $xcurgmt=gmdate("Ymd");
    $imode=0;
    $contis="";
    $idp="";
    $jdp="";
    $pfix="";
    $sfix="";
    if (file_exists($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'media_gallery_swipe_' . $xcurgmt . '.htm')) {
    $contis=file_get_contents($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . 'media_gallery_swipe_' . $xcurgmt . '.htm');
    if (strlen($_GET['getrandom']) > 0) {
    $relstuffs=explode(str_replace(' ','++',str_replace('+',' ',strtolower(urldecode($_GET['getrandom'])))) . '.', $contis);
    if (sizeof($relstuffs) > 1) {
    $isub=0;
    $jdp=str_replace('rand=','',str_replace(' ','++',str_replace('+',' ',strtolower(urldecode($_GET['getrandom'])))));
    $imode=1;
    while (substr(substr($relstuffs[-1 + sizeof($relstuffs)],$isub),0,1) >= '0' && substr(substr($relstuffs[-1 + sizeof($relstuffs)],$isub),0,1) <= '9') {
    if ($imode == 0) {
    $jdp.=substr(substr($relstuffs[-1 + sizeof($relstuffs)],$isub),0,1);
    } else {
    $idp.=substr(substr($relstuffs[-1 + sizeof($relstuffs)],$isub),0,1);
    }
    $isub++;
    if (substr(substr($relstuffs[-1 + sizeof($relstuffs)],$isub),0,1) == '.') {
    $imode=1;
    $isub++;
    }
    }
    if (isset($_GET['via'])) {
    $pfix=" if (parent.document.getElementById('" . $_GET['via'] . "')) { parent.document.getElementById('" . $_GET['via'] . "').style.width='100%;'; parent.document.getElementById('" . $_GET['via'] . "').innerHTML+='<iframe style=width:100%;height:800px; src=!!!></iframe>'; } else { ";
    $sfix=" } ";
    }
    if (strtolower(urldecode($_GET['getrandom'])) != urldecode($_GET['getrandom'])) { // Cut to the Chase
    echo "<html><body onload=\"" . str_replace('!!!','/slideshow.html?title=' . explode(" (", explode("\n", explode('=' . $jdp . '.' . $idp, $contis)[1])[0])[0],$pfix) . " parent.window.open('/slideshow.html?title=" . explode(" (", explode("\n", explode('=' . $jdp . '.' . $idp, $contis)[1])[0])[0] . " " . $sfix . " ','_blank','top=200,left=200,width=600,height=600');\"></body></html>";
    exit;
    } else { // WordPress Blog Posting
    echo "<html><body onload=\"" . str_replace('!!!','/ITblog/?p=' . $idp . '#content',$pfix) . " parent.window.open('/ITblog/?p=" . $idp . "#content','_blank','top=200,left=200,width=600,height=600'); " . $sfix . " \"></body></html>";
    exit;
    }
    }
    }
    }
    echo "<html><body><pre>" . $contis . '</pre></body></html>';
    exit;
    }

    ?>
    … called at the parent window by …
  • changed swipe_media.html Tabular Single Row Media Gallery

    function checkmeout(evt, iscuttothechase) {
    if (evt.target.outerHTML.split('>')[0].indexOf('url(') != -1) {
    if (evt.target.outerHTML.split('>')[0].split('url(')[1].split(')')[0].indexOf('?rand=') != -1) {
    if (iscuttothechase) {
    document.getElementById('sparepal').src='/HTMLCSS/select_palette.php?getrandom=' + encodeURIComponent('RAND=' + evt.target.outerHTML.split('>')[0].split('url(')[1].split(')')[0].split('?rand=')[1].split("'")[0].split('"')[0].split(')')[0].split('"')[0]); // + ('&viJUNKa=' + evt.target.id).replace('td','div')
    } else {
    document.getElementById('sparepal').src='/HTMLCSS/select_palette.php?getrandom=' + encodeURIComponent('rand=' + evt.target.outerHTML.split('>')[0].split('url(')[1].split(')')[0].split('?rand=')[1].split("'")[0].split('"')[0].split(')')[0].split('"')[0]); // + ('&viJUNKa=' + evt.target.id).replace('td','div')
    }
    }
    }
    }

… web application, now accepting …

  1. click on one of these WordPress Blog random tutorial images to open window to relevant WordPress Blog posting … or …
  2. right click on one of these WordPress Blog random tutorial images to open window to relevant Cut to the Chase web application or presentation media regarding that blog posting above


Previous relevant Tabular Single Row YouTube Audio or Video Gallery Tutorial is shown below.

Tabular Single Row YouTube Audio or Video Gallery Tutorial

Tabular Single Row YouTube Audio or Video Gallery Tutorial

Today we’ve connected …

… which now have three new functionality options …

  • <–> … link to align the (previously) “Brady Bunch” YouTube iframes into a single row in the same web browser tab
  • <–>A+V … call of yesterday’s Media Gallery web application playing our “inhouse” YouTube iframe video playing web application in a new web browser tab
  • <–>A-V … link to our “inhouse” audio stream only YouTube iframe playing functionality in a new web browser tab

… involving changes to …

  • our changed

    var ytlist='';

    if (('' + document.URL + ('' + location.hash)).indexOf('onerow=') != -1) {
    setTimeout(function(){
    var inis='';
    var iwis=document.getElementById('vplayer1').getBoundingClientRect().width;
    var ifsare=document.getElementsByTagName('iframe');
    for (var jtt=0; jtt<ifsare.length; jtt++) {
    //alert(ifsare[jtt].src);
    if (ifsare[jtt].src.indexOf('/embed/') != -1) {
    if (ytlist == '') {
    ytlist='' + ifsare[jtt].src.split('/embed/')[1].substring(0,11);
    } else {
    ytlist+=',' + ifsare[jtt].src.split('/embed/')[1].substring(0,11);
    }
    }
    ifsare[jtt].style.width='' + iwis + 'px';
    }
    var toho=document.getElementsByTagName('table')[0];
    var tih=toho.innerHTML;
    var newtih=tih;
    //alert(tih);
    var thingos=tih.split('<tr');
    for (var itt=3; itt>=1; itt--) {
    if (itt == 1) {
    inis='<tr' + thingos[itt].split('</tr>')[0] + '</tr>';
    newtih=newtih.replace(inis, inis.replace('</tr>','<!--/tr-->'));
    } else if (itt == 3) {
    inis='<tr' + thingos[itt].split('</tr>')[0] + '</tr>';
    newtih=newtih.replace(inis, inis.replace('<tr>','<!--tr-->'));
    } else {
    inis='<tr' + thingos[itt].split('</tr>')[0] + '</tr>';
    newtih=newtih.replace(inis, inis.replace('<tr>','<!--tr-->').replace('</tr>','<!--/tr-->'));
    }
    }
    toho.innerHTML=newtih;
    toho.style.width='1000%';
    }, 4000);
    }

    setTimeout(function(){
    var antwo='';
    if (ytlist == '') {
    var ifsare=document.getElementsByTagName('iframe');
    for (var jtt=0; jtt<ifsare.length; jtt++) {
    //alert(ifsare[jtt].src);
    if (ifsare[jtt].src.indexOf('/embed/') != -1) {
    if (ytlist == '') {
    ytlist='' + ifsare[jtt].src.split('/embed/')[1].substring(0,11);
    } else {
    ytlist+=',' + ifsare[jtt].src.split('/embed/')[1].substring(0,11);
    }
    }
    }
    }
    if (ytlist != '') {
    antwo+=' <a title="Audio and video plays of YouTube videos" target=_blank href="/HTMLCSS/swipe_media.html?youtube=' + encodeURIComponent(ytlist) + '"><--><sup>A+V</sup></a>';
    antwo+=' <a title="Audio only plays of YouTube videos" target=_blank href="/HTMLCSS/swipe_media.html?audioyoutube=' + encodeURIComponent(ytlist) + '"><--><sub>A-V</sub></a>';
    }
    if (document.URL.indexOf('?') != -1) {
    document.getElementById('wshuffle').innerHTML+=' <a title="Present in one table row" target=_self href="' + document.URL.replace('?', '?onerow=' + Math.floor(Math.random() * 1989786)) + '"><--></a>' + antwo + ' ';
    } else {
    document.getElementById('wshuffle').innerHTML+=' <a title="Present in one table row" target=_self href="' + document.URL + '?onerow=' + Math.floor(Math.random() * 1989786) + '"><--></a>' + antwo + ' ';
    }
    }, 9000);

    youtube_brady_bunch.js being used in our inhouse Disco web application “peer to peer suite” web application “grandparent” level example …
  • “second draft” swipe_media.html Tabular Single Row Image Gallery web application


Previous relevant Tabular Single Row Image Gallery Primer Tutorial is shown below.

Tabular Single Row Image Gallery Primer Tutorial

Tabular Single Row Image Gallery Primer Tutorial

“Tabular Single Row Image Gallery” …

Smabular Single Row Image Gallery

… we’re sure is the reaction of some readers out there, to today’s “starting draft” for an idea we had. Today’s part of the jigsaw we want to explore may be “ho hum” and “so non-mobile”, but we’re hoping the thread appeals to more modern ideas as we go along.

So much for the apologies, and so let’s now look at the basis to this start …

  • media (so far just image) …
  • gallery … presented in …
  • table … HTML element … in …
  • single tr row
  • deliberately overflowing to the right of the screen view of the webpage … and so …
  • scrollable (ie. window scrollable) to … those right hand parts …
  • only “media loaded” …
  • as “scrolled to” or “stumbled upon”

So far the window scrollable detection goes (thanks to this useful link) …


window.onscroll = function (e) {
// called when the window is scrolled.
vspos4=document.body.scrollTop;
vspos3=document.body.scrollLeft;
var vstdn=Math.ceil(eval('' + vspos3) / eval('' + amin));
if (curtdn != vstdn) {
checkthen(vstdn);
}
}

… and the CSS produced “wording (ie. non-media) content” is produced down the bottom left of “inhouse WordPress Blog image cell background” ( possible because of background-size:contain ) we think is interesting …


<style>
td {
border: 1px dotted green;
}

.inhouse {
vertical-align: bottom;
padding-bottom: 20px;
}

.inhouse::after {
content: 'Media Gallery \a RJM Programming \a August, 2025 \a Thanks to Lorem Picsum at https://picsum.photos/ \a ' attr(alt);
white-space: pre-wrap;
}

</style>

… in a “first draft” Tabular Single Row Image Gallery web application for your perusal. Thanks to Lorem Picsum regarding, as so often happens for us, when we’d like beautiful random images to be involved with web applications!

If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.

Posted in eLearning, Event-Driven Programming, Tutorials | Tagged , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , | Leave a comment