Play a simple video? help plz (SOLVED)

Discussion in 'Learning Javascript' started by Jonforum, Jul 26, 2017.

  1. Jonforum

    Jonforum Veteran Veteran

    Messages:
    1,594
    Likes Received:
    1,380
    Location:
    Canada / Québec
    First Language:
    French
    Primarily Uses:
    RMMV
    Hello i just try to play a video to test, but i can't not succeed.
    Do i miss something.
    Here is approximately the basic code
    PHP:
            var vidTexture PIXI.Texture.fromVideo('video/01.mov'); // load file path rmmv as texture
            
    var vid vidTexture.baseTexture.source// shortcut to .VideoBaseTexture method

            
    var vidSprite = new PIXI.Sprite(vidTexture); // make a pixi sprite with the video texture
                
    vidSprite.width vid.videoWidthvidSprite.height vid.videoHeight// Hum, ?? why vid WidthHeight, is 0 ??

            
    var myPicture_WillContainVideo SceneManager._scene._spriteset._pictureContainer.children[pictureID]; // example picture 5
            
    myPicture_WillContainVideo.addChild(vidSprite); // Add the sprite Video in the picture sprite container as children

            
    vid.play(); // play Video !
    What I do, not correct.
    Yet it works here. !
    https://pixijs.github.io/examples/#/basics/video.js

    thank a lot for help guy and girl
    here the video i try to play !
    If anyone can try to tell me what I do wrong.
     

    Attached Files:

    #1
  2. Andar

    Andar Veteran Veteran

    Messages:
    28,693
    Likes Received:
    6,596
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    please give more details about the video. In most cases this is a problem of the data and not of the code.

    And the most common errors in the data are:
    1) video size too big
    The maker can only display videos up to the game's screen size. If the video is sized 1024x768 it can't be displayed in a game screen of 816x624.

    2) wrong video codec
    If the video is encoded with a codec the engine doesn't know, then it can't be decoded and played at all.
    This is especially a problem if you tried to get the movie filesize down by using more effective but also more exotic codecs
     
    #2
  3. Dr.Yami

    Dr.Yami 。◕‿◕。 Developer

    Messages:
    994
    Likes Received:
    738
    Location:
    Finland
    First Language:
    Vietnamese
    Primarily Uses:
    Other
    nw.js only supports webm format by default. Try to convert the video to webm format and try again.
     
    #3
    Jonforum likes this.
  4. Jonforum

    Jonforum Veteran Veteran

    Messages:
    1,594
    Likes Received:
    1,380
    Location:
    Canada / Québec
    First Language:
    French
    Primarily Uses:
    RMMV
    thank @Andar for fast
    2) wrong video codec
    I had a little doubt about the codecs but I checked and tried with several video.
    I also downloaded the official video of the PIXI website, but not work.

    1) video size too big
    i try 2video
    232Ko 01.mov
    i use codec with aftect effect to get alpha chanel with mov
    codec are quicktime
    2Mo testvideo.mp4
    520kbit/s
    h.264
     
    #4
  5. Jonforum

    Jonforum Veteran Veteran

    Messages:
    1,594
    Likes Received:
    1,380
    Location:
    Canada / Québec
    First Language:
    French
    Primarily Uses:
    RMMV
    Thank you, I just made a try, convert, and it works.
    I find it a shame that this is the only codec and container taken into account.
    Especially that the compression is rather heavy on this container.
    example my 2 Mo is now are 10 Mo !

    And there is no alpha channel for this kind of video.
    I suppose i will have to play, with the different blend modes
     
    #5
  6. Dr.Yami

    Dr.Yami 。◕‿◕。 Developer

    Messages:
    994
    Likes Received:
    738
    Location:
    Finland
    First Language:
    Vietnamese
    Primarily Uses:
    Other
    #6
    Jonforum likes this.
  7. Jonforum

    Jonforum Veteran Veteran

    Messages:
    1,594
    Likes Received:
    1,380
    Location:
    Canada / Québec
    First Language:
    French
    Primarily Uses:
    RMMV
    I have however noticed here that rmmv support mp4?
    Game_Interpreter.js

    PHP:
    Game_Interpreter.prototype.videoFileExt = function() {
        if (
    Graphics.canPlayVideoType('video/webm') && !Utils.isMobileDevice()) {
            return 
    '.webm';
        } else {
            return 
    '.mp4';
        }
    };
    do you have an explanation?
    It is only the container?
     
    #7
  8. Dr.Yami

    Dr.Yami 。◕‿◕。 Developer

    Messages:
    994
    Likes Received:
    738
    Location:
    Finland
    First Language:
    Vietnamese
    Primarily Uses:
    Other
    It's for mobile build. For the PC build (not web build), they use nw.js as client, and nw.js disable mp4 mov etc by default because of the LICENSE thing.
     
    #8
    Jonforum likes this.
  9. Jonforum

    Jonforum Veteran Veteran

    Messages:
    1,594
    Likes Received:
    1,380
    Location:
    Canada / Québec
    First Language:
    French
    Primarily Uses:
    RMMV
    Last edited: Jul 27, 2017
    #9

Share This Page