[plugin] Youtube player

  • Thanks rexrainbow, that's a very handy plugin, works great on nw.js too

    I just have one issue now, as the frame seems to lose "focus" in my case, meaning the youtube timeline doesn't come back as usual when hovering with the mouse...

    Then I have to click the frame to get back focus, which usually (annoyingly) pauses the video, but afterwards the controls work just fine on hover

    Sorry I can't provide a capx, as I haven't managed to reproduce it in a new project... (and my capx is quite huge), any idea what could cause losing the focus?

    I'm not using it in fullscreen, or full window, just a portion of my layout (btw you have a small typo "full windoe")

  • lemo

    I added "action: Set focused", and "action: Set unfocused", like official textbox object did. Hope it could help you.

  • Thanks rexrainbow, hmm still no luck for me though

    Hey I did some tests with all the elements in my projects, and I finally found a way to replicate in a simple capx

    It just happens with the TOUCH, after I click another element... TWICE?

    Same exchanging with a MOUSE click anyway, but I don't really why it doesn't loose focus at first o_O

    Here is a capx: YouFocus.capx

    Don't ever click the youtube object but just hover it

    If you press PLAY once you can still have focus and have the controls reappear on hover

    Press PLAY again and focus is lost for good

    (In my app I don't even get focus the first time)

    Btw I'm also highlighting a bug in this capx, the autoplay is "no" on both the object and the "load" action, and yet plays

  • Update

    Fix bug of autoplay = "no"

    lemo

    Even disable "action: set focus", this capx still works fine. I could start this video by 1 click. Tested in chrome, window7 64bit.

  • Hey rexrainbow, thx for update, I know the video starts just fine, it's not my issue

    It's really about the "focus on hover" behavior, so that when you hover the video, the controls from the player show up

    Try to hover after pressing PLAY once, and try to hover again after pressing PLAY again

    And to see the youtube UI again, change the volume, or see the timeline thumbnails, you have to click (and pause!) the player

    I thought in the meantime it would be good to have no autoplay in my case, so the user grab the focus before without pausing it in middle

    Although another problem maybe with the bug fix? I was expecting to see the video thumbnail and a play arrow button

    But if I set a "load video" with "autoplay no", it indeed doesn't play yet, but shows the "loading dots" instead of a nice video thumbnail?

    The "autoplay no" does show a nice thumbnail though if you launch it with the VideoID already in the object properties

  • lemo

    Try

    • set property "Show info" to "No", to hide the title shown while mouse hover. and
    • set property "Control bar" to "No" to hide the control bar in the bottom.

    Sorry I did not find a solution to show the thumbnail in the beginning.

  • rexrainbow

    Doh I'm starting to wonder if the quality of my written english is really that bad... let me try to explain again

    I am not trying to avoid the Youtube UI, on the contrary I do want it to show up on hover, so I'll really keep those to "Yes"

    Now, even when it's all setup as "Yes", the Youtube UI fails to show up on hover, after the "focus" is lost

    See the link below, I just made a video to show that more clearly

    https://drive.google.com/file/d/0B6wXdu ... VwNDg/view

    00:00 - 00:05: As you can see the player reacts on hover as the icon turns red

    00:12 - 00:22: The Youtube UI shows up fine after clicking PLAY, and when hovering the mouse

    I can scroll through the timeline thumbnail and change the volume on the go

    00:33 - 00:43: Focus is lost after another click and I can't see any controls while hovering

    I have to click the player, which pauses the video, then only I can control it

    00:43 - 00:59: The UI now shows up normally on hover

    And once again, in the case of my app, there's a few click before reaching the Play button,

    so the "focus" is already lost for the first play, making the control/pause situation a bit clumsy

  • lemo

    Now I understood.

    Unfortunately, I had not found solution for this issue on google. The html element of player got "onmouseover" event indeed, but the control bar and info did not show.

    Edit: I added a new "condition: on mouseover" to capture the hovering event, but I could not find a function to show control bar and info manually. They only set while youtube loading.

  • rexrainbow

    Well that sucks, yeah the player api docs don't seem to have that indeed

    Hey check out this other video, just playing around with the focus, before the video event load

    (same behavior when a video is playing anyway)

    -Click outside the player two separate times to loose focus

    -Subsequent clicks have no effects

    -Then a double-click OUTSIDE the player brings back focus to it

    Definitely something strange going on here o_O

    https://drive.google.com/file/d/0B6wXdu ... JwQ0E/view

  • hey rexrainbow, this could be a super-useful plugin

    1) is it possible to show stuff above the video?

    2) how to disable all input listeners on video, so it just playbacks, no matter what

  • xoros

    1) Youtube player is put at a div element, like all other html element objects (official textbox for example), sprites could not show above these html element objects.

    2) Set property "Control bar" to "No" to disable control bar. But the video still could be paused or resumed by clicked. Thus, add a condition to play the video while pausing ( sample capx )

  • Is there any other way how to show sprites above the video? Not plugin, but if it's technically possible at all

  • xoros

    I have no idea.

    Google map plugins also has this issue.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hey, I see you said that right now it isnt't possible to show other objects above the video. Although I dont need the video to be playing when I want the objects to appear, so I thought about taking a canvas snapshot but the snapshot won't show the video contents.

    Any idea if that can be achieved?

  • Tuiii

    It can't be now, since this youtube object does not have real texture.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)