[plugin] Youtube player

Post your completed addons to share with the community

Post » Fri Apr 08, 2016 11:03 am

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")
B
21
S
6
G
8
Posts: 328
Reputation: 6,611

Post » Mon Apr 18, 2016 2:40 am

@lemo

I added "action: Set focused", and "action: Set unfocused", like official textbox object did. Hope it could help you.
B
107
S
25
G
243
Posts: 4,391
Reputation: 137,474

Post » Mon Apr 18, 2016 6:14 pm

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
B
21
S
6
G
8
Posts: 328
Reputation: 6,611

Post » Tue Apr 19, 2016 4:06 am

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.
B
107
S
25
G
243
Posts: 4,391
Reputation: 137,474

Post » Tue Apr 19, 2016 7:20 am

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
B
21
S
6
G
8
Posts: 328
Reputation: 6,611

Post » Tue Apr 19, 2016 9:19 am

@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.
B
107
S
25
G
243
Posts: 4,391
Reputation: 137,474

Post » Wed Apr 20, 2016 5:51 pm

@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
B
21
S
6
G
8
Posts: 328
Reputation: 6,611

Post » Thu Apr 21, 2016 3:46 am

@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.
B
107
S
25
G
243
Posts: 4,391
Reputation: 137,474

Post » Thu Apr 21, 2016 4:39 pm

@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
B
21
S
6
G
8
Posts: 328
Reputation: 6,611

Post » Thu May 05, 2016 9:45 pm

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
B
45
S
11
G
4
Posts: 515
Reputation: 7,389

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: Valter Filho and 1 guest