Pause/stop a youtube video

It seems this question has been asked before with no definitive solution, so I thought I'd try my luck.
Here's how the video is embedded on compositionReady:
var youtubevid = $("<iframe/>");
sym.getSymbol("intro2").$("videoContainer").append(youtubevid);
youtubevid.attr('type','text/html');
youtubevid.attr('width','387');
youtubevid.attr('height','218');
youtubevid.attr('src','http://www.youtube.com/embed/qHxn1_2KfCU?enablejsapi=1');  // url/Video_Id
youtubevid.attr('frameborder','0');       // 1 | 0
youtubevid.attr('allowfullscreen','0');   // 1 | 0
I understand that in order to play/pause/stop a youtube video, you have to go through the API:
https://developers.google.com/youtube/iframe_api_reference#Functions
It looks like the function I would want to use here is:
player.pauseVideo();
So here are the two methods I've tried with no success:
youtubevid.pauseVideo();
sym.getSymbol("intro2").$("videoContainer").youtubevid.pauseVideo();
Any suggestions? Thank you.

I figured out how to reset the Youtube video upon hiding thanks to FigFrance's contribution to the thread found here:
https://forums.adobe.com/message/4979969#4979969
The secret was adding .empty() to my video container.  Here is my functioning button code:
Show Video:
//code to embed youtube into symbol
var youtube = $("<iframe/>");
sym.$("video").empty().append(youtube);
youtube.attr('type', 'text/html');
youtube.attr('width', '640');
youtube.attr('height', '360');
youtube.attr('src', 'https://www.youtube.com/embed/MyFv6UKsW70?rel=0');
youtube.attr('frameborder', '1');
youtube.attr('allowfullscreen', '0');
// Show an element
sym.$("video").show();
Hide Video:
sym.$("video").empty();
// Hide an element
sym.$("video").hide();
Brandon

Similar Messages

  • Safari randomly stopped playing Youtube videos

    Just the other day Safari stopped playing Youtube videos. I have tried running safari in 32bit mode but nothing. I would appreciate any info or help, thanks.

    I went to http://www.youtube.com/html5 and found that I was part of the HTML5 trial for YouTube and that YouTube videos should be playing via HTML5 and not Flash.
    I left the HTML5 trial so that the video were being played by nasty old Flash... Guess what, it works.
    Videos are now playing normally using Flash.
    My suggestion is go to http://www.youtube.com/html5 and see if you are part of the HTML5 trial also, if you are, leave the trial and see how you go.
    Lee

  • How do you stop multiple Youtube videos from playing at the same time?

    As of a few days ago, when I click on a youtube video, as the commercial begins to play, you can begin to hear multiple/different commercials playing at the same time. After the commercials, the same issue occurs with the main video--multiple videos are being played at the same time and are not in sync. I've updated all my plug ins and have tried the suggestion posted in the forum provided in the link below in which someone else has expressed the same issue, but nothing has worked so far. Does anyone know what can be done?
    http://productforums.google.com/forum/#!topic/youtube/5Lnikma4UqM

    Are you loading those videos as Flash or HTML5? It is possible to prevent videos from playing until you click something with Flashblock for Flash or Stop Tube HTML5 for HTML5. You can also stop the commercials with Adblock Plus with an Easylist subscription.
    * https://addons.mozilla.org/en-US/firefox/addon/adblock-plus/
    * https://addons.mozilla.org/en-US/firefox/addon/flashblock/
    * https://addons.mozilla.org/en-US/firefox/addon/stop-tube/

  • Stopping a Youtube video

    Hi,
    I know there is a disscussion running on this, but to be honest I didn't understand it...
    I'm creating an interactive about the Terezin concentration camp and it need youtube video's embeded within it. The problem is that these videos are/will be, held within symbols and I need them to stop when a button/buttons are clicked on (For example Anka and Eva's Story).
    I have attach a copy of my graphic. It is very rough as I have just started pulling all of the data together for it.
    https://dl.dropbox.com/u/76384410/Youtube_Help.zip
    Can anyone help me please?
    Thank you very much,
    Christine

    Hi Chrissie, you can use the empty(); method to clear out the youTube player.
    Revised Source:
    http://www.timjaramillo.com/code/edge/_source/Youtube_stop_video.zip
    I added this code on Stage.compositionReady:
    // call this on click of any menu button to clear out video
    sym.stopVideo = function()
              sym.getSymbol("Page_one_sym").$("vcontainer").empty();

  • Safari stops playing youtube videos

    Recently when playing You Tube videos I find that the playback overtakes the downloa, thereby stopping.
    This happens with Safari and Firefox.
    To clarify: The grey part of the progress bar does not stay ahead of the red playback bar.
    I never had this problem before. I just switched from cable to Fios and have a higher band width then I had with cable.
    I trashed the User>Home>Library>Preference, but that didn't fix the problem.
    I have a 250GB HD with 172 GB available.
    Any advice on how to correct this is appreciated.
    Thanks.

    First of all you should make sure that you have the latest version of Mac OSX. It's latest version is 10.6.8. Also you should make sure that you have the latest version of Safari browser on your Mac. If you have already have latest version of Safari browser and Mac OSX or updated your Safari browser and Mac OSX and this problem occurred again trying to download latest version of Flash Player and Shockwave Player. After downloading these two plugins for your browser if problem occurred again trying to reinstall your browsers.
    I hope your problem solve with these tricks.

  • Anyone have issues with audio stopping on youtube videos?

    I will play the same video a few times but lately when I play it the audio stops working. This happens when I am connected with headphones or when I am playing the video over the phones speakers. I have also verified that the volume is turned up. I thought at first it could be the individual video being watched but now  I am not so sure as this is the second video that has done this.
    Feedback is appreciated.
    Thanks

        Hello d4a1985,
    I'd love to help you figure this out! Normal wear and tear does not void the warranty, but damage such as a crack or a break would. Since we are unable to see the device, if you are unsure, we suggest bringing it in to the Verizon store for an evaluation.
    Thanks,
    MichelleH_VZW
    Follow us on Twitter @VZWSupport

  • Why sound stop when youtube video playing?

    the imac 0s&system software>os x mountain Lion i don't know doesn't working with my imac computer i don't know why?

    The iPad's work.  I believe that we will see some iOS improvement with version 5. I hope with the iOS 5 update for ATV2 will help as well. Maybe even a bluetooth keyboard for 'Safari for Apple TV'

  • Safari in 64-bit mode on Snow Leopard does not play YouTube videos

    Recently Safari stopped playing youtube videos while Safari is in 64-bit mode. The entire page renders correctly; however the area where the video is supposed to play remains a black box without controls. I can watch video from other sites, or I can watch video from youtube if I use another browser like firefox. Additionally, I can go to the youtube video owner's channel and view videos there just fine. It's only when I try to view videos that use the "http://www.youtube.com/watch?v=" method of displaying a video using Safari in 64-bit mode that it fails to play -- it plays fine with Safari in 32-bit mode.
    Flash Version: 10,2,152,26
    Message was edited by: Annorax64

    scotso22 wrote:
    @Annorax64: are you sure the problem is limited to the latest Flash Player? I'm pretty sure I was still running 10.1 when I first saw it, after getting an error "Safari Flash Player (Safari Internet plug-in) quit unexpectedly."
    Upgrading to 10.2 didn't help.
    It's not !. Flash player 10.1 is no better (as you can verify by downgrading here http://kb2.adobe.com/cps/142/tn_14266.html)

  • Embedded Youtube video sound issues HELP!!

    Hello.
    This is my site http://mattpartridgeanimation.com/
    In my 'animation' section I'm loading youtube clips to my site using this AS3 script found here.
    This all works fine but when i use my buttons created in flash to load the new container_mc, the sound of the old video keeps playing. Does anyone know any AS3 script that will stop the youtube video sound playing when you click to load another video.
    I'm pretty new to all this so any help would be great. Cheers

    Hi,
    I found the same problem but, according to YouTube AS3 API reference, I solved it with the special function:
    player.destroy();
    It works. Just replace "player" with the instance name of your youtube player.
    Quote from the documentation:
    You should always call player.destroy() to unload a YouTube player. This function will close the NetStream object and stop additional videos from downloading after the player has been unloaded. If your code contains additional references to the player SWF, you also need to destroy those references separately when you unload the player.
    Best,
    Toz

  • Newest versions keeps stopping youtube videos even though they appear as fully buffered

    As the title said I've had this problem for quite some months now with the lastest versions of Adobe Flashplayer. The problem is that whenever I watch a youtube video(using firefox), with the newest version of flashplayer, it takes noticeable much longer to start the video than with a older version of flashplayer. When the video has started it runs fine for some time (buffer is at 100%) and the video just randomly stops, notice that the "play icon" in the bottom left shows as if the video is still playing (i.e. you see the 'pause icon' as if the video is still playing). No buffer icon is shown in the middle of the video (because it doesn't buffer). In order to be able to keep watching the video I have to drag the "time picker" back before this occured and play it again just to skip over the time it happened. Example: I watch video X, video X stops at 00:43. I back the video up to 00:25 and press play, video plays as normal, i drag the time to jump over 00:43 and press play again, video starts buffering again and i can keep watching the video, may occur several times in the same video. At the moment I'm using flashplayer 10.1 but every website keeps ******** about that the version is out of date so I'd like to update to the latest version but without these problems..
    Almost forgot: Using win 7 x64.
    Hope you guys understand my problem and are able to help me!
    Regards

    bump, need help!

  • YouTube videos stop and I have to press play time and again. Is there a fix?

    When playing a YouTube video... It stops as if the pause was selected. I have to press play time and again to work my way through it. Is there a fix?

    This is usually caused by an internet connection that is not fast enough to keep up with the playing of the video. Once the video reaches the end of what has been download, it pauses. You have to tap and then tap play to start it up again. Once it pauses it's best to wait until more video has been uploaded before tapping play again.

  • Youtube Videos Stop Playing

    Lately when I go to watch youtube videos the video will play for maybe two seconds before stopping. At first I thought the video was just buffering then I realized that the transparent red line that shows how much the video has loaded was all the way to the end. So I then tried to pause and unpause the video but it still wouldn't play. This is very frustrating. I haven't been able to watch youtube videos on my phone for about a week now. Is anyone else having these problems? Any solutions? Thanks.

    I know an update from last week caused a similar problem. But they updated the Youtube app a day after.
    Make sure you have the latest Youtube update.

  • Airplay stops when YouTube app is sent to background - every second video

    When I send a YouTube video to Apple tv and then switch to another app all is ok. However when I switch back to YouTube and start to Airplay another video and switch to another app again it stops Airplay streaming on Apple TV.
    I have to bring YouTube to front, click airplay icon, select Apple TV again and press play. Then I can switch to another app and Airplay continues. Then next video and Airplay stops again.
    So in simple words every second video plays ok and every second does not.
    Is it a bug or is it just me?
    I have iPhone 3GS.

    okay spoke a little too soon - deactivate is fired off on any
    time the app loses focus, not necessarily when it stops playing. Is
    there an event which signals right before the player is going to be
    paused? Thanks!

  • How do I stop Thunderbird playing youtube videos in a tab

    For ages I've been trying to get Thunderbird to work how it used to work but I seem to be fighting a loosing battle. I have done everything I can do to try and stop Thunderbird from ever using tabs. The latest thing I'm trying to stop is Thunderbird playing YouTube videos in a tab. Often I get emails with videos in them that play really small. If I click in the fullscreen option in the video it doesn't work and I've no idea why? So I click on the YouTube link in the video and I want it to open in Firefox. But instead it opens in a tab. This would be okay except that it plays really slowly and I can't reposition the tab. This is one of the reasons why I hate tabs in Thunderbird. I want to read things (or watch videos) in the centre of my screen, not where Thunderbird decides to open a tab, which is usually in the top right of my screen. With a very large screen it is much more frustrating than it would be on a laptop or other small screen.
    Can someone please tell me how to fix this?
    Another thing I would like to fix is the search function. I use search all the time and it is very powerful/useful. But again, when I click on the search results it opens the result in a tab. It would be okay if it opened a tab in the search results window but it opens the tab in the main Thunderbird window. It may also be okay if search opened a tab. But opening search in a new window and then showing the search items in a tab on the main window is just so frustrating. It almost makes me want to stop using search. I looked at using X Search Desktop for search but it no longer supports Thunderbird.
    Again, can someone please tell me how to fix this?
    I absolutely love Thunderbird but I really wish it were possible to roll back the changes that have been made in a number of areas. I spend so much time looking for add-ons just to get it back to how it used to be. With every new version there seems to be another change to the interface. I have to use "manually sort folders" just to get the folders to be in the order I want them. Like everyone else I want the security fixes that come with new versions but I don't want interface changes forced on me for no reason.
    But now so many add-ons seem to stop working with each new release. I used to have an add-on that provided two simple buttons to increase/decrease the text size of incoming emails/RSS feeds. It also allowed me to set the font size/type I wanted for each incoming email/RSS feed and overide whatever was originally set. That stopped working a while back and I'd love to know if there is an alternative. Some RSS feed fonts are now set for smart phones and are simply massive in Thunderbird.
    If anyone can help me with these issues I'd be most grateful.

    You can check the home page (startup) setting:
    *https://support.mozilla.org/kb/How+to+set+the+home+page - Firefox supports multiple home pages separated by '|' symbols
    If you do not keep changes after a restart then see:
    *http://kb.mozillazine.org/Preferences_not_saved

  • Why do some YouTube videos stop playing after a short time?

    Since sometime in October, 2013, I have noticed that more and more YouTube videos stop playing within a minute of starting. Most that stop do so in 15 or 16 seconds. The playing stops because the download stops. I watch this on a network activity monitor I always have running. Not all videos do this, but the problem is becoming more and more frequent. Some videos which played correctly for me in the recent past are now exhibiting this problem.
    Other than installing the latest Firefox updates I have NOT changed the software on my machine. I run Linux by the way. I do not think this is a Linux problem because (1) it was all working before and (2) my son who runs both Mac OS X *and* Windows is also seeing the same problem. We both use Firefox as our browser on all our platforms.
    I should also note that I am NOT seeing this problem with any of the other video websites I use, only when I go to YouTube. That leads me to believe that the problem is not in Firefox; if it were it should affect videos from all websites.
    Additionally the problem occurs whether or not I log into YouTube.
    I have not run Firefox in safe mode because all the extensions I use did not affect the download of Videos before, so I don't expect unchanged extensions to suddenly start causing problems.
    So, anyone else see this problem? (There was another note which talked about the same problem but it was disabled.)
    Also -- pardon my paranoia, but -- I need to ask: Since YouTube is owned by Google and Google has its own browser it wants you to use, Chrome, is it possible that Google is intentionally causing some YouTube videos to fail if it sees that they are being sent to Firefox?
    (That is not so outlandish I think. Microsoft WAS at one point caught mangling web pages going to certain web browsers other than IE. And these days Google wants to dominate the Internet just as badly as Microsoft does, so why not pull dirty tricks too?)
    If this keeps happening I am going to have to try Google's Chrome to see if it somehow manages to play YouTube videos correctly while Firefox does not. But I really do NOT want to install Chrome because I trust Google about as much as I trust Microsoft, which is to say Not At All.
    Thanks in advance.

    Hello,
    There have been some issues with Flash 11 in the recent past. This could be a manifestation of that issue. Kindly check this response below to see if this helps you in viewing Flash videos.
    Also, if you want to check if this is a flash problem and specifically on youtube, you can try the HTML5 version of Youtube. In this, there are no plugins involved, and the browser natively renders the videos. You can signup for the HTML5 trial by visiting http://youtube.com/html5. Please try that and check if the issue goes away.
    Also, in this case, Google might not be doing anything sinister - they generally try to be standards compliant too. You can definitely try installing Google Chrome and test this issue, but we definitely would want you to continue to be a Firefox user :)
    <hr>
    Some problems with Flash video playback can be resolved by disabling hardware acceleration in your Flash Player settings. (See [[Flash Plugin - Keep it up to date and troubleshoot problems|this article]] for more information on using the Flash plugin in Firefox).
    To disable hardware acceleration in Flash Player:
    #Go to this [http://helpx.adobe.com/flash-player/kb/video-playback-issues.html#main_Solve_video_playback_issues Adobe Flash Player Help page].
    #Right-click on the Flash Player logo on that page.
    #Click on '''Settings''' in the context menu. The Adobe Flash Player Settings screen will open.
    # Click on the icon at the bottom-left of the Adobe Flash Player Settings window to open the Display panel. <br/> <br/>[[Image:fpSettings1.PNG]] <br/>
    # Remove the check mark from '''Enable hardware acceleration'''.
    # Click '''Close''' to close the Adobe Flash Player Settings Window.
    # Restart Firefox.
    This [http://www.macromedia.com/support/documentation/en/flashplayer/help/help01.html Flash Player Help - Display Settings page] has more information on Flash Player hardware acceleration, if you're interested.
    <hr>
    Also, try this one too
    Recent crashes of certain multimedia contents (this includes Youtube videos, certain flash games and other applications) in conjunction with Firefox are most probably caused by a recent Flash update and/or a malfunctioning browser plugin such as Real Player.
    In order to remedy the problem, please perform the steps mentioned in these Knowledge Base articles:
    * [[Flash Plugin - Keep it up to date and troubleshoot problems]]
    * [[Flash 11.3 crashes]]
    * [[Flash 11.3 doesn't load video in Firefox]]
    Other, more technical information about these issues can be found under these Links:
    * http://forums.adobe.com/thread/1018071?tstart=0
    * http://blogs.adobe.com/asset/2012/06/inside-flash-player-protected-mode-for-firefox.html
    Please tell us if this helped!

Maybe you are looking for