Problems with video texture

:no: how can i have a video texture in every scene.
Three in total.
I did a scene and it worked normal, but when I added other scenes, not.
Is this possible?

are you using the same python script for each video texture?

if so you should should change each script slightly so for example:

If this is one of your python scripts,

import VideoTexture
contr = GameLogic.getCurrentController()
obj = contr.owner

if not hasattr(GameLogic, ‘video’):

matID = VideoTexture.materialID(obj, ‘IMbbb.png’)

GameLogic.video = VideoTexture.Texture(obj, matID)

movie = GameLogic.expandPath(’//trailer_400p.ogg’)

GameLogic.video.source = VideoTexture.VideoFFmpeg(movie)

GameLogic.video.source.scale = True
GameLogic.video.source.play()

for your second script you could change all the words “video” to “video1” like:

import VideoTexture
contr = GameLogic.getCurrentController()
obj = contr.owner

if not hasattr(GameLogic, ‘video1’):

matID = VideoTexture.materialID(obj, ‘IMbbb.png’)

GameLogic.video1 = VideoTexture.Texture(obj, matID)

movie = GameLogic.expandPath(’//trailer_400p.ogg’)

GameLogic.video1.source = VideoTexture.VideoFFmpeg(movie)

GameLogic.video1.source.scale = True
GameLogic.video1.source.play()

Dont forget to do the same for your update script!!!

Hope this helps! This is how I solved your same problem for me.

:rolleyes: ok, I’ll try this trick here, this should resolve.
thanks for help

I did what you said, but did not work.
I’m using this script.

import VideoTexture

contr = GameLogic.getCurrentController()
obj = contr.getOwner()
if not hasattr(GameLogic, ‘video’):
matID = VideoTexture.materialID(obj, ‘IMvideo.png’)
GameLogic.video = VideoTexture.Texture(obj, matID)
movie = GameLogic.expandPath(’//video-02.avi’)
GameLogic.video.source = VideoTexture.VideoFFmpeg(movie)
GameLogic.video.source.scale = True
scene = GameLogic.getCurrentScene()
tvcam = scene.getObjectList()[‘OBtvcam2.3’]
matID = VideoTexture.materialID(obj, ‘IMtv.png’)
GameLogic.tv = VideoTexture.Texture(obj, matID)
GameLogic.tv.source = VideoTexture.ImageRender(scene,tvcam)
GameLogic.tv.source.capsize = [256,256]
#GameLogic.tv.source.filter = VideoTexture.FilterBlueScreen()

if contr.getSensors()[0].isPositive():
GameLogic.video.source.play()

Where did you get this example?
You can post the file here?

Hey I created an example for you, there is more explanations in the notes in the .blend. Make sure the videos are in the same folder as the .blend after you unrar it!

hi, your example is great :yes:, but if I change the scene and then back, the video does not work anymore. You can resolve it too?