Video asset shown as audio asset

Hi, i’m pretty new to playcanvas.
I’ve tryed to do a simple sphere with a material with a video as texture.
Everytime i try to import my video (.mp4, h264) it is shown as audio asset and not video asset.

Does anybody had this problem?

this is the script attached to the sphere:
var VideoTexture = pc.createScript(‘videoTexture’);

// attribute to hold the video asset
VideoTexture.attributes.add(‘videoAsset’, {
type: ‘asset’,
assetType: ‘video’,
title: ‘Video Asset’

// initialize code called once per entity
VideoTexture.prototype.initialize = function() {
var app =;
var video = document.createElement(‘video’);

// If videoAsset exists, use its URL, else use the URL provided
video.src = this.videoAsset ? this.videoAsset.getFileUrl() : "";

video.crossOrigin = 'anonymous';
video.loop = true;
video.muted = true;

video.addEventListener('canplay', function (e) {
    var texture = new pc.Texture(app.graphicsDevice, {
        format: pc.PIXELFORMAT_R8_G8_B8,
        autoMipmap: true
    this.entity.model.meshInstances[0].material.diffuseMap = texture;
}.bind(this), false);


1 Like

Hi @Fabio and welcome,

That’s ok, PlayCanvas doesn’t have a dedicated video asset type. Still your file can be used, you can load and use it in code much like the Video Texture example does.