Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8998685
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:04:11+00:00 2026-06-16T00:04:11+00:00

I want to develop HTML 5 based slideshow with images and videos on full

  • 0

I want to develop HTML 5 based slideshow with images and videos on full screen. this will be some sort of screensaver on one of our kiosks when there is no user activity for a couple of minutes. we already have image based slideshow on full-screen implemented so there is no problem with this, but now we want to add Video auto-playback functionality as well so for example lets say this is the order of screensaver content

  • image.jpeg
  • image2.jpeg
  • videoclip.mp4
  • image3.jpeg
  • someothervide.mp4

after jquery script runs we want to run through those files continuously and either show image for few seconds or auto-start video and move to the next slide when playing video is finished

can someone suggest how to do this and if there are any already implemented plugins for jQuery can you provide with links?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T00:04:12+00:00Added an answer on June 16, 2026 at 12:04 am

    Actually this is pretty easy to solve. Find all explanations within the comments of the JavaScript. Wrap that all in a closure like $(document).ready(function () {}); and you’re ready to go.

    HTML

    <div id="canvas" class="canvas"></div>
    

    CSS

    div.canvas {
        display:           table-cell;
        width:             1280px;
        height:            800px;
        background:        black;
        vertical-align:    middle;
    }
    
    div.canvas > video {
        display:           block;
        margin:            auto;
    }
    
    div.canvas > img {
        display:           block;
        margin:            auto;
    }
    

    JavaScript – Variables

    // array containing links to the content
    var content = ['movie_1.m4v', 'movie_2.m4v', 'image_1.jpg', 'image_2.jpg'];
    // element where anything will be played
    var canvas = $('#canvas');
    // duration an image is shown in ms (milliseconds)
    var durationImage = 1000;
    // basic source for image and video tag
    var srcImage = '<img src="$" alt="">';
    var srcVideo = '<video autoplay><source src="$" type="video/mp4"></source></video>';
    // current position
    var current = -1;
    // regex for getting file extension (from http://stackoverflow.com/questions/680929/how-to-extract-extension-from-filename-string-in-javascript)
    var regex = /(?:\.([^.]+))?$/;
    

    JavaScript – Function

    // method to play the next content element
    function playNext() {
        // increase current element and set it to 0 if end is reached
        ++current;  
        if (content.length == current) {
            current = 0;
        }
        // get file and its extension and check whether it's valid
        var source      = null;
        var file        = content[current];
        var extension   = regex.exec(file)[1];
        if ('jpg' == extension) {
            source      = srcImage;
        }
        if ('m4v' == extension) {
            source      = srcVideo;
        }
        // if source seems valid
        if (null !== source) {
            // replace placeholder with the content and insert content into canvas
            source  = source.replace('$', file);
            canvas.html(source);
            // if content is an image play next after set duration
            if ('jpg' == extension) {
                setTimeout(function() { playNext(); }, durationImage);              
            }
            // if content is a video, bind 'onend' event handler to it, to play next
            if ('m4v' == extension) {
                canvas.find('video').bind("ended", function() {
                    playNext();
                });
            }
        }
    }
    

    JavaScript – Finally: initial function call

    // show first (remember current = -1 from above :) )
    playNext();
    

    Demo

    Demo on jsfiddle.net

    A note on the demo: The demo runs in Safari only (maybe in IE9 too) because of the video format provided (video/quicktime).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to develop one application where it will automatically (based on some logic)
I want to develop a web-based application for my employer. The application will allow
I want to develop a memory game; there will be 4x5 images in a
I develop some features based on Eclispe GEF. I want to create a label
I want develop some web product with using javascript 3d library like three.js But
I want to develop an app which can Block the Invocation of some Blackberry
I want to develop app which will recognize object(like monument or something) present in
I want to develop a delphi application with an HTML/CSS graphical user interface, not
I am new in PHP and want to develop one single file in PHP
Hi I develop a mobile app that has 5 html pages in one file.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.