HTML5 Video gallery playlist with multiple videos - html

I have a client that wants a video gallery that has a list of thumbnails on the left and a player area on the right. So far so good. I have some html5, jQuery and CSS that is playing a single video in the right pane when a thumbnail is clicked.
My problem is, my client wants what is in essence two playlist. For instance, a gallery of individuals that had a procedure would have a patient's photo as a thumbnail on the left, when the thumbnail is clicked, a video will start playing on the right about that patients experience. Then under that video there would be other links such as 1 week after surgery, 2 weeks after surgery etc.. Sort of a diary on an individual.
To see what I'm asking for, you can see a working one I have put together at http://www.smartlaserlift.com/video-diaries.html. This is a total hackjob using some ajax and really is not working cross platform the way I'd like.
Here is some markup I am currently working on just to display the thumbnails and play the video on the left. I am looking for suggestions on handling the second playlist or perhaps an idea on scrapping this and maybe a better way of doing it.
The HTML
<div class="video_gallery_container">
<div id="thumbs">
<a class="videoLink" videowidth="680" videoheight="383" videofile="Peggy_Web1" videothumb="peggy-vid-thumb" videocaption="Meet Peggy" videodescription="Meet Peggy as she begins her SmartLaser Lift Journey." ></a>
</div>
<div id="vidContainer">
<div id="videoPlayer">
</div>
</div>
The JavaScript
$(document).ready(function() {
$('a.videoLink').each(function() {
var thumbnailFilePath = 'video/' + $(this).attr('videothumb') + '.jpg';
var videoCaption = $(this).attr('videocaption');
$(this).css('background-image','url('+thumbnailFilePath+')');
$(this).html('<div class="caption">' + videoCaption + '</div><img class="play" src="images/play_icon.png" />');
});
$('.videoLink').click(function(){
var videoFile = $(this).attr('videofile');
var videoPoster = $(this).attr('videofile');
var videoCaption = $(this).attr('videocaption');
var videoWidth = Number($(this).attr('videowidth'));
var videoHeight = Number($(this).attr('videoheight'));
var videoDescription = $(this).attr('videoDescription');
var videoCode = '<video width="'+videoWidth+'" height="'+videoHeight+'" controls autoplay autobuffer><source src="video/'+videoFile+'.ogv" type="video/ogg" /><source src="video/'+videoFile+'.mp4" type="video/mp4" /><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="'+videoWidth+'" height="'+(videoHeight+40)+'" id="video_player" align="middle"><param name="allowScriptAccess" value="sameDomain"><param name="allowFullScreen" value="true"><param name="movie" value="video_player.swf?videoFile=video/'+videoFile+'.mp4&skinFile=video_skin.swf&videoFileWidth='+videoWidth+'&videoFileHeight='+videoHeight+'"><param name="quality" value="high"><param name="wmode" value="transparent"><param name="scale" value="noscale"><param name="salign" value="lt"><embed src="video_player.swf?videoFile=video/'+videoFile+'.mp4&skinFile=video_skin.swf&videoFileWidth='+videoWidth+'&videoFileHeight='+videoHeight+'" quality="high" width="'+videoWidth+'" height="'+(videoHeight+40)+'" name="video_player" align="middle" allowscriptaccess="sameDomain" type="application/x-shockwave-flash" scale="noscale" salign="lt" wmode="transparent" allowfullscreen="true" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed></object></video>';
var playerBlock = '<div id="playerBlock"><div id="playerHeader">' + videoCaption + '</div>' + '<div id="player">' + videoCode + '</div><div id="videoDescription">' + videoDescription +'</div></div>';
$('#videoPlayer').html(playerBlock);
$('#videoPlayer').css('display', 'block');
});
});//end document.ready function

Im not sure if you got your links to work, but i need a code that will allow me to simply have 5 thumbnails on the left with a diffrent video playing when each thumbnail in click, similar to what you used, I'm not a coding expert and can not figure this out on my own.

Related

Opening Video Thumbnail - video will open but will not load

For context, this is just a website that displays a thumbnail gallery linking to larger photos/videos.
When the thumbnails of photos are opened there is no problem. The thumbnails with a video attached to them look identical to the photo thumbnail only until the video thumbnail is clicked and the video will not load. Reference the HTML(first block) & javascript(second block) code below, any help would be greatly appreciated, this is my own personal project and I have been stuck for a couple days lol. if there any other information required, please do not hesitate to ask
This what happens when the thumbnail with the video is clicked but the video DOES NOT PLAY :(
<!-- code below is the PHOTO block of code ! -->
<article class="thumb">
<a href="images/fulls/21.jpg" class="image">
<img src="images/thumbs/21.jpg" class="image" alt="" /></a>
<h2> Cmon mayne</h2>
<p>Photoshoot with Myles Jay </p>
</article>
<!-- code below is the VIDEO block of code ! -->
<article class="thumb">
<a href="images/fulls/16.mp4" type="video/mp4" video
src="images/fulls/16.mp4" class="image">
<img src="images/thumbs/ab22.jpg" class="image" alt="" />
</a> <h2> Getting to the work</h2>
<p>Photoshoot with Myself </p>
</article>
// Main.
var $main = $('#main');
// Thumbs.
$main.children('.thumb').each(function() {
var $this = $(this),
$image = $this.find('.image'), $image_img = $image.children('img'),
x;
// No image? Bail.
if ($image.length == 0)
return;
// Image.
// This sets the background of the "image" <span> to the image pointed to by its child
// <img> (which is then hidden). Gives us way more flexibility.
// Set background.
$image.css('background-image', 'url(' + $image_img.attr('src') + ')');
// Set background position.
if (x = $image_img.data('position'))
$image.css('background-position', x);
// Hide original img.
$image_img.hide(); });
// Poptrox.
$main.poptrox({
baseZIndex: 20000,
caption: function($a) {
var s = '';
$a.nextAll().each(function() {
s += this.outerHTML;
});
return s;
},
fadeSpeed: 300,
onPopupClose: function() { $body.removeClass('modal-active'); },
onPopupOpen: function() { $body.addClass('modal-active'); },
overlayOpacity: 0,
popupCloserText: '',
popupHeight: 150,
popupLoaderText: '',
popupSpeed: 300,
popupWidth: 150,
selector: '.thumb > a.image',
usePopupCaption: true,
usePopupCloser: true,
usePopupDefaultStyling: false,
usePopupForceClose: true,
usePopupLoader: true,
usePopupNav: true,
windowMargin: 50
});
// Hack: Set margins to 0 when 'xsmall' activates.
breakpoints.on('<=xsmall', function() {
$main[0]._poptrox.windowMargin = 0;
});
breakpoints.on('>xsmall', function() {
$main[0]._poptrox.windowMargin = 50;
});
})(jQuery);
I have searched every stackoverflow method mentioning a thumbnail and video, I am honestly stuck. I have been playing around with the tags and attributes but I have seem to be getting no where.
Try setting up your <article> as:
<article class="thumb">
<a href="images/fulls/16.mp4">
<img src="images/thumbs/ab22.jpg" class="image" alt="" />
</a> <h2> Getting to the work</h2>
<p>Photoshoot with Myself </p>
</article>

On positioning HTML <picture> <source> element's

I'm currently designing a website for university.
I am using a 12 column layout for a responsive website and would like to know how to position an image lower down within said columns.
I am using a element and would like to move the y position of the
source srcset = "res/african.jpg" media = "(min-width:600px)"> element down.
surrounding this in div tags, targeting the individual columns and trying to position the actual picture element do not work as it either moves every column down or removes the image altogether.
<div class = "col-2 col-s-4">
<picture >
<source srcset = "res/scarf_900.jpg" media = "(min-width:768px)" alt = "Woman in scarf">
<source srcset = "res/african.jpg" media = "(min-width:600px)" // i would like to individually move down>
<source srcset = "res/girl_in_woods.jpeg" media = "(min-width:0px)">
<img src "">
</picture>
Made separate picture element with new div>
<div class = "africantabletimage">
<picture>
<source srcset = "res/african.jpg" media = "(min-width:600px)" >
<img src "">
</picture>
<picture >
<source srcset = "res/scarf_900.jpg" media = "(min-width:768px)" alt = "Woman in scarf">
</div>
<source srcset = "res/girl_in_woods.jpeg" media = "(min-width:0px)">
<img src "">
</picture>
</div>
CSS
.africantablet image{
padding-top:7%;
}

How can I rotate 2 or more html banners (Adnetwork tags) on a single banner space

I got this code for rotatating multiple images on a space
<script type="text/javascript"><!--
/*
Copyright 2017 The PCman Website Rotating Banner Code
https://www.thepcmanwebsite.com
This code is free to use provided this notice is not removed.
Create your own custom banner code with banners
*/
mybanners=
[
"<img src=\"http://example123.com/banner.gif\" width=\"468\" height=\"60\" alt=\"Click here for example\" title=\"Click here for example\" border=\"0\">",
"<img src=\"http://example.com/banner.gif\" width=\"468\" height=\"60\" alt=\"Click here for example\" title=\"Click here for example\" border=\"0\">"
]
randomNumber = Math.random()
var show_mybanners = mybanners[Math.floor(randomNumber * mybanners.length)]
document.write(show_mybanners);
// --></script>
<noscript>
<img src="http://example.com/banner.gif" width="468" height="60" alt="Click here for example" title="Click here for example" border="0">
</noscript>
It rotate a new image everytime page rotate.
I want a similer code like this for rotating iframe (Multiple Adnetwork) banners
Can anyone help me in this.

onchange not working in Internet Explorer

I have a form with a field like:
<td width='30%' align='center'>
<input name='prod_partnum1' type='text' id='prod_partnum1' size='20' maxlength='20' color='#333333' value='$prod_partnum1'>
</td>
<td width='30%' align='center'>
<input onchange='ceck_modulo1();' id='prod_partnumver1' name='prod_partnumver1' value=''>
</td>
and this is java for check_modulo
function check_modulo1() {
<!---->
if (document.modulo.prod_partnumver1.value == "" || document.modulo.prod_partnumver1.value != document.modulo.prod_partnum1.value) {
document.modulo.prod_partnumver1.value = "";
document.modulo.prod_partnumver1.style.backgroundColor = "#FF0000";
document.getElementById('line1').style.backgroundColor = "#FF0000";
document.modulo.prod_partnumver1.innerHTML = '<audio autoplay="autoplay"><source src="NuclearAlert.mp3" type="audio/mpeg" /><embed hidden="true" autostart="true" loop="false" src="NuclearAlert.mp3" /></audio>';
document.modulo.prod_partnumver2.focus();
document.modulo.prod_partnumver1.focus();
} else {
document.modulo.prod_partnumver1.innerHTML = '<audio autoplay="autoplay"><source src="SmallBlink.mp3" type="audio/mpeg" /><embed hidden="true" autostart="true" loop="false" src="SmallBlink.mp3" /></audio>';
document.modulo.prod_partnumver1.style.backgroundColor = "#008800";
document.getElementById('line1').style.backgroundColor = "#008800";
document.modulo.prod_partnumver2.focus();
}
onchange works just with crome and ff but not with any version of internet explorer 7 , 11
The problem is: the text field prod_partnumver1 is field to write barcode scanned by barcode gun, and when a put barcode with a gun if is crome work perfect with internet explorer, not for working need I click with the mouse in another text field.
With chrome it works perfect when a write with barcode scanner verify the field and if is correct go to the next... like java ceck_modulo1 work.....
Thanks for any help.
onchange support in IE7 is limited, you should use onclick instead. Further reading on the subject.
ok guy's i find solution and i write for other....need mybe tomorrow
ie not work with onchange so....
<SCRIPT LANGUAGE="JavaScript">
var to;
function callMe1(ms) {
clearTimeout(to);
to = setTimeout(function() {
<!---->
if ( document.modulo.prod_partnumver1.value == "" || document.modulo.prod_partnumver1.value != document.modulo.prod_partnum1.value ){
document.modulo.prod_partnumver1.value = "";
document.modulo.prod_partnumver1.style.backgroundColor="#FF0000";
document.getElementById('line1').style.backgroundColor="#FF0000" ;
document.modulo.prod_partnumver1.innerHTML='<audio autoplay="autoplay"><source src="NuclearAlert.mp3" type="audio/mpeg" /><embed hidden="true" autostart="true" loop="false" src="NuclearAlert.mp3" /></audio>';
document.modulo.prod_partnumver2.focus();
document.modulo.prod_partnumver1.focus();
}
else
{
document.modulo.prod_partnumver1.innerHTML='<audio autoplay="autoplay"><source src="SmallBlink.mp3" type="audio/mpeg" /><embed hidden="true" autostart="true" loop="false" src="SmallBlink.mp3" /></audio>';
document.modulo.prod_partnumver1.style.backgroundColor="#008800";
document.getElementById('line1').style.backgroundColor="#008800" ;
document.modulo.prod_partnumver2.focus();
}
}, ms);
}
</SCRIPT>
in this way use the onkeyup function,(not onchange) but wait 200ms in order to give me time
for shot with barcode gun
thank's

HTML5 Audio plays music but doesn't show controls in IE9

Regarding the audio on this page: http://ebonytay.com/site/composer.php?clip=getOutOfTown#mediaplayer
The audio controls show up in Chrome and Safari (and in Firefox locally. I'm having problems with a specific live server working but that's irrelevant). In IE9 however, the audio control is invisible. The music is still playing and if you right click on where it's suppose to be, you can play/pause it, it just doesn't show up.
I've tried messing with the z-index. I've tried putting it outside all the divs. I've tried using src= instead of source. I've tried using controls instead of controls="controls". I've tried using the audio tag directly sourcing the file, without any PHP/Javascripting. I'm fairly new to programming so I'm sure some of the code could be written simpler, but it shouldn't be breaking anything. Any help would be appreciated.
Here is all the code for the audio player (not incl. css) on the page:
<?php
$song = "overtureRedRockRise"; // set to starting song
$autoplay = ""; // disable autoplay on page load
$totalSlides = 1; //default amount of slides
$initialSlide = 1; //default starting slide
// Change song to URL parameter defined by links in #clip_nav div
if (isset($_GET["clip"])) // if URL parameter is ?clip=foo
{
$song = $_GET["clip"]; // $song is foo
$autoplay = "autoplay='autoplay'"; // enable autoplay when changing song
}
// Check how many slideshow images exist for current song
while (file_exists("../audio/filmClip_" . $song . "_" . $totalSlides . ".jpg"))
{
$totalSlides++;
}
$totalSlides--; // subtract 1 to get total number of slides for current song
?>
<script>
$(document).ready(function() {
var currentSlide = 1; //default starting slide
var totalSlides; //number of slides for current song
var song; //current song
var slideSpeed; //current slideshow speed
// Get variables from PHP
totalSlides = <?php echo $totalSlides ?>;
song = "<?php echo $song ?>";
// Setup slideshow speeds in milliseconds using JSON
var songSpeed =
[
['overtureRedRockRise',12000],
['getOutOfTown',7000],
['canyonBaby', 5000],
['celestialGuides', 10000],
['springback', 11000],
['hallelujas', 10000],
['myOnly', 8000],
['selfDefense', 10000],
['orchestral', 10000]
]
//go through each song in array
for (i = 0; i < 9; i++)
{
//find the current song
if (song == songSpeed[i][0])
{
//set current slideshow speed
slideSpeed = songSpeed[i][1] + 1000; //add 1 second for loading time
}
}
// Setup slideshow
function changeSlide()
{
// change current slide number
currentSlide++;
// Loop slideshow
if (currentSlide > totalSlides) { currentSlide = 1; }
// Display current slide
$('.song_image').attr('src', '../audio/filmClip_' + song + '_' + currentSlide + '.jpg');
}
// If song has more than 1 image
if (totalSlides > 1)
{
// Play slideshow
setInterval(changeSlide, slideSpeed);
}
// Indicate current song
$('div.filmClip_list.'+song).addClass('currentSong');
});
</script>
<h2><a id="mediaplayer"> SCORE AUDIO LIBRARY</a></h2>
<div id="audio_clips">
<!-- Song List -->
<div id="clip_nav">
<div class="filmClip_list overtureRedRockRise">Overture - Red Rock Rise</div>
<div class="filmClip_list getOutOfTown">Get Out of Town Firehorse</div>
<div class="filmClip_list canyonBaby">Lady Sedona Vortex</div>
<div class="filmClip_list celestialGuides">Celestial Guides</div>
<div class="filmClip_list springback">Springbank Park / Lawson Road</div>
<div class="filmClip_list hallelujas">Hallelujahs</div>
<div class="filmClip_list myOnly">My Only</div>
<div class="filmClip_list selfDefense">Self Defense</div>
<div class="filmClip_list orchestral">The Return of the Chevalier <i>(orchestral)</i></div>
</div><!-- end #clip_nav-->
<!-- Slideshow -->
<div id="image_holder">
<img class="song_image" src="../audio/filmClip_<?php echo $song ?>_<?php echo $initialSlide ?>.jpg" width="600" height="400" alt="Slideshow" />
</div><!-- end #image_holder-->
<!-- Audio -->
<div id="audio_player">
<audio controls="controls" preload="auto" <?php echo $autoplay ?>>
<source src="../audio/filmClip_<?php echo $song ?>.ogg" type="audio/ogg" />
<source src="../audio/filmClip_<?php echo $song ?>.mp3" type="audio/mpeg" />
Your browser does not support audio. Please upgrade your internet browser to the latest version here.
</audio>
</div><!-- end #audio_player -->
</div><!-- end #audio_clips -->
It's this rule in style_2011.css:
body.composer audio {
height: 32px;
width: 100%;
}
Specifically, if you set height to 45px or more then the controls will appear.
Just remove the height of the audio tag.