Thread Starter
Fiech
(@fiech)
I forgot to add, that the privacy cover is disappearing when you click it, but then its just blank space behind it, no player.
Embed Privacy is currently ignoring everything after the / and before the parameters, thus the player doesnβt work as expected.
As a workaround, you can use the following regex: /player\.twitch\.tv\/\?/
This worked for me.
I will look for a real fix in the next version.
Thread Starter
Fiech
(@fiech)
Hohum…
No luck here… So I just checked the HTML code (without the provider):
<iframe src="https://player.twitch.tv/?channel=<channel>&parent=<domain>" allowfullscreen="false" width="400" height="300">
</iframe>
Right now I create my iframe with a custom shortcode. Unfortunately I have not yet figured out how to prevent the & in the url of my shortcode return value from being converted to &. The stream itself works without a hitch, but could this be a problem for Embed Privacy?
Also: Does the checkbox to disable the provider work for you?
Ty
-
This reply was modified 5 years ago by
Fiech.
-
This reply was modified 5 years ago by
Fiech.
-
This reply was modified 5 years ago by
Fiech.
-
This reply was modified 5 years ago by
Fiech.
-
This reply was modified 5 years ago by
Fiech.
Sorry, I need to correct my answer from above: It just worked because I already did some changes in the development branch that also affects this problem. So this should be fixed within the next version.
Also disabling the embed provider works seamlessly.
Thread Starter
Fiech
(@fiech)
Thank you for the information. Then I’ll wait. Maybe you even could add twitch to the defaults?
Version 1.3.4 with the fix is already out. π
Thread Starter
Fiech
(@fiech)
Hmm… Either something’s wrong or I am stupid. I completely removed and reinstalled the plugin just to be sure. So right now I’m getting the following behaviour:
If I just include my iframe and do not have a custom Twitch embed, I get no privacy cover whatsoever, just directly the iframe with the stream.
If I then add a custom provider with this regexp
/player\.twitch\.tv\/\?/
I get the following: https://i.imgur.com/FHzFf7E.png
If I then deactivate the provider via the checkbox and got this: https://i.imgur.com/WLE4LvP.png
If I click either of the covers, the cover vanishes and underneath is just empty space.
I am… confused… I don’t really know what’s going on here, why it is behaving like this… But then I also don’t understand, what the regexp has to catch and what not. I also do not understand, why it says “Hier kicken, um Inhalt von <iframe src= anzuzeigen”, respectively “<div class=”. I put some appropriate text in the custom provider and also added a logo and a privacy policy link. Neither one gets displayed…
I have nothing in the Error Console when clicking the privacy cover, but I get a failed XHR request for the page (Error 404). I don’t know if this is in any way important.
Also a fun fact: If I change the regexp to /https?:\/\/player\.twitch\.tv\/\?/ I get an error 404 page of my wordpress site as the “privacy overlay” ^^ Idk what’s going on there just found it funny…
Also the first point sounds weird since every iframe should have at least a default overlay by Embed Privacy.
Which editor and theme are you using?
Thread Starter
Fiech
(@fiech)
We use the classic editor and a custom theme based on the WP Jurist Theme.
The twitch iframe is created by a custom shortcode that creates the iframe.
Here is an excerpt surrounding the iframe if I do not have any custom provider straight from the source code:
<article id="post-3588" class="post-3588 page type-page status-publish hentry">
<div class="entry-content post-content">
<iframe src="https://player.twitch.tv/?channel=[CHANNEL]&parent=[DOMAIN]" width="400" height="300" allowfullscreen="false"></iframe>
</div><!-- .entry-content -->
<footer class="entry-meta">
<span class="create-date">
<i class="fal fa-calendar"></i> <span class="entry-date"> 2. Juni 2021</span>
</span>
<span class="edit-date">
<i class="fal fa-pen"></i> <span class="update-date">2. Juni 2021</span>
</span>
<span class="edit-link"><a class="post-edit-link" href="[EDIT_LINK]">Bearbeiten</a></span> </footer><!-- .entry-meta -->
<div class="post-divider"></div>
</article>
I don’t see any errors in the console save for two font download related ones.
If you think it’ll help, I can send you the URL via a private message of your choice.
Is it possible to get the source code of this custom shortcode? Just to be sure we can reproduce the problem? Since I cannot reproduce it with a plain custom HTML iframe.
Thread Starter
Fiech
(@fiech)
Hi, here is the source code for the shortcode
function fk_shortcode_twitch_embed($atts) {
$content = (isset($atts['content'])) ? sanitize_text_field($atts['content']) : '';
if (isset($atts['parent'])) {
$parent = sanitize_text_field($atts['parent']);
}
else {
$parse = parse_url(get_bloginfo('wpurl'));
$parent = $parse['host'];
}
$width = (isset($atts['width'])) ? intval($atts['width']) : 400;
$height = (isset($atts['height'])) ? intval($atts['height']) : 300;
$afs = (isset($atts['allowfullscreen']) && $atts['allowfullscreen'] === 'true') ? 'true' : 'false';
return sprintf('<iframe src="https://player.twitch.tv/?%s&parent=%s" width="%d" height="%d" allowfullscreen="%s"></iframe>',
$content,
$parent,
$width,
$height,
$afs);
}
add_shortcode('twitch', 'fk_shortcode_twitch_embed');
It works like this: [twitch content="channel=<name>"]
Thread Starter
Fiech
(@fiech)
For what it’s worth: This shortcode is implemented as a plugin.
Thank you, I could reproduce and fix it with the shortcode. The fix will be shipped within the next version.
If you want to apply the fix manually, you can find the issue on GitHub here:
https://github.com/epiphyt/embed-privacy/issues/76
The commit with the changes is linked there.