Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

correct url not showing up in iframe copied from embed button

I am working on a website in which proper url doesn't show up after copying from the embed button.

On clicking embed button(as shown below in an image), I am getting the following code inside iframe in which the value of src is not correct. It should be a proper video url.

<iframe src="//content.jwplatform.com/players/dalet_clips/35472P.mp4-88sIiZig.html" width="640" height="360" frameborder="0" scrolling="auto"></iframe>

enter image description here


The snippets of code which I am using inside jwplatform.js is:

"sharing": {
    "code": "%3Ciframe%20src%3D%22http%3A//content.jwplatform.com/players/MEDIAID-6gKQPrHW.html%22%20width%3D%22480%22%20height%3D%22270%22%20frameborder%3D%220%22%20scrolling%3D%22auto%22%3E%3C/iframe%3E",
    "link": "http://content.jwplatform.com/previews/MEDIAID-6gKQPrHW"
},

Problem Statement:

Inside iframe src, I am getting the following code //content.jwplatform.com/players/dalet_clips/35472P.mp4-88sIiZig.html which is not correct. It should be proper url of the video. I am wondering what changes I need to do so that I get the complete video url inside iframe src.

like image 431
flash Avatar asked Feb 09 '19 23:02

flash


People also ask

What is the difference between iframe and embed?

EMBED is basically the same as IFRAME, only with fewer attributes. Formally, EMBED is an HTML 5 tag, but on several browsers it will also work for HTML 4.01, if you are using this. It just cannot be validated. As always HTML 5 is recommended for the pages.

How do I show a specific part of a website in iframe?

The most direct way to do what you want is to have your server give you a complete page that only contains the fragment you want to show. As an alternative, you could just use a simple <div> and use the jQuery "load" function to load the whole page and pluck out just the section you want: $('#target-div').

How do I fix refused connection in iframe?

Most probably web site that you try to embed as an iframe doesn't allow to be embedded. You need to update X-Frame-Options on the website that you are trying to embed to allow your Power Apps Portal (if you have control over that website).

Why is my iframe not working?

If the primary domain for your website is secure with SSL (https://) but the source URL for your Iframe is not, your website will display an error, or simply not display the content. To fix this, you'll need to update the Source URL for your Iframe content with the secure (https://) version.


1 Answers

Try changing the code property in the sharing option in jwplatform.js to encodeURIComponent of whatever you want to be the exact iframe content

Example: now you have the code as %3Ciframe%20src%3D%22http%3A//content.jwplatform.com/players/MEDIAID-6gKQPrHW.html%22%20width%3D%22480%22%20height%3D%22270%22%20frameborder%3D%220%22%20scrolling%3D%22auto%22%3E%3C/iframe%3E

Now try to decode this with decodeURIComponent(code) which evaluates to :

<iframe src="http://content.jwplatform.com/players/MEDIAID-6gKQPrHW.html" width="480" height="270" frameborder="0" scrolling="auto"></iframe>

You should try changing both code and link to your actual video link and code. just encode whatever content you want to be as code with encodeURIComponent or test the current one with decodeURIComponent, also keep the correct link in the link property.

like image 188
Towkir Avatar answered Oct 05 '22 08:10

Towkir