Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

project help

Featured Replies

The trick is to swap the contents of a <div> using javascript and the inner.HTML command. The code below is a little rough but you hopefully should get an idea.

 

If you have lots of videos (and probably hosting them on YouTube) then the Youtube API could be worth looking at. A modified version of the stock code was used to create the radio station on lovelogic.net and all the code is visible (apart from the playlist creator but you won't need that)

 

<head>
<script type="text/javascript">
function showvid(vid){
if (vid == 1 )videoFLV='[< 1st flash video embed code >]';
 if (vid == 2 )videoFLV='[< 2nd flash video embed code >]';

var curtextval = document.getElementById("video_box");
curtextval.innerHTML = (videoFLV);	
</script>
</head>
<body>
<div id="video_box"></div>

<a  onClick="showvid(1)" href="#">first video</a>
<a  onClick="showvid(2)" href="#">second video</a>

</body>

It could be done but you will not like it.

 

HTML5 requires using at least two video files with different formats to show just one movie see: http://www.w3schools.com/html5/html5_video.asp and for older browsers you still need to add flash support.

 

HTML5 video and CSS

CSS can be made to start a video playing on-hover but it stops when the mouse moves away, there is no persistant switch using css. http://www.html5rocks.com/en/tutorials/video/basics/

 

Using PHP?

The video player would ideally need to placed inside the page using an iframe, because making a PHP request reloads the entire page. Without an iframe all the work on screen would be instantly lost.

Edited by Sogo7

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.