YouTube Player


YouTube Player 1.0.7
​


by Biud436
​



​


Introduction


This plugin allows you to start playback of the YouTube video.


Video


In general, In Android Chrome and Mobile Safari, It doesn't automatically start playback. and you can also stop the video by clicking around the YouTube video. If you watches the video until the end, This plugin will automatically end the video playback.



How to Use

Spoiler
  • Adding a Plugin to your Project

Download the plugin and place it in the folder called your_project_directory/js/plugins. Then In Plugin Manager, Select the RS_YoutubePlayer plugin and add it.

  • Plugin Commands


This plugin command will start playback of the YouTube video.


Please enter the URL as follows.



YTPlayer play URL


Stop playback of the YouTube Video.

Code:
YTPlayer stop



Mobile Compatibility Table

Spoiler
Auto Play / Speed
Firefox for Android : FALSE / Slow
Chrome for Android : FALSE / Normal
Cordova Browers : FALSE / Normal
Intel XDK (HTML5 + Cordova) : TRUE / Fast



Plugins


This plugin can download in the following link.


Github RAW


Change Log

Spoiler
2016.05.08 (v1.0.0) - First Release
2016.05.09 (v1.0.1) - Added Error Handler
2016.05.12 (v1.0.2) - Fixed a function that parses a URL.
2016.07.04 (v1.0.3) - Fixed a few logic about the range were converted to Rectangular object.


2016.10.06 (v1.0.4) - Added Canvas Filter (This function require my CSS Canvas Filter plugin)


2016.12.10 (v1.0.5) :
- Added a plugin parameter about video quality settings.
- Added the ability to play YouTube videos from a specified time.

2017.08.31 (v1.0.6) :
- Added a feature that the video size sets up with a fullscreen mode.
- Added a feature that can set the video to loop.

2018.01.08 (v1.0.7) :
- Now that The YouTube iframe will be newly created every times when playing back the video.
- Fixed the bug that is not available the function called YTPlayer.isEnded();



Credit and Thanks
- Biud436


Terms of Use
Free for commercial and non-commercial use.
v1.0.5 Updated :
  - Added a plugin parameter about video quality settings.
  - Added the ability to play YouTube videos from a specified time.
Great plugin! is there any way to have the youtube video always be on the screen?
Great plugin! is there any way to have the youtube video always be on the screen?
Perhaps the most important thing to that will playback the video repeatedly.
But I'm not sure your desired things without a concrete explanation.
Anyway, Please check a newly updated plugin on your project.
Thanks for adding looping, that's useful to me also!

I'd like the video to keep playing even when you click elsewhere on the screen. Basically the only way I want the video to go away is when I use the "YTPlayer stop" plugin command. If possible?
Thanks for adding looping, that's useful to me also!

I'd like the video to keep playing even when you click elsewhere on the screen. Basically the only way I want the video to go away is when I use the "YTPlayer stop" plugin command. If possible?

To edit this plugin, you must have the Text Editor and try to edit certain lines as follows.
Code:
  Scene_Map.prototype.checkEscapeToYoutube = function() {
    // empty
  };
I just installed the plugin. I had to add in line 250:

var YT = YT || {};

and I found an error related to YTPlayer.isEnded (although the plugin works well).

Several times I realised that the video seems to load two times instead of only one and this created the video begins, a little stop of the video and it begins to reproduce.

Can you help me?
I just installed the plugin. I had to add in line 250:

var YT = YT || {};

The global variable named 'YT' will automatically be created from the YouTube iFrame API.

And I've fixed some issues that you said.
Thank you for your feedback.
I have two questions about the plugin:

- Is it possible to scale the size of the Youtube screen? My game is in window 1280x720 but can scale until 1920x1080 in fullscreen, but the youtube screen has the same size always.


- When a video runs, you can press cancel or other keys that open other menus/events (YEP_ButtomCommonEvents to be clearer). Is it possible to change this in your plugin? I can use other ways without problems.


I haven't investigated much, but the error of restarting the video still continues. It doesn't happen as often as before, but it just happened to me. I have the latest version of the plugin (1.0.7). At this moment I have open several programs, but I think it shouldn't be the problem.

Thank you for helping me a few days ago.
e39a31f3b17d.png

Unfortunately, some videos can't playback in the outside of YouTube.
Hi, I'm replying to this post of yours just because it's the latest one, I didn't find a relevant post for my question. It's about your plugin Multiple HUD for rmmv.

My question is simple, can I edit your code and assets so that it fits my game? For example, I want the "exp" bar in the hud to reflect on something else, other than xp. Or I want to remove the "circle" face thing of the hud, or paint the bars a different color. Do you allow this?

Of course you will be properly credited and I will also add the fact that the plugin is edited and link to your page. I've also left the original parts inside the code. It works great for what I want, and I haven't made any major changes, but I had to ask for permission 🙂
Hi, I'm replying to this post of yours just because it's the latest one, I didn't find a relevant post for my question. It's about your plugin Multiple HUD for rmmv.

My question is simple, can I edit your code and assets so that it fits my game? For example, I want the "exp" bar in the hud to reflect on something else, other than xp. Or I want to remove the "circle" face thing of the hud, or paint the bars a different color. Do you allow this?

Of course you will be properly credited and I will also add the fact that the plugin is edited and link to your page. I've also left the original parts inside the code. It works great for what I want, and I haven't made any major changes, but I had to ask for permission 🙂
You can free to use images provided with my HUD plugin and you are free to modify the code, too.
Do you have this plugin for RM MZ ?
Do you have this plugin for RM MZ ?

https://github.com/biud436/MZ/blob/master/RS_YoutubePlayer.js
Thanks for reply ! its working !!!
but when a switch to fullscreen this happen, and when i change the deafult width and height this happens too. the video its cuted on the screen.
There is someway to use dimensions of the screen?
1649339561928.png
Thanks for reply ! its working !!!
but when a switch to fullscreen this happen, and when i change the deafult width and height this happens too. the video its cuted on the screen.
There is someway to use dimensions of the screen?

it is easy to resolve via latest version. But it's hard to predict what problems this update will cause.

https://github.com/biud436/MZ/blob/master/RS_YoutubePlayer.js


ee.jpg

Original thread: https://forums.rpgmakerweb.com/threads/youtube-player.64810/