Getting YouTube video to stop when ap div is hidden

Hello.
I created a page where I inserted youtube videos in to ap divs stacked together and accessable via show/hide. However, if you play one video and select a link to move to the next video, the original video's audio can still be heard unless you manually stop the video before moving on.
I was wondering if there was a code to stop video when it's ap div is hidden.
Thank you!

Sorry.  I don't know how you can do this with a YouTube video because you don't have access to the Flash file.  If this were your own flash file, you could program  a closing "X" over the Flash to stop player first, then execute the JavaScript to hide layer.
As an alternative, have you considered using a multi-video player with  XML playlist?  I haven't had time to test this with YouTube video links yet, but it looks promising.
Flex Multi-Video Player Project code here
http://code.google.com/p/flexvideoplayer/
Instructions (video  tutorial)
http://www.youtube.com/watch?v=pAVW7z5siUs
Nancy O.
Alt-Web Design & Publishing
Web | Graphics | Print | Media  Specialists
www.alt-web.com/
www.twitter.com/altweb
www.alt-web.blogspot.com

Similar Messages

  • YouTube videos keep stopping on IPad. How to fix?

    YouTube videos keep stopping on IPad. How to fix?

    UPDATE: fixing iPad Sound after iOS 7
    http://youtu.be/SDf1LDcE95Q
    (1min 36sec)
    It covers the basics:
    checking side-switch / mute / "Control Center"
    volume all up
    ...and also the worst cases:
    closing all apps (for rare cases when a single app might render the sound system instable)
    rebooting the iPad
    So, don't get desparete: try the things in the video.
    There are people who reported having forgotten an audio-bluetooth connection activated with a turned-off sound-system or speakers... or forgot Air-Play turned on... so be sure you disengage bluetooth and/or airplay.
    On the 'hardware side', dirty dock connector (30 pin) can make the iPad 'think' it is connected to external audio - if so, cleaning it with a dry toothbrush can fix. Also, moisture in the headphones connector can make the iPad switch to 'headphones' even without headphones connected, making it silent: check if you can hear things with headphones plugged in - if so, try gently inserting and removing headphones a few times and check if you get sound back to iPad's speakers alone.
    Good luck to everybody! Audio problems are quite common - fontunately they are easy to fix.

  • Youtube videos sometimes stops in a middle

    Only sometimes youtube videos just stops and hangs in a middle. When I relode the safari page the same thing hapens in about 20 seconds. It is very frustrating. My wifi conection is very strong and stable, I also tried reinstaling flash player couple times but nothing helped. Please help me.

    Hi Mariana,
    Please make sure you have the autoplay checkbox selected from the fly-out options:
    Regards,
    Akshay

  • Macbook is slow to load webpages and youtube videos are stopping

    I just recently purchased a Macbook pro, however, its been slow to load webpages, youtube videos, etc.  The youtube videos frequently stop playing and I have to reload the page.  Its not the connection and I havent had the computer long enough to have to clear safari chache.  WHY

    Sorry to bump this, but I'm having the same issue, though it's not a poor router problem (upgraded that hoping it would fix it).
    I tried the OpenDNS and it helped once, then stopped loading Netflix (Netflix, Youtube, and Facebook seem to be common problems, as well as "new" webpages that I don't go to often). If I connect directly to my Ethernet the internet works great. My iPhone connected to WiFi works great. It's just my Macbook pro and it just recently happened when I moved to my new house (I had the same ISP at an apartment and had 0 issues). Any thoughts?

  • Getting message "video card full" when trying to update imovie 08 to 11...just updated to to OS X 10.7.5.  What to do??

    getting message 'video card full" when trying to update imover 08 to 11...I have just updated to OS X10.7.5.  What to do?

    getting message 'video card full" when trying to update imover 08 to 11...I have just updated to OS X10.7.5.  What to do?

  • Getting YouTube videos...

    Hey Guys,
    I was just wondering how to get YouTube videos onto my Touch. Can you download to the Touch directly from the website or is there another way? Thanks.

    Hey meandefense,
    YouTube videos are streamed to the iPhone. This video explains how-to watch YouTube videos on the iPhone.
    http://www.apple.com/iphone/features/index.html#youtube
    Jason

  • Why does video out stop when ipad screen locks?

    Why does video out stop when ipad screen locks?

    Thanks.  I should have been more specific.  I am watching using video out cables to the TV, and would like to watch the entire episode without unlocking the screen every five minutes.

  • PBS POV video streaming stops when I order actual program to begin. Am up-to-date re PBS, in USA. Never happened before. Started when had POV ready to go when Avira Free Mac Security signalled download available;"told" to wait.Deleted Avira but nadaut noh

    PBS POV video streaming stops when I order actual program to begin. Am up-to-date re PBS, in USA. Never happened before. Problem started  when  had POV ready to go and Avira Free Mac Security suddenly signalled download available--;"told"it  to wait.Deleted Avira but still fails to stream. Presently: screen jumps but remains dark when I order the streaming. Any suggestions, please?  Harry H.

    hello sir,
    i want to your help
    i was installed fresh windows 7 via cd rom and then after installed all software.
    and now after 1 day customer complained me that cd rom not read any cd and i m also check when i insurt cd so its not read and when i am double click on cd rom icon its eject so what i do for that please reply on my email address.
    [text removed for privacy]
    VIMAL

  • I have a Mid 2009 Macbook Pro 13 with no restore disk; it has OS 10.8.4 I believe there is something wrong with the OS due to I can not install flash player to view Youtube videos and the when we plug in a Bose headset the sound out will work sometimes

    I bough a used Macbook Pro mid 2009 that came with OS 10.8.9 it didn't have a backup restore disk with S/N W8******66D
    When trying to view some youtube videos; a window would pop up saying "it needs adobe flash player is required for video play back get the latest flash player" but after downloading the file and during installation would have errors and will not installed.....tried to reboot and install again.....but still the same.
    The othe thing I had noticed is when using a good Bose headset with mic the sound output would noticed the headset and then switch from headset to Internal speekers and headset.....thinking that there might be something wrong with the plug in port of the computer or the headset.....the headset works with no issues on my iPad so there must be something wrong with the computer.....tried to move the plugin around the port but no change....while the headset is plug in can hear a short clicking noise and the sound would get lost and back again......but with nothing plugin to the port there is no issue with the sound or mic.
    Thanks for your feed back......it looks like I have two different issues one is a software issue and the outher is a hardware issue
    <Edited By Host>

    The "restore disk" is built into the Mac. See About Recovery.
    Need more specifics about what error messages you got while installing Adobe Flash.
    However, you can almost avoid Flash altogether by setting YouTube to play the HTML5 version instead.
    Click the Try something new! link at the bottom of the YouTube page.
    I don't know about the sound issue. Might be hardware as you think. Try other headphones to check.

  • I can no longer get Youtube videos to play in Firefox (v5 on Win XP), while I can with Google Chrome - any ideas?

    When I call up a Youtube video I just get a black rectangle - bo picture, sound, etc. Videos from other sources seem to play OK.

    Clear the cache and the cookies from sites that cause problems.
    "Clear the Cache":
    * Tools > Options > Advanced > Network > Offline Storage (Cache): "Clear Now"
    "Remove Cookies" from sites causing problems:
    * Tools > Options > Privacy > Cookies: "Show Cookies"

  • I can't get YouTube videos to play

    I was "cleaning" up some odd files that I noticed were on the hard drive and must have eliminated something important.  Don't ask me what I deleted! Anyway, now I can't play any video that links to YouTube.  I get the "Page cannot be located" error.  So after some searching, I found a post that said I needed to uninstall/reinstall Flash Player.  So I've now done the uninstall.  But when I go to the Adobe.com website and start the download for the latest version that'll work on my setup, again I get the "Page cannot be located" error.  When I try to go to customer service on the Adobe.com website, I also get this same "Page cannot be located" error.  Talk about frustrating!
    Does anyone have a suggestion?  I do still have an older version of Flash Player ".dmg" file on the computer (version 11 vs. currently available version 14) and wonder if I should install the older version and then see if it will update to the current version...
    Please help!
    Pat

    I had the same problem when I updated Flash last time.  Later versions of Flash screwed up all YouTube videos on a Mac still running Snow Leopard. 
    The last version of Flash I've used that works with Snow Leopard and YouTube (and almost any other web video) is 12.0.0.77.  This may be due to a Safari issue with Snow Leopard--I'm running 5.1.7.  Adobe says you have to change your Safari prefs/security to "Allow all plugins" and "Allow Java", but neither of these prefs appear in my version. 
    It's unfortunate, because Flash updates address security issues. 

  • Embeded Youtube video not displaying when scaled

    I'm embeding a youtube video using this method:
    var youtubevid = $("<iframe/>");
    sym.$("vcontainer").append(youtubevid);
    youtubevid.attr('type','text/html');
    youtubevid.attr('width','540');
    youtubevid.attr('height','380');
    youtubevid.attr('src','http://www.youtube.com/embed/YNuG2ZhVrDI?rel=0&autoplay=1'); 
    youtubevid.attr('frameborder','0');
    youtubevid.attr('allowfullscreen','0');
    This works fine.  But, as soon as I add the below code to scale the stage the video is just black(no controls either) but the audio plays.  Any idea why this would be happening?
    var stageHeight = sym.$('Stage').height(); // Set a variable for the height of the stage
    sym.$("#Stage").css({ // Set the transform origin so we always scale to the top left corner of the stage
    "transform-origin":"0 0",
    "-ms-transform-origin":"0 0",
    "-webkit-transform-origin":"0 0",
    "-moz-transform-origin":"0 0",
    "-o-transform-origin":"0 0"
    function scaleStage() {
        var stage = sym.$('Stage'); // Set a reusable variable to reference the stage
        var parent = sym.$('Stage').parent(); // Set a reusable variable to reference the parent container of the stage
        var parentWidth = stage.parent().width(); // Get the parent of the stage width
        var stageWidth = stage.width(); // Get the stage width
        var desiredWidth = Math.round(parentWidth * 1); // Set the new width of the stage as it scales
        var rescale = (desiredWidth / stageWidth); // Set a variable to calculate the new width of the stage as it scales
    // Rescale the stage!
         stage.css('transform', 'scale(' + rescale + ')');
        stage.css(  '-o-transform', 'scale(' + rescale + ')');
         stage.css('-ms-transform', 'scale(' + rescale + ')');
        stage.css('-webkit-transform', 'scale(' + rescale + ')');
         stage.css('-moz-transform', 'scale(' + rescale + ')');
        stage.css('-o-transform', 'scale(' + rescale + ')');
        parent.height(stageHeight * rescale); // Reset the height of the parent container so the objects below it will reflow as the height adjusts
    // Make it happen when the browser resizes
    $(window).on('resize', function(){
         scaleStage();
    // Make it happen when the page first loads
    $(document).ready(function(){
        scaleStage();

    Just curious why are manually scaling the stage when responsive scaling in available in Animate CC 3.0 itself?

  • Youtube videos really pixelated when resuming or fast forwarding

    Since a day or 2 now, the youtube videos get Veeeery pixelated, it affects any video, when it should be looking like this http://puu.sh/87hD5.jpg it looks like this http://puu.sh/87hzs.jpg , It's VERY annoying, i already tried to disable all the extensions to no avail, and my graphics card should be able to handle material acceleration, and even when it's deactivated it continues anyway. (Gtx 660)

    What is the resolution that is currently used in the Flash media player?
    You can check for problems with current Shockwave Flash plugin versions.
    *http://kb.mozillazine.org/Flash#Troubleshooting
    Clear the cache and cookies only from websites that cause problems.
    "Clear the Cache":
    *Firefox/Tools > Options > Advanced > Network > Cached Web Content: "Clear Now"
    "Remove Cookies" from sites causing problems:
    *Firefox/Tools > Options > Privacy > "Use custom settings for history" > Cookies: "Show Cookies"
    You may have to clear all cookies (time range everything) via Clear Recent History to clear data stored in local storage as well.
    You can also try to clear the Flash local storage and settings.
    *Windows Control Panel > Flash Player > Storage: Local Storage Settings
    **Remove a specific domain: Local Storage Settings by site
    **Remove all domains: Delete All and Delete Data
    Flash Website Storage Settings panel:
    *http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager07.html
    Global Storage Settings Panel:
    *http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager03.html

  • How do I stop YouTube videos from stopping after 14 seconds?

    For a couple of days now I've found that some, but not all, Youtube videos stop at the 14 second mark. I've also noticed that the buffering bar also stops there. I have already tried deleting my history, cache and cookies. I've also uninstalled and reinstalled Adobe Flash. I've also tried turning off the computer and unplugging the modem for 30 seconds before rebooting. None of those things worked. I have TubeEnhancer. Is that causing this to happen? I have the latest versions of Adobe Flash and Foxfire.

    Try disabling that extension, as the reviews look like it could be faulty: https://addons.mozilla.org/firefox/addon/youtube-enhancer-plus/
    You can do that on the Add-ons page. Either:
    * Ctrl+Shift+a
    * "3-bar" menu button (or Tools menu) > Add-ons
    In the left column, click Extensions.
    Often a link will appear above at least one disabled extension to restart Firefox. You can complete your work on the tab and click one of the links as the last step.
    Looking at your list of disabled extensions, I think you might have installed a bundle of unwanted software. To clean those out, I suggest a visit to the Windows Control Panel, Add/Remove Programs. If you click the "Installed on" column heading and view the list grouped by date, that may help in uncovering bundle items that you never intended to install. Take out as much trash as possible here.

  • How do I get youtube videos to play

    Hi I'm unable to play youtube videos on my phone. I get the message 'an error has occurred' I'm on the giffgaff network and its been suggested that it's because they can't send the service book for youtube. Is there a way around this please without messing with the youtube address/ link everytime I want to watch a video? I have downloaded the youtube icon but still nothing Thank you for your time

    This doesn't seem like a pratical workaround but read this:
    http://community.giffgaff.com/t5/Help-Support/quot​-An-error-has-occurred-attempting-to-play-media-qu​...
    Are you able to watch youtube videos using WiFI?
    http://btsc.webapps.blackberry.com/btsc/viewdocume​nt.do?externalId=KB33330&sliceId=2&cmd=displayKC&d​...
    I also referenced
    http://supportforums.blackberry.com/t5/BlackBerry-​Tour/quot-An-error-has-occurred-attempting-to-play​...
    Please click the Thumbs Up icon if this comment has helped you!
    If your issue is resolved, please click the solution button on the resolution!
    Every BlackBerry should have BlackBerry Protect, get it now! | Follow me on Twitter | Bring Back BBM Music!

Maybe you are looking for