Media Player symbol - Easy video/audio player with alpha support


#1

Hi there,

I made a simple video / sound player [symbol] for beginners.
This Media Player can be used to play local / streamed video or sound files (.mp4 and .ogv/ogg), it has easy alpha support option, and has some Properties that can be used by States for people who don’t like scripting. It is easy to use and can also be controlled by scripts.

Media Player Properties:

  • Source
  • Play/Pause
  • Loop
  • Time (in ms)
  • Volume (0=silent - 1=100%)
  • Alpha Video (activate splitted mask mode for videos, see informations below)
  • Time display (show current and total time on video)

Exported functions that can be called from the parent script -

Media_Player.nodes.script.source(string);
Media_Player.nodes.script.start();
Media_Player.nodes.script.pause();
Media_Player.nodes.script.loop(integer);
Media_Player.nodes.script.time(integer);
Media_Player.nodes.script.volume(float);
Media_Player.nodes.script.alpha(boolean);
Media_Player.nodes.script.tdisplay(boolean);

The stop function also emits custom events -

custom:end

Hope it helps, please try it and tell me if any problem / feel free to improve.

Media Player.zpp (374.9 KB)

(add it to your new project hierarchy).


How to add audio - script or timeline - best practices
#2

Nice 1, I wanted to learn about it too.:grin:


#3

Updated with a lot of changes, exported functions etc…

:wink:


#4

I have problem with this in WebAR.
WebGL: INVALID_VALUE: tex(Sub)Image2D: video visible size is empty

37

Any idea how to solve it maybe?


#5

Hi @wika90,

I didn’t tried video with webAR but I have read that video might don’t work as well as in Zappar app now… maybe the team can help.


#6

Also here is another version called [Media Playlist] to help managing a simple playlist of media. It can play the next / previous or random file in the list of media. It’s just a counter/random that is checking ID of filename but it might be useful.

Media Playlist.zpp (374.5 KB)