Integrate fluidplayer
- This topic has 1 reply, 2 voices, and was last updated 2 weeks, 2 days ago by .
- AuthorPosts
- February 13, 2021 at 9:05 am#5145
coderuna
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
February 13, 2021 at 11:58 am#5148Tomasz Dziuda
ModeratorHi,
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.
--
Do you appreciate the support you've received today? If so, consider donating to the Publii team by clicking here; we'll be sure to use your donation to make Publii even better! - AuthorPosts
- You must be logged in to reply to this topic.