Download
We're evolving to serve you better! This current forum has transitioned to read-only mode. For new discussions, support, and engagement, we've moved to GitHub Discussions.

Integrate fluidplayer

  • #5145
    Avatar photo[anonymous]

    What is the right way to add  Fluid Player on Publii

    I used default config and paste this code to: Custom HTML > Before every post

    <script src="https://cdn.fluidplayer.com/v3/current/fluidplayer.min.js"></script>
    <script>
        var myFP = fluidPlayer(
            'video-id',	{
      "layoutControls": {
        "controlBar": {
          "autoHideTimeout": 3,
          "animated": true,
          "autoHide": true
        },
        "htmlOnPauseBlock": {
          "html": null,
          "height": null,
          "width": null
        },
        "autoPlay": false,
        "mute": true,
        "allowTheatre": true,
        "playPauseAnimation": false,
        "playbackRateEnabled": false,
        "allowDownload": false,
        "playButtonShowing": false,
        "fillToContainer": false,
        "posterImage": ""
      },
      "vastOptions": {
        "adList": [],
        "adCTAText": false,
        "adCTATextPosition": ""
      }
    }
    </script>

    My post content

    <video width="600px" height="auto" id="video-id" controls="controls" data-mce-fragment="1">
    <source src="https://example.com/test.mp4" type="video/mp4" /></video>

    Video is playing, but I get errors in console:

    Uncaught SyntaxError: missing ) after argument list

    I found this tutorial

    At 3:16 his advice is to put “)” on the end

    "adCTATextPosition": ""
    
    }
    
    })

    I don`t know, video works but I get errors in console

    Uncaught Could not find a HTML node to attach to for target video-id" fluidplayer.min.js:8:146508
        init https://cdn.fluidplayer.com/v3/current/fluidplayer.min.js:8
        f https://cdn.fluidplayer.com/v3/current/fluidplayer.min.js:8
        <anonimno> https://example.com/test/:1
    #5148
    Avatar photo[anonymous]

    Hi,

    The error suggest that an element with ID ‘video-id’ does not exist in your post, but your code uses it – if the video works, maybe it is a bug with fluid player. In my opinion you should consult this issue with the fluidplayer developers/community.