Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
32,339
Reaction score
8,075
First Language
German
Primarily Uses
RMMV
@devilhacker and where is the screenshot I asked for to check for the other possible errors?
Because from the error message you used the functions in the wrong way.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
32,339
Reaction score
8,075
First Language
German
Primarily Uses
RMMV
yes, as I assumed - you delete the video (release its memory) before it can be played, so of course it is no longer defined when you try to play it after that.
Additionally, you need to place the name as a string (within '' exactly like the example for the use of this script does) for it to work correctly.

Please read and follow all instructions given in a plugin next time, in scripting every detail counts.
 

Jaam

Warper
Member
Joined
Aug 4, 2018
Messages
1
Reaction score
0
First Language
English
Primarily Uses
RMMV
Thank you for this amazing plugin! This is exactly what I've been looking for :)
But just one more thing, I also want to know how to set position of the video. When it plays a video smaller than the screen, the video just stays upper left. It would be much better to see it centered on the screen.
Sorry, I just began to learn scripts and stuffs..:p Thank you in advance!
 

devilhacker

Villager
Member
Joined
Apr 8, 2018
Messages
7
Reaction score
0
First Language
Malay
Primarily Uses
RMMV
yes, as I assumed - you delete the video (release its memory) before it can be played, so of course it is no longer defined when you try to play it after that.
Additionally, you need to place the name as a string (within '' exactly like the example for the use of this script does) for it to work correctly.

Please read and follow all instructions given in a plugin next time, in scripting every detail counts.

I'll fix it now. thanx

@Andar The error is no longer present but the video didnt appear.Capture.PNG
 
Last edited by a moderator:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
32,339
Reaction score
8,075
First Language
German
Primarily Uses
RMMV
Why did you split the commands among different script commands?
Please test them while they are inside the same script box
 

devilhacker

Villager
Member
Joined
Apr 8, 2018
Messages
7
Reaction score
0
First Language
Malay
Primarily Uses
RMMV
Why did you split the commands among different script commands?
Please test them while they are inside the same script box

already did. still didn't give anything
Capture.PNG
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
32,339
Reaction score
8,075
First Language
German
Primarily Uses
RMMV
Please follow the example given on how to use this script.
In your first try it failed because you added a command (the release command) to it, and when I said that was wrong you not only removed the wrong release command but also the required loop structure.
And now you randomly added the isready check in the wrong way as well...

Script commands have to be used exactly as they're meant to be used - you can not randomly add them without thinking...
 

devilhacker

Villager
Member
Joined
Apr 8, 2018
Messages
7
Reaction score
0
First Language
Malay
Primarily Uses
RMMV
Please follow the example given on how to use this script.
In your first try it failed because you added a command (the release command) to it, and when I said that was wrong you not only removed the wrong release command but also the required loop structure.
And now you randomly added the isready check in the wrong way as well...

Script commands have to be used exactly as they're meant to be used - you can not randomly add them without thinking...

Can you show me your scripts?
 

Larenarte

Warper
Member
Joined
Aug 13, 2018
Messages
1
Reaction score
0
First Language
French
Primarily Uses
RMMV
Hello~ I got some problem while using your plagin.

TypeError: undefined is not a function
at Object.c [as loadVideo] (file:///C:/Users/legra/Documents/Games/ZELDA%20FORCE%203%20REVERSED/js/plugins/YSP_VideoPlayer.js:21:5591)
at Game_Interpreter.eval (eval at <anonymous> (file:///C:/Users/legra/Documents/Games/ZELDA%20FORCE%203%20REVERSED/js/rpg_objects.js:10436:10), <anonymous>:1:17)
at Game_Interpreter.command355 (file:///C:/Users/legra/Documents/Games/ZELDA%20FORCE%203%20REVERSED/js/rpg_objects.js:10436:5)
at Game_Interpreter.executeCommand (file:///C:/Users/legra/Documents/Games/ZELDA%20FORCE%203%20REVERSED/js/rpg_objects.js:8894:34)
at Game_Interpreter.update (file:///C:/Users/legra/Documents/Games/ZELDA%20FORCE%203%20REVERSED/js/rpg_objects.js:8802:19)
at Game_Map.updateInterpreter (file:///C:/Users/legra/Documents/Games/ZELDA%20FORCE%203%20REVERSED/js/rpg_objects.js:6080:27)
at Game_Map.update (file:///C:/Users/legra/Documents/Games/ZELDA%20FORCE%203%20REVERSED/js/rpg_objects.js:5987:14)
at Scene_PretitleMap.Scene_Map.updateMain (file:///C:/Users/legra/Documents/Games/ZELDA%20FORCE%203%20REVERSED/js/rpg_scenes.js:417:14)
at Scene_PretitleMap.Scene_Map.updateMainMultiply (file:///C:/Users/legra/Documents/Games/ZELDA%20FORCE%203%20REVERSED/js/rpg_scenes.js:409:10)
at Scene_PretitleMap.Scene_Map.update (file:///C:/Users/legra/Documents/Games/ZELDA%20FORCE%203%20REVERSED/js/rpg_scenes.js:398:10)rpg_managers.js:1618 SceneManager.catchException

QRUwqBf


it's almost like the exemple but it still doesn't work :\
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
32,339
Reaction score
8,075
First Language
German
Primarily Uses
RMMV
@Larenarte please remove all spaces from your filepath and try again.
The spaces habe been replaced by %20 in the error message above exactly because the Browser has problems handling them, and often can not load files behind them.
 

AntiGM

Villager
Member
Joined
Dec 23, 2015
Messages
9
Reaction score
0
First Language
Russian
When the video starts, the frame rate drops very much.
How to fix?
If you start the video with standard methods, then the frame rate is high.
 

blurymind

Veteran
Veteran
Joined
May 5, 2016
Messages
62
Reaction score
17
Primarily Uses
@Archeia there is an inherent problem with videos that have an alpha channel.
Here is a link
https://github.com/pixijs/pixi.js/issues/4089

Can you add the fix included in that issue to your code please?

I injected it on the minified plugin and can confirm that the fix works
/*:
* @plugindesc v1.0.0 Plugin used for playing video.
* @author Dr.Yami
*
* @Help
* Use script call:
* ysp.VideoPlayer.loadVideo(videoName) - Preload Video
* ysp.VideoPlayer.releaseVideo(videoName) - Release memory for a Video
* ysp.VideoPlayer.newVideo(videoName, id) - Create new Video object with id
* ysp.VideoPlayer.playVideoById(id) - Play a Video object by id
* ysp.VideoPlayer.stopVideoById(id) - Stop a Video object by id
* ysp.VideoPlayer.setLoopById(id) - Make a Video object playing loop by id
* ysp.VideoPlayer.getVideoById(id) - Get Video object by id
* ysp.VideoPlayer.isReady() - Check if all videos have been loaded
*
* Video Object is a PIXI.Sprite object, can be re-position by modifying x and y props
* To preload a (or many) video(s), use loadVideo(videoName) followed by a loop in
* an event, break the loop when isReady() returns true
*/

! function (t) {
function e(r) {
if (n[r]) return n[r].exports;
var o = n[r] = {
i: r,
l: !1,
exports: {}
};
return t[r].call(o.exports, o, o.exports, e), o.l = !0, o.exports
}
var n = {};
e.m = t, e.c = n, e.d = function (t, n, r) {
e.o(t, n) || Object.defineProperty(t, n, {
configurable: !1,
enumerable: !0,
get: r
})
}, e.n = function (t) {
var n = t && t.__esModule ? function () {
return t.default
} : function () {
return t
};
return e.d(n, "a", n), n
}, e.o = function (t, e) {
return Object.prototype.hasOwnProperty.call(t, e)
}, e.p = "", e(e.s = 35)
}([function (t, e) {
var n = t.exports = "undefined" != typeof window && window.Math == Math ? window : "undefined" != typeof self && self.Math == Math ? self : Function("return this")();
"number" == typeof __g && (__g = n)
}, function (t, e, n) {
t.exports = !n(11)(function () {
return 7 != Object.defineProperty({}, "a", {
get: function () {
return 7
}
}).a
})
}, function (t, e, n) {
var r = n(10),
o = n(15);
t.exports = n(1) ? function (t, e, n) {
return r.f(t, e, o(1, n))
} : function (t, e, n) {
return t[e] = n, t
}
}, function (t, e) {
t.exports = function (t) {
return "object" == typeof t ? null !== t : "function" == typeof t
}
}, function (t, e, n) {
var r = n(28),
o = n(12);
t.exports = function (t) {
return r(o(t))
}
}, function (t, e) {
var n = t.exports = {
version: "2.4.0"
};
"number" == typeof __e && (__e = n)
}, function (t, e, n) {
var r = n(3);
t.exports = function (t) {
if (!r(t)) throw TypeError(t + " is not an object!");
return t
}
}, function (t, e) {
var n = {}.hasOwnProperty;
t.exports = function (t, e) {
return n.call(t, e)
}
}, function (t, e) {
var n = Math.ceil,
r = Math.floor;
t.exports = function (t) {
return isNaN(t = +t) ? 0 : (t > 0 ? r : n)(t)
}
}, , function (t, e, n) {
var r = n(6),
o = n(24),
u = n(25),
i = Object.defineProperty;
e.f = n(1) ? Object.defineProperty : function (t, e, n) {
if (r(t), e = u(e, !0), r(n), o) try {
return i(t, e, n)
} catch (t) {}
if ("get" in n || "set" in n) throw TypeError("Accessors not supported!");
return "value" in n && (t[e] = n.value), t
}
}, function (t, e) {
t.exports = function (t) {
try {
return !!t()
} catch (t) {
return !0
}
}
}, function (t, e) {
t.exports = function (t) {
if (void 0 == t) throw TypeError("Can't call method on " + t);
return t
}
}, function (t, e, n) {
var r = n(17)("keys"),
o = n(18);
t.exports = function (t) {
return r[t] || (r[t] = o(t))
}
}, function (t, e, n) {
var r = n(3),
o = n(0).document,
u = r(o) && r(o.createElement);
t.exports = function (t) {
return u ? o.createElement(t) : {}
}
}, function (t, e) {
t.exports = function (t, e) {
return {
enumerable: !(1 & t),
configurable: !(2 & t),
writable: !(4 & t),
value: e
}
}
}, function (t, e) {
var n = {}.toString;
t.exports = function (t) {
return n.call(t).slice(8, -1)
}
}, function (t, e, n) {
var r = n(0),
o = r["__core-js_shared__"] || (r["__core-js_shared__"] = {});
t.exports = function (t) {
return o[t] || (o[t] = {})
}
}, function (t, e) {
var n = 0,
r = Math.random();
t.exports = function (t) {
return "Symbol(".concat(void 0 === t ? "" : t, ")_", (++n + r).toString(36))
}
}, function (t, e) {
t.exports = "constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")
}, , function (t, e, n) {
var r = n(0),
o = n(5),
u = n(22),
i = n(2),
c = function (t, e, n) {
var f, a, s, p = t & c.F,
l = t & c.G,
d = t & c.S,
v = t & c.P,
y = t & c.B,
x = t & c.W,
h = l ? o : o[e] || (o[e] = {}),
_ = h.prototype,
b = l ? r : d ? r[e] : (r[e] || {}).prototype;
l && (n = e);
for (f in n)(a = !p && b && void 0 !== b[f]) && f in h || (s = a ? b[f] : n[f], h[f] = l && "function" != typeof b[f] ? n[f] : y && a ? u(s, r) : x && b[f] == s ? function (t) {
var e = function (e, n, r) {
if (this instanceof t) {
switch (arguments.length) {
case 0:
return new t;
case 1:
return new t(e);
case 2:
return new t(e, n)
}
return new t(e, n, r)
}
return t.apply(this, arguments)
};
return e.prototype = t.prototype, e
}(s) : v && "function" == typeof s ? u(Function.call, s) : s, v && ((h.virtual || (h.virtual = {}))[f] = s, t & c.R && _ && !_[f] && i(_, f, s)))
};
c.F = 1, c.G = 2, c.S = 4, c.P = 8, c.B = 16, c.W = 32, c.U = 64, c.R = 128, t.exports = c
}, function (t, e, n) {
var r = n(23);
t.exports = function (t, e, n) {
if (r(t), void 0 === e) return t;
switch (n) {
case 1:
return function (n) {
return t.call(e, n)
};
case 2:
return function (n, r) {
return t.call(e, n, r)
};
case 3:
return function (n, r, o) {
return t.call(e, n, r, o)
}
}
return function () {
return t.apply(e, arguments)
}
}
}, function (t, e) {
t.exports = function (t) {
if ("function" != typeof t) throw TypeError(t + " is not a function!");
return t
}
}, function (t, e, n) {
t.exports = !n(1) && !n(11)(function () {
return 7 != Object.defineProperty(n(14)("div"), "a", {
get: function () {
return 7
}
}).a
})
}, function (t, e, n) {
var r = n(3);
t.exports = function (t, e) {
if (!r(t)) return t;
var n, o;
if (e && "function" == typeof (n = t.toString) && !r(o = n.call(t))) return o;
if ("function" == typeof (n = t.valueOf) && !r(o = n.call(t))) return o;
if (!e && "function" == typeof (n = t.toString) && !r(o = n.call(t))) return o;
throw TypeError("Can't convert object to primitive value")
}
}, function (t, e, n) {
var r = n(27),
o = n(19);
t.exports = Object.keys || function (t) {
return r(t, o)
}
}, function (t, e, n) {
var r = n(7),
o = n(4),
u = n(29)(!1),
i = n(13)("IE_PROTO");
t.exports = function (t, e) {
var n, c = o(t),
f = 0,
a = [];
for (n in c) n != i && r(c, n) && a.push(n);
for (; e.length > f;) r(c, n = e[f++]) && (~u(a, n) || a.push(n));
return a
}
}, function (t, e, n) {
var r = n(16);
t.exports = Object("z").propertyIsEnumerable(0) ? Object : function (t) {
return "String" == r(t) ? t.split("") : Object(t)
}
}, function (t, e, n) {
var r = n(4),
o = n(30),
u = n(31);
t.exports = function (t) {
return function (e, n, i) {
var c, f = r(e),
a = o(f.length),
s = u(i, a);
if (t && n != n) {
for (; a > s;)
if ((c = f[s++]) != c) return !0
} else
for (; a > s; s++)
if ((t || s in f) && f === n) return t || s || 0;
return !t && -1
}
}
}, function (t, e, n) {
var r = n(8),
o = Math.min;
t.exports = function (t) {
return t > 0 ? o(r(t), 9007199254740991) : 0
}
}, function (t, e, n) {
var r = n(8),
o = Math.max,
u = Math.min;
t.exports = function (t, e) {
return t = r(t), t < 0 ? o(t + e, 0) : u(t, e)
}
}, , , , function (t, e, n) {
"use strict";

function r(t) {
return t && t.__esModule ? t : {
default: t
}
}
var o = n(36),
u = r(o);
(0, r(n(42)).default)(Spriteset_Base), window.ysp = window.ysp || {}, window.ysp.VideoPlayer = u.default
}, function (t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
});
PIXI.glCore.GLTexture.prototype.upload = function(source)
{
this.bind();
var gl = this.gl;
gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, this.premultiplyAlpha);
var isVideo = !!source.videoWidth;
var newWidth = isVideo ? source.videoWidth : source.width;
var newHeight = isVideo ? source.videoHeight : source.height;
if(newHeight !== this.height || newWidth !== this.width || isVideo)
{
gl.texImage2D(gl.TEXTURE_2D, 0, this.format, this.format, this.type, source);
}
else
{
gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, this.format, this.type, source);
}
this.width = newWidth;
this.height = newHeight;
};
var r = n(37),
o = function (t) {
return t && t.__esModule ? t : {
default: t
}
}(r),
u = {},
i = {},
c = function (t) {
if (u[t]) return u[t];
var e = PIXI.Texture.fromVideo("movies/" + t);
return e.baseTexture.autoPlay = !1, u[t] = e, e
},
f = function (t) {
var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "video",
n = new PIXI.Sprite(c(t));
return n.update = function () {
n.texture.update()
}, i[e] = n, n
},
a = function (t) {
SceneManager._scene._spriteset.addVideo(t), t.texture.baseTexture.source.play()
},
s = function (t) {
var e = x(t);
a(e)
},
p = function (t) {
SceneManager._scene._spriteset.removeVideo(t), t.texture.baseTexture.source.pause()
},
l = function (t) {
var e = x(t);
p(e), delete i[t]
},
d = function (t) {
t.texture.baseTexture.source.loop = !0
},
v = function (t) {
var e = x(t);
d(e)
},
y = function (t) {
delete u[t]
},
x = function (t) {
return i[t]
},
h = function () {
return !(0, o.default)(u).some(function (t) {
return !t.baseTexture.hasLoaded
})
};
e.default = {
newVideo: f,
loadVideo: c,
playVideo: a,
playVideoById: s,
stopVideoById: l,
setLoopById: v,
releaseVideo: y,
getVideoById: x,
isReady: h
}
}, function (t, e, n) {
t.exports = {
default: n(38),
__esModule: !0
}
}, function (t, e, n) {
n(39), t.exports = n(5).Object.values
}, function (t, e, n) {
var r = n(21),
o = n(40)(!1);
r(r.S, "Object", {
values: function (t) {
return o(t)
}
})
}, function (t, e, n) {
var r = n(26),
o = n(4),
u = n(41).f;
t.exports = function (t) {
return function (e) {
for (var n, i = o(e), c = r(i), f = c.length, a = 0, s = []; f > a;) u.call(i, n = c[a++]) && s.push(t ? [n, i[n]] : i[n]);
return s
}
}
}, function (t, e) {
e.f = {}.propertyIsEnumerable
}, function (t, e, n) {
"use strict";
Object.defineProperty(e, "__esModule", {
value: !0
}), e.default = function (t) {
var e = t.prototype.createUpperLayer;
t.prototype.createUpperLayer = function () {
this.createVideos(), e.call(this)
}, t.prototype.createVideos = function () {
this._videosContainer = new Sprite, this.addChild(this._videosContainer)
}, t.prototype.addVideo = function (t) {
this._videosContainer.addChild(t)
}, t.prototype.removeVideo = function (t) {
this._videosContainer.removeChild(t)
}
}
}


]);
//# sourceMappingURL=YSP_VideoPlayer.js.map

Anyways, thank you for the plug in. Its very nice. Some instruction on github on how to build it would be nice. Also can we add the ability to set position of video on the screen?
 
Last edited:

sefeloth

Veteran
Veteran
Joined
Oct 24, 2016
Messages
36
Reaction score
5
First Language
english
Primarily Uses
this is really cool! there's been lots of cases that I wanted to have a video loop and tried figuring out how to do it in engine but go nowhere. nice work
 

avgneighbor

Warper
Member
Joined
Nov 27, 2018
Messages
1
Reaction score
0
First Language
english
Primarily Uses
RMMV
This is a really cool plugin but Im currently having problems with it unfortunately. Where is he webm file supposed to be located cause the file never loads

scrip.PNG
This is how I have it set up but its still just goofing on me and not displaying anything.
When I do take out the ' from 'vlad3.webm' to vlad3.webm it just gives me a reference error and its so frustrating!
Any help would be greatly appreciated!!
 

Archeia

Level 99 Demi-fiend
Staff member
Developer
Joined
Mar 1, 2012
Messages
15,270
Reaction score
15,695
First Language
Filipino
Primarily Uses
RMMZ
@avgneighbor preloading video takes a while. So it's not that it's not working, there just needs to be a considerable amount of time for the video to load before it plays. Again as you can see in my example here just a few posts before you.
index.php
 

Foxhunter10

Warper
Member
Joined
Jan 10, 2019
Messages
1
Reaction score
0
First Language
Spanish
Primarily Uses
RMMV
Hii! Thx a lot for this usefull Plugin! It was what I was looking for!
But, I don't know if you can help me with a little thing, I just wanna know if there is any way to play the video at the center of the screen.
Thx again!!
 

Latest Threads

Latest Profile Posts

Trailer for my new game.
last one for a while
MythicRuss wrote on gothicvoid's profile.
hi, i was looking thru ur awesome stuff, and was looking around the internet, how in the heckin heck do i get the hiddendoors to open? im addng them to the doors event but they just appear as solid walls, btw am total noob lol
currently working on some template sprites and tweaking the walk cycle :)

Forum statistics

Threads
110,307
Messages
1,052,164
Members
143,340
Latest member
Hopefullyfinishinggame
Top