Welcome to iPadForums.net Guest - Click Here to Register

HTML 5 video: Native + custom controls

This is a discussion on HTML 5 video: Native + custom controls within the iPad Development forums, part of the iPad App Store category; Hi, I have a video player (on a website) where I want the iPad to use native controls, but also add a custom button on ...

Register with iPad Forums
+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    iPad Noob!
    Member #
    97835
    Join Date
    Sep 2011
    Location
    Sweden
    Posts
    1

    HTML 5 video: Native + custom controls

    Hi,

    I have a video player (on a website) where I want the iPad to use native controls, but also add a custom button on the top half of the video.

    I am able to add elements on top of the video, but the elements doesn't respond to clicks or css effects (hover, active, click). If I remove the native controls, the buttons are clickable.

    Anyone has any idea how to solve this?

    /BR

  2. Ads


  3. #2
    iPad Noob!
    Member #
    98157
    Join Date
    Sep 2011
    Posts
    1
    I am facing the same problem on a project I am working right now.

    Apparently the video element, on the iPad, will swallow events if you use the controls attribute. You have to provide your own controls if you want the element to respond to touch events.

    I found this reason and a solution on stackOverflow.Since this is my first post on this forum I am not able to post links.So here is the solution that worked for a user named Nick

    I found a pretty nice work-around. I'm using jquery, so that's one thing to keep in mind.

    My issue was, I was building a Ipad web-app, with a navigation button at the bottom left (I can't give a link as it's a client project). When the user would click (tap) the button in the lower left, a drop-up menu would animate in, and then you could click the buttons in those menu's to get to deeper sub-menu's.

    The problem:

    any li tags (or anything for that matter) that was over the video, wouldn't be clickable, so on the pages with video, part of my tap-navigation (the part over the video wouldn't work). Reading posts here actually lead me to my solution, simple, and it may or may not work for your case, but I hope it does.

    My workaround:

    var myNav = $("TAG_SELECTOR_HERE");

    myNav.toggle(function(){
    var videos = $("video");
    videos.removeAttr("controls");
    },
    function(){
    var videos = $("video");
    videos.attr("controls","true");
    })
    Now I know I may be missing some semi-colons, or my coding may be off, but I'm just posting for reference. Basically, when my menu is clicked, or is active, I'm removing the controls attribute from all videos, and then when the menu is deactivated, I'm bringing the controls back.

    You could use this method anywhere you like...you could remove the controls after a video ends, after someone hovers over something (assuming that something isn't already over the video), when the mouse is within certain coordinates (may be your only solution in extreme cases) but this should work.


    I am gonna try this solution for my project today.

    sunnyM


Home | Forum | Active Topics | What's New

Advertisements

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Similar Threads

  1. Video player with slow motion controls
    By ajc in forum iPad Apps
    Replies: 2
    Last Post: 08-12-2011, 11:06 AM
  2. Any iPad Video Players that disable controls?
    By pgertner in forum iPad General Discussions
    Replies: 0
    Last Post: 04-10-2011, 06:48 AM
  3. iPad video controls
    By Cheviot in forum iPad General Discussions
    Replies: 7
    Last Post: 01-12-2011, 02:59 PM
  4. App to disable video controls
    By Vtcyclist in forum iPad Apps
    Replies: 2
    Last Post: 12-27-2010, 11:43 AM
  5. Unable to view Html 5 video in ios 3.x
    By sureshkesani in forum iPad Help
    Replies: 2
    Last Post: 10-16-2010, 08:11 AM

Search tags for this page

html 5 video controls

,
html ipad controls
,
html5 video controls ipad
,

html5 video custom controls ipad

,

html5 video disable controls

,
html5 video remove controls
,
ios html5 video controls
,

ipad html 5 video cotrols

,

ipad html controls

,
ipad html5 video controls
,

ipad html5 video custom controls

,
problem custom controls for html5 video ios ipad iphone
Click on a term to search for related topics.

Tags for this Thread