Post by Sampletekk » Mon Feb 12, 2024 10:19 pm

Hi

Running OC 4.0.2.3
Looking for an extension that allows me to stream audio from Soundcloud, bu can't find any
Any ideas?

Per
Sampletekk


New member

Posts

Joined
Mon Aug 19, 2013 4:25 am

Post by johnp » Mon Feb 12, 2024 10:41 pm

You don't need an extension. You can simply use the SoundCloud embed code.

Opencart 1.5.6.5/OC Bootstrap Pro/VQMOD lover, user and geek.
Affordable Service £££ - Opencart Installs, Fixing, Development and Upgrades
Plus Ecommerce, Marketing, Mailing List Management and More
FREE Guidance and Advice at https://www.ecommerce-help.co.uk


User avatar
Active Member

Posts

Joined
Fri Mar 25, 2011 10:25 am
Location - Surrey, UK

Post by Sampletekk » Mon Feb 12, 2024 10:58 pm

johnp wrote:
Mon Feb 12, 2024 10:41 pm
You don't need an extension. You can simply use the SoundCloud embed code.
I've tried that and added the code to the products description, (in source mode), but it doesn't work. Just results in a blank area
This is the code I added:

<iframe width="100%" height="450" scrolling="no" frameborder="no" allow="autoplay" src="https://w.soundcloud.com/player/?url=ht ... frame><div style="font-size: 10px; color: #cccccc;line-break: anywhere;word-break: normal;overflow: hidden;white-space: nowrap;text-overflow: ellipsis; font-family: Interstate,Lucida Grande,Lucida Sans Unicode,Lucida Sans,Garuda,Verdana,Tahoma,sans-serif;font-weight: 100;"><a href="https://soundcloud.com/sampletekk-2" title="SampleTekk" target="_blank" style="color: #cccccc; text-decoration: none;">SampleTekk</a> · <a href="https://soundcloud.com/sampletekk-2/sets/7cg-mkii" title="7CG MkII" target="_blank" style="color: #cccccc; text-decoration: none;">7CG MkII</a></div>

Per
Sampletekk


New member

Posts

Joined
Mon Aug 19, 2013 4:25 am

Post by ADD Creative » Mon Feb 12, 2024 11:50 pm

Use your web browser's developer tool to check for any messages and to inspect the page to see if the code you added is there.

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by Sampletekk » Tue Feb 13, 2024 12:53 am

ADD Creative wrote:
Mon Feb 12, 2024 11:50 pm
Use your web browser's developer tool to check for any messages and to inspect the page to see if the code you added is there.
It's there

Per
Sampletekk


New member

Posts

Joined
Mon Aug 19, 2013 4:25 am

Post by JNeuhoff » Tue Feb 13, 2024 12:56 am

Make sure there's also a </iframe> at the end of your code. It would also help if you could let us know your website URL.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member
Online

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by Sampletekk » Tue Feb 13, 2024 3:57 am

JNeuhoff wrote:
Tue Feb 13, 2024 12:56 am
Make sure there's also a </iframe> at the end of your code. It would also help if you could let us know your website URL.
Sure! It's a weird URL, since it's not yet connected to the domain:
https://8fyire8d.a2hosted.com/index.php ... 42&path=33

Per
Sampletekk


New member

Posts

Joined
Mon Aug 19, 2013 4:25 am

Post by ADD Creative » Tue Feb 13, 2024 5:40 pm

As I said, use your web browser's developer tool to check for any messages. You will find some relating to your iframe.

Code: Select all

Blocked script execution in '...' because the document's frame is sandboxed and the 'allow-scripts' permission is not set.
Your iframes are sandboxed and won't allow scripts. It could be that the sandbox was added by the OpenCart editor. In which case you may be able to change the configuration.
https://ckeditor.com/docs/ckeditor4/lat ... attributes

Or you could change you iframe code.
https://developer.mozilla.org/en-US/doc ... me#sandbox

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by Sampletekk » Wed Feb 14, 2024 4:24 am

ADD Creative wrote:
Tue Feb 13, 2024 5:40 pm
As I said, use your web browser's developer tool to check for any messages. You will find some relating to your iframe.

Code: Select all

Blocked script execution in '...' because the document's frame is sandboxed and the 'allow-scripts' permission is not set.
Your iframes are sandboxed and won't allow scripts. It could be that the sandbox was added by the OpenCart editor. In which case you may be able to change the configuration.
https://ckeditor.com/docs/ckeditor4/lat ... attributes

Or you could change you iframe code.
https://developer.mozilla.org/en-US/doc ... me#sandbox
Well, in the code it says: <p><iframe allow="autoplay" frameborder="no" height="450" sandbox="" scrolling="no"
Should that be altered?

Per
Sampletekk


New member

Posts

Joined
Mon Aug 19, 2013 4:25 am

Post by ADD Creative » Wed Feb 14, 2024 7:16 pm

You may be able to change the sandbox to sandbox="allow-scripts".

If that doesn't work you may have to add the following to admin/view/javascript/ckeditor/config.js.

Code: Select all

config.iframe_attributes = {
    sandbox: 'allow-scripts'
}

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by Sampletekk » Thu Feb 15, 2024 6:22 pm

ADD Creative wrote:
Wed Feb 14, 2024 7:16 pm
You may be able to change the sandbox to sandbox="allow-scripts".

If that doesn't work you may have to add the following to admin/view/javascript/ckeditor/config.js.

Code: Select all

config.iframe_attributes = {
    sandbox: 'allow-scripts'
}
Updated the config.js and added this code to the products description, generated from Soundcloud:

Code: Select all

<p><iframe allow="autoplay" frameborder="no" height="166" sandbox="allow-scripts" scrolling="no" src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/218732849&amp;color=%23ff5500&amp;auto_play=false&amp;hide_related=false&amp;show_comments=true&amp;show_user=true&amp;show_reposts=false&amp;show_teaser=true" width="100%"></iframe></p>

<div style="font-size: 10px; color: #cccccc;line-break: anywhere;word-break: normal;overflow: hidden;white-space: nowrap;text-overflow: ellipsis; font-family: Interstate,Lucida Grande,Lucida Sans Unicode,Lucida Sans,Garuda,Verdana,Tahoma,sans-serif;font-weight: 100;"><a href="https://soundcloud.com/sampletekk-2" style="color: #cccccc; text-decoration: none;" target="_blank" title="SampleTekk">SampleTekk</a> · <a href="https://soundcloud.com/sampletekk-2/7cg-mkii-demo2" style="color: #cccccc; text-decoration: none;" target="_blank" title="7CG MkII Demo2">7CG MkII Demo2</a></div>
Now I'll get the Soundcloud logo, so I guess there's a step forward, but still no sound...
Productpage: https://8fyire8d.a2hosted.com/index.php ... 42&path=33

Per
Sampletekk


New member

Posts

Joined
Mon Aug 19, 2013 4:25 am

Post by ADD Creative » Thu Feb 15, 2024 6:57 pm

Check your web browser's developer tool. You may see a message like the following.
Uncaught DOMException: Failed to read the 'cookie' property from 'Document': The document is sandboxed and lacks the 'allow-same-origin' flag.
In which case you also need to add allow-same-origin to the config.

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by Sampletekk » Thu Feb 15, 2024 10:00 pm

ADD Creative wrote:
Thu Feb 15, 2024 6:57 pm
Check your web browser's developer tool. You may see a message like the following.
Uncaught DOMException: Failed to read the 'cookie' property from 'Document': The document is sandboxed and lacks the 'allow-same-origin' flag.
In which case you also need to add allow-same-origin to the config.
Can't find anything like that

Per
Sampletekk


New member

Posts

Joined
Mon Aug 19, 2013 4:25 am

Post by ADD Creative » Thu Feb 15, 2024 10:29 pm

In Chrome go to the web developer tools, by pressing F12 or 'Developer tools' under 'More tools' in the menu. Other web browsers may have a different method for the developer tool. In the developer tool look under 'Console', where you can see messages and error about your site.

Just checked your link and I see that error in the console.

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by Sampletekk » Fri Feb 16, 2024 12:09 am

ADD Creative wrote:
Thu Feb 15, 2024 10:29 pm
In Chrome go to the web developer tools, by pressing F12 or 'Developer tools' under 'More tools' in the menu. Other web browsers may have a different method for the developer tool. In the developer tool look under 'Console', where you can see messages and error about your site.

Just checked your link and I see that error in the console.
Found it! Didn't know where to look! So, should this be added to the config file?

config.iframe_attributes = {
sandbox: ' allow-same-origin'
}

Per
Sampletekk


New member

Posts

Joined
Mon Aug 19, 2013 4:25 am

Post by ADD Creative » Fri Feb 16, 2024 12:15 am

I think you will need both and maybe others once you have tested that.

Code: Select all

config.iframe_attributes = {
    sandbox: 'allow-scripts allow-same-origin'
}

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by Sampletekk » Fri Feb 16, 2024 4:26 am

ADD Creative wrote:
Fri Feb 16, 2024 12:15 am
I think you will need both and maybe others once you have tested that.

Code: Select all

config.iframe_attributes = {
    sandbox: 'allow-scripts allow-same-origin'
}
No commas or other characters between the statements? 'allow-scripts allow-same-origin'

Per
Sampletekk


New member

Posts

Joined
Mon Aug 19, 2013 4:25 am

Post by ADD Creative » Fri Feb 16, 2024 7:42 am

They are space separated. See the example at the link I posted.
https://ckeditor.com/docs/ckeditor4/lat ... attributes

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by Sampletekk » Fri Feb 16, 2024 4:29 pm

ADD Creative wrote:
Fri Feb 16, 2024 7:42 am
They are space separated. See the example at the link I posted.
https://ckeditor.com/docs/ckeditor4/lat ... attributes
First, thank you for trying to help me out here!
I've updated the config.js file with this:

config.iframe_attributes = {
sandbox: 'allow-scripts allow-same-origin'
}

But I still can't see any playable soundcloud files, and still have this error:

widget-9-1061b89d17d1.js:32 Uncaught DOMException: Failed to read the 'cookie' property from 'Document': The document is sandboxed and lacks the 'allow-same-origin' flag.

Per
Sampletekk


New member

Posts

Joined
Mon Aug 19, 2013 4:25 am

Post by ADD Creative » Fri Feb 16, 2024 5:44 pm

Check your change saved and refresh all caches. If you view your page source your sandbox only has allow-scripts and not allow-same-origin. You could also try adding allow-same-origin to your iframe code.

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom
Who is online

Users browsing this forum: No registered users and 3 guests