Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. LAMP
  3. Cloudron+LAMP: Tiktok Embed problems

Cloudron+LAMP: Tiktok Embed problems

Scheduled Pinned Locked Moved LAMP
40 Posts 8 Posters 3.8k Views 8 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S squareclouds

      @girish @nebulon

      thank you both for your tests. yes, again, the behaviour is:

      • Tiktok embeds are not being autoplayed on macOS Safari nor any iOS browser
      • Not only they dont autoplay, but they cannot be played even with user interaction

      all other browsers on macOS work fine. BUT dont forget that all of the above works fine on other servers! so it cannot be a browser setting, if the embeds of the same website project work on the other non-cloudron servers 🙂 it is a bit hard to follow, i know.

      nebulonN Offline
      nebulonN Offline
      nebulon
      Staff
      wrote on last edited by
      #12

      @squareclouds I don't have access to any apple devices to test and debug this on my own.

      S 1 Reply Last reply
      0
      • nebulonN nebulon

        @squareclouds I don't have access to any apple devices to test and debug this on my own.

        S Offline
        S Offline
        squareclouds
        wrote on last edited by
        #13

        @nebulon luckily it is a feature that is partially critical. we dont know how many users will be embeding tiktoks, and from those embeds only the ones visited by users on iOS or safari on mac will have the issue. but i am pretty sure its gonna be some very small setting or adjustment somewhere to fix this, we must only figure out where 😄

        can one of you point me in the direction of how to set a CORS setting on cloudron? i have no clue about such things but if i play around a bit i might find a solution by chance.

        nebulonN 1 Reply Last reply
        0
        • S squareclouds

          @nebulon luckily it is a feature that is partially critical. we dont know how many users will be embeding tiktoks, and from those embeds only the ones visited by users on iOS or safari on mac will have the issue. but i am pretty sure its gonna be some very small setting or adjustment somewhere to fix this, we must only figure out where 😄

          can one of you point me in the direction of how to set a CORS setting on cloudron? i have no clue about such things but if i play around a bit i might find a solution by chance.

          nebulonN Offline
          nebulonN Offline
          nebulon
          Staff
          wrote on last edited by
          #14

          @squareclouds CORS related settings would need to be adjusted in the remote server, not the one hosting it. So I don't think this is viable here nor is likely the main issue.

          For CSP you can overwrite the headers at https://docs.cloudron.io/apps/#custom-csp or also via meta tags in the html directly. See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy

          S 1 Reply Last reply
          0
          • nebulonN nebulon

            @squareclouds CORS related settings would need to be adjusted in the remote server, not the one hosting it. So I don't think this is viable here nor is likely the main issue.

            For CSP you can overwrite the headers at https://docs.cloudron.io/apps/#custom-csp or also via meta tags in the html directly. See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy

            S Offline
            S Offline
            squareclouds
            wrote on last edited by
            #15

            @nebulon

            @girish said in Cloudron+LAMP: Tiktok Embed problems:

            @squareclouds Most likely, this is not related to PHP version. But related to CSP or CORS configuration.

            CSP (Content Security Policy) is set via a header and tells the browser what content is allowed/trusted by your web page. By default, Cloudron does not set any CSP header but you can override it . If your app has a CSP, then it can disable "embedding" of content . For example, youtube/tiktok videos etc can be prevented from being embedded.

            CORS (Cross origin resource sharing) is set via headers. This tells the browser if ajax calls are allowed from another origin. Cloudron does not set CORS headers either. This means that "random.site.com" cannot call your "dev.mydomain.de" . This is good (tm).

            OK, so, with this in mind and trying to understand your error: Blocked a frame with origin "https://www.tiktok.com" from accessing a frame with origin "https://dev.mydomain.de". This tells me that the tiktok frame is trying to access your domain. Is this understanding correct? Why is tiktok calling your domain? Maybe it's trying to report back something to the parent domain ? Is this just some random tiktok video?

            but it seems that there is a call from tiktok to our server, which would mean that our server needs the cors, or not?

            nebulonN 1 Reply Last reply
            0
            • S squareclouds

              @nebulon

              @girish said in Cloudron+LAMP: Tiktok Embed problems:

              @squareclouds Most likely, this is not related to PHP version. But related to CSP or CORS configuration.

              CSP (Content Security Policy) is set via a header and tells the browser what content is allowed/trusted by your web page. By default, Cloudron does not set any CSP header but you can override it . If your app has a CSP, then it can disable "embedding" of content . For example, youtube/tiktok videos etc can be prevented from being embedded.

              CORS (Cross origin resource sharing) is set via headers. This tells the browser if ajax calls are allowed from another origin. Cloudron does not set CORS headers either. This means that "random.site.com" cannot call your "dev.mydomain.de" . This is good (tm).

              OK, so, with this in mind and trying to understand your error: Blocked a frame with origin "https://www.tiktok.com" from accessing a frame with origin "https://dev.mydomain.de". This tells me that the tiktok frame is trying to access your domain. Is this understanding correct? Why is tiktok calling your domain? Maybe it's trying to report back something to the parent domain ? Is this just some random tiktok video?

              but it seems that there is a call from tiktok to our server, which would mean that our server needs the cors, or not?

              nebulonN Offline
              nebulonN Offline
              nebulon
              Staff
              wrote on last edited by
              #16

              @squareclouds I don't think tiktok will call your server, anyways there is no service besides apache running to call into.

              girishG 1 Reply Last reply
              0
              • nebulonN nebulon

                @squareclouds I don't think tiktok will call your server, anyways there is no service besides apache running to call into.

                girishG Do not disturb
                girishG Do not disturb
                girish
                Staff
                wrote on last edited by
                #17

                @nebulon random guess - TikTok is doing some Postmessage to parent frame which is getting blocked. This is what I inferred from the original error that @squareclouds posted.

                I might get access to a Mac later today, i will try. Very intriguing.

                S 1 Reply Last reply
                0
                • girishG girish

                  @nebulon random guess - TikTok is doing some Postmessage to parent frame which is getting blocked. This is what I inferred from the original error that @squareclouds posted.

                  I might get access to a Mac later today, i will try. Very intriguing.

                  S Offline
                  S Offline
                  squareclouds
                  wrote on last edited by
                  #18

                  @girish thank you dear sir. yes, its strange ^^ crossing fingers that you find out something when you have the chance.

                  girishG 1 Reply Last reply
                  0
                  • S squareclouds

                    @girish thank you dear sir. yes, its strange ^^ crossing fingers that you find out something when you have the chance.

                    girishG Do not disturb
                    girishG Do not disturb
                    girish
                    Staff
                    wrote on last edited by girish
                    #19

                    @squareclouds I tried the site on Mac Ventura with Firefox, Chrome and Safari. It all loads fine.

                    Also loads fine on an iphone with safari/chrome . So, I am yet to see this fail anywhere.

                    Did you get reports from all iphone/mac users that the site does not load?

                    S 1 Reply Last reply
                    0
                    • girishG girish

                      @squareclouds I tried the site on Mac Ventura with Firefox, Chrome and Safari. It all loads fine.

                      Also loads fine on an iphone with safari/chrome . So, I am yet to see this fail anywhere.

                      Did you get reports from all iphone/mac users that the site does not load?

                      S Offline
                      S Offline
                      squareclouds
                      wrote on last edited by
                      #20

                      @girish you can play the embed? because it loads, yes, but the playing is the problem. it does not autoplay nor you can play it by clicking it, it has no interaction

                      we are still not live, so we are only a few people, but yes, its not only on my macs and iphones (i have an old iphone and old mac as well, so me alone have tested on 4 devices and then the lead designer as well).

                      jaschaezraJ girishG 2 Replies Last reply
                      0
                      • S squareclouds

                        @girish you can play the embed? because it loads, yes, but the playing is the problem. it does not autoplay nor you can play it by clicking it, it has no interaction

                        we are still not live, so we are only a few people, but yes, its not only on my macs and iphones (i have an old iphone and old mac as well, so me alone have tested on 4 devices and then the lead designer as well).

                        jaschaezraJ Offline
                        jaschaezraJ Offline
                        jaschaezra
                        wrote on last edited by
                        #21

                        @squareclouds I can confirm this on latest iOS. Sitting in a train and can not further investigate.

                        The play button is rendered but is not clickable while the buttons on the right all link to TikTok (as they should)

                        girishG 1 Reply Last reply
                        0
                        • jaschaezraJ jaschaezra

                          @squareclouds I can confirm this on latest iOS. Sitting in a train and can not further investigate.

                          The play button is rendered but is not clickable while the buttons on the right all link to TikTok (as they should)

                          girishG Do not disturb
                          girishG Do not disturb
                          girish
                          Staff
                          wrote on last edited by
                          #22

                          @jaschaezra thanks for testing.

                          @squareclouds ok, we can reproduce this too . Looks like a Safari specific issue. Mac/Firefox and Mac/Chrome plays fine (can you confirm this?)

                          In https://www.buzzfeed.com/buzzfeedstaff/how-to-get-tiktoks-to-play and https://florisdeleeuwnl.zendesk.com/hc/en-us/articles/360013564340-Embedded-video-not-working-in-Safari , they suggest unchecking "Prevent Cross-Site Tracking" but atleast here that doesn't help.

                          S 1 Reply Last reply
                          0
                          • S squareclouds

                            @girish you can play the embed? because it loads, yes, but the playing is the problem. it does not autoplay nor you can play it by clicking it, it has no interaction

                            we are still not live, so we are only a few people, but yes, its not only on my macs and iphones (i have an old iphone and old mac as well, so me alone have tested on 4 devices and then the lead designer as well).

                            girishG Do not disturb
                            girishG Do not disturb
                            girish
                            Staff
                            wrote on last edited by
                            #23

                            @squareclouds do you happen to have your website hosting link with the tiktok embed? No idea what's going on at this point. We have to compare what is working and what is not.

                            1 Reply Last reply
                            0
                            • girishG girish

                              @jaschaezra thanks for testing.

                              @squareclouds ok, we can reproduce this too . Looks like a Safari specific issue. Mac/Firefox and Mac/Chrome plays fine (can you confirm this?)

                              In https://www.buzzfeed.com/buzzfeedstaff/how-to-get-tiktoks-to-play and https://florisdeleeuwnl.zendesk.com/hc/en-us/articles/360013564340-Embedded-video-not-working-in-Safari , they suggest unchecking "Prevent Cross-Site Tracking" but atleast here that doesn't help.

                              S Offline
                              S Offline
                              squareclouds
                              wrote on last edited by girish
                              #24

                              @girish yes, I confirm that on mac only safari has this issue, on iOS it is all browsers (maybe because they have to go through the app store?)

                              hmm, sure, technically I shouldn't share it but since it is for its own sake:

                              again, I think we were close already with the CORS, because tiktok tries to reach to the website from the iframe. is there a way that I can explicitly allow it to see what happens?

                              girishG 1 Reply Last reply
                              0
                              • S squareclouds

                                @girish yes, I confirm that on mac only safari has this issue, on iOS it is all browsers (maybe because they have to go through the app store?)

                                hmm, sure, technically I shouldn't share it but since it is for its own sake:

                                again, I think we were close already with the CORS, because tiktok tries to reach to the website from the iframe. is there a way that I can explicitly allow it to see what happens?

                                girishG Do not disturb
                                girishG Do not disturb
                                girish
                                Staff
                                wrote on last edited by
                                #25

                                @squareclouds I removed that link, why cause concerns. You can send us the link to support@cloudron.io . As for CORS, I have already tested this part. It's not CORS related. Something to do with content blocking in safari or maybe some other configuration on nginx.

                                S 1 Reply Last reply
                                0
                                • marcusquinnM Offline
                                  marcusquinnM Offline
                                  marcusquinn
                                  wrote on last edited by
                                  #26

                                  AFAIK autoplay is stopped on all browsers by default nowadays - probably because it is annoying as hell.

                                  OptimizePress has a good approach to this:

                                  • https://www.optimizepress.com/
                                  • https://docs.optimizepress.com/article/2759-video-autoplay-not-working/
                                  • https://developer.mozilla.org/en-US/docs/Web/Media/Autoplay_guide

                                  TikTok is also going to get blocked my anyone using any adblockers or tracking blocking settings in their browsers. For that you'll need an adblock banner, too:

                                  Ad unblock banners are also annoying, but if you have no choice but to use TikTok (which morally I wouldn't touch it, but maybe you have to just get the job done, pay billz, and move on from this client)

                                  • https://en-gb.wordpress.org/plugins/adunblocker/
                                  • https://codecanyon.net/item/deblocker-anti-adblock-for-wordpress/24086686

                                  Web Design https://www.evergreen.je
                                  Development https://brandlight.org
                                  Life https://marcusquinn.com

                                  S 1 Reply Last reply
                                  1
                                  • marcusquinnM marcusquinn

                                    AFAIK autoplay is stopped on all browsers by default nowadays - probably because it is annoying as hell.

                                    OptimizePress has a good approach to this:

                                    • https://www.optimizepress.com/
                                    • https://docs.optimizepress.com/article/2759-video-autoplay-not-working/
                                    • https://developer.mozilla.org/en-US/docs/Web/Media/Autoplay_guide

                                    TikTok is also going to get blocked my anyone using any adblockers or tracking blocking settings in their browsers. For that you'll need an adblock banner, too:

                                    Ad unblock banners are also annoying, but if you have no choice but to use TikTok (which morally I wouldn't touch it, but maybe you have to just get the job done, pay billz, and move on from this client)

                                    • https://en-gb.wordpress.org/plugins/adunblocker/
                                    • https://codecanyon.net/item/deblocker-anti-adblock-for-wordpress/24086686
                                    S Offline
                                    S Offline
                                    squareclouds
                                    wrote on last edited by
                                    #27

                                    @marcusquinn thank you, its noted. firstly it would be more important to get make it behave like on all other browsers and servers. if the user decides to block by their own will is another story

                                    marcusquinnM girishG 2 Replies Last reply
                                    0
                                    • S squareclouds

                                      @marcusquinn thank you, its noted. firstly it would be more important to get make it behave like on all other browsers and servers. if the user decides to block by their own will is another story

                                      marcusquinnM Offline
                                      marcusquinnM Offline
                                      marcusquinn
                                      wrote on last edited by
                                      #28

                                      @squareclouds Can you download the video and just embed a .mp4 file?

                                      I don't know what advantage TikTok embeds would have, would seem like more downsides to me, both in your cost of trying to make it work, and user privacy.

                                      Don't know if YouTube is any better, but that might give you a way to compare if you think this is a Cloudron setup issue, or just an issue with the way browsers work with what you're trying to do.

                                      Web Design https://www.evergreen.je
                                      Development https://brandlight.org
                                      Life https://marcusquinn.com

                                      S 1 Reply Last reply
                                      1
                                      • girishG girish

                                        @squareclouds I removed that link, why cause concerns. You can send us the link to support@cloudron.io . As for CORS, I have already tested this part. It's not CORS related. Something to do with content blocking in safari or maybe some other configuration on nginx.

                                        S Offline
                                        S Offline
                                        squareclouds
                                        wrote on last edited by
                                        #29

                                        @girish I sent you the email yesterday, thank you for looking into this!

                                        1 Reply Last reply
                                        0
                                        • marcusquinnM marcusquinn

                                          @squareclouds Can you download the video and just embed a .mp4 file?

                                          I don't know what advantage TikTok embeds would have, would seem like more downsides to me, both in your cost of trying to make it work, and user privacy.

                                          Don't know if YouTube is any better, but that might give you a way to compare if you think this is a Cloudron setup issue, or just an issue with the way browsers work with what you're trying to do.

                                          S Offline
                                          S Offline
                                          squareclouds
                                          wrote on last edited by
                                          #30

                                          @marcusquinn not doable, I need the server to work with tiktok by its own. its not 1 video, any user can embed a tiktok, so potentially its hundreds. we also have spotify, youtube, vimeo, twitter, soundcloud and instagram embeds, all working fine. all simple things have already been tested and compared, thats why i am here. at some point I didnt know what to test anymore

                                          timconsidineT 1 Reply Last reply
                                          1
                                          • robiR Offline
                                            robiR Offline
                                            robi
                                            wrote on last edited by
                                            #31

                                            @girish said in Cloudron+LAMP: Tiktok Embed problems:

                                            track

                                            Blocked by default in Vivaldi.

                                            8182f80f-5570-422d-85b7-b1c1ee1b605c-image.png

                                            Conscious tech

                                            1 Reply Last reply
                                            0
                                            Reply
                                            • Reply as topic
                                            Log in to reply
                                            • Oldest to Newest
                                            • Newest to Oldest
                                            • Most Votes


                                              • Login

                                              • Don't have an account? Register

                                              • Login or register to search.
                                              • First post
                                                Last post
                                              0
                                              • Categories
                                              • Recent
                                              • Tags
                                              • Popular
                                              • Bookmarks
                                              • Search