in progress Proxima, mp3 streaming,

serveion
@serveion
8 years ago
223 posts
Hello

I have a question, about proxima mp3 streaming, and jamroom download.


Here is what am looking at right now, we have mp3 download disable, on jamroom for the website, there is no problem there.

Now on proxima we need mp3 yo be downloaded and streaming to be enable, how can we have the website mp3 disabled but an option on proxima to enable mp3 download,

Thank you.

Jamroom download is disable
updated by @serveion: 08/09/16 07:27:56PM
amartins
@amartins
8 years ago
48 posts
I noticed that New release of Proxima included a module called "Proxima File", but I just don't know how to use it. Seems very helpful to stream music or get images. Am I correct?
brian
@brian
8 years ago
10,144 posts
amartins:
I noticed that New release of Proxima included a module called "Proxima File", but I just don't know how to use it. Seems very helpful to stream music or get images. Am I correct?

Yes it can - if you upload a file when creating a user or data item, then the file will be made available for download - the URL will be included in the GET request.

Let me know if that helps.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
amartins
@amartins
8 years ago
48 posts
The app we're building is bit more complicated. We want to interface with Jamroom system. Meaning that we'd like to make available in the app samples or new songs from artists so we can promote them. Those items are uploaded by the artist, through his account. What we wanted is to have access to those files knowing, for instance, the song id.
updated by @amartins: 05/09/16 03:37:35PM
serveion
@serveion
8 years ago
223 posts
@brian thank you for your answer.

we are using Aparna module for our promotion.
down bellow is the information we have for our module.
what we would like to know is how we can get the mp3 file the url or how to call it.
we are a bit confuse. using proxima.

{
"_created": "1459027907"
"_profile_id": "126"
"_updated": "1459027907"
"_user_id": "4"
"promotion_audio_bitrate": "128"
"promotion_audio_extension": "mp3"
"promotion_audio_length": "00:03:04"
"promotion_audio_name": "Tarik - Te Tengo Loquita (The Main Brain).mp3"
"promotion_audio_size": "2959603"
"promotion_audio_smprate": "44100"
"promotion_audio_time": "1459027907"
"promotion_audio_track": "1"
"promotion_audio_type": "audio/mpeg"
"promotion_date": "1490500800"
"promotion_desc": "Hola este es <b>Tarik Main Brain</b> invitandoles a que escuchen mi nuevo single <b>Te Tengo Loquita</b>"
"promotion_expiration": "Enable"
"promotion_image_extension": "png"
"promotion_image_height": "459"
"promotion_image_name": "wow logo bg negro.png"
"promotion_image_size": "15443"
"promotion_image_time": "1459027907"
"promotion_image_type": "image/png"
"promotion_image_width": "422"
"promotion_pending": "0"
"promotion_title": "Tarik - Te Tengo loquita"
"promotion_title_url": "tarik-te-tengo-loquita"
"promotion_youtube": "azhD_ZuxPOI"
"_item_id": "3"

updated by @serveion: 05/09/16 03:39:18PM
brian
@brian
8 years ago
10,144 posts
You would want to use the BRIDGE module for this:

- go into Proxima Bridge -> Global Config and make sure you activate your custom module
- you can then make a GET request to api/bridge/promotion/3 to get the info for _item_id 3 - note that you would want to change "promotion" to the URL that you setup for your custom module as found in it's "INFO" tab.

You can also do POST, PUT and DELETE as well.

Let me know if that helps.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
brian
@brian
8 years ago
10,144 posts
amartins:
The app we're building is bit more complicated. We want to interface with Jamroom system. Meaning that we'd like to make available in the app samples or new songs from artists so we can promote them. Those items are uploaded by the artist, through his account. What we wanted is to have access to those files knowing, for instance, the song id.

Yep - you can do that using the Proxima Bridge module - i.e.

GET http://yoursite.com/api/bridge/audio/5

See my response above - the same thing applies here.

Let me know if that helps.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
amartins
@amartins
8 years ago
48 posts
brian:
Yep - you can do that using the Proxima Bridge module - i.e.
GET http://yoursite.com/api/bridge/audio/5
See my response above - the same thing applies here.
Let me know if that helps.

The Audio module is enabled on Proxima Bridge but here's what I get when I try to get audio items or list:
{
"code": 400
"text": "Bad Request"
"note": "module is not enabled in Proxima Bridge"
}

Any idea what's going on? Other modules checked are working fine, except this one.
updated by @amartins: 05/09/16 03:49:03PM
brian
@brian
8 years ago
10,144 posts
You might need to use "uploaded_audio" as the URL - check the "info" tab of the audio module to get the URL that is being used on your site.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
brian
@brian
8 years ago
10,144 posts
you'll need to use the "download" URL in this case - streaming is not going to work unless you disable play keys, but you should be able to do:

http://yoursite.com/promotion/download/promition_audio/3

Let me know if that helps.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net

updated by @brian: 05/09/16 04:32:06PM
amartins
@amartins
8 years ago
48 posts
Brian, I made some debug on jrProximaBridge code:
$_conf['jrProximaBridge_active_modules']
gives me this:
"jrAudio,jrBlog,jrFollower,jrGallery,jrPage,jrPlaylist,xxPromotion,xxShoutcast, jrAction,jrYouTube"

jrAudio is the audio module that we need, correct?

For some reason, with this string, the
if(strpos(',' . $_conf['jrProximaBridge_active_modules'] . ',', ",{$mod},"))···
returns false when $mod="jrAudio".

This doesn't make sense!
Ah! Once jrAudio is the first match returned value is 0, because strpos returns the index of first occurrence so PHP will interpret as false, so maybe changing this to:
if(strpos(',' . $_conf['jrProximaBridge_active_modules'] . ',', ",{$mod},") >= 0)···
When strpos doesn't find any occurrence it will return FALSE but may return other values which evaluates to false and per the Php Manual (Warning)
updated by @amartins: 05/09/16 05:31:49PM
serveion
@serveion
8 years ago
223 posts
brian:
you'll need to use the "download" URL in this case - streaming is not going to work unless you disable play keys, but you should be able to do:http://yoursite.com/promotion/download/promition_audio/3
Let me know if that helps.

Error: Offsite media downloads are blocked how can we enable this.
brian
@brian
8 years ago
10,144 posts
serveion:
Error: Offsite media downloads are blocked how can we enable this.

ACP -> Core -> Global Config -> enter "ALLOW_ALL_DOMAINS" in the "Allowed Domains" setting and save.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
brian
@brian
8 years ago
10,144 posts
amartins:
For some reason, with this string, the
if(strpos(',' . $_conf['jrProximaBridge_active_modules'] . ',', ",{$mod},"))···
returns false when $mod="jrAudio".
This is a "rookie" mistake on my part and I will get it fixed.. sorry about that!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net

updated by @brian: 05/09/16 06:14:30PM
brian
@brian
8 years ago
10,144 posts
brian:
amartins:
For some reason, with this string, the
if(strpos(',' . $_conf['jrProximaBridge_active_modules'] . ',', ",{$mod},"))···
returns false when $mod="jrAudio".
This is a "rookie" mistake on my part and I will get it fixed.. sorry about that!

I'm not seeing this in the code any longer, so I believe this has already been fixed - I will get the new release out with the fix in place.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
amartins
@amartins
8 years ago
48 posts
brian:
This is a "rookie" mistake on my part and I will get it fixed.. sorry about that!

No problem at all! We're here to be helped, but also to help.
Thanks for everything.
serveion
@serveion
8 years ago
223 posts
brian:
serveion:
Error: Offsite media downloads are blocked how can we enable this.
ACP -> Core -> Global Config -> enter "ALLOW_ALL_DOMAINS" in the "Allowed Domains" setting and save.


This option is enable,
brian
@brian
8 years ago
10,144 posts
As long as you have ALLOW_ALL_DOMAINS in your config, you will not get this error:

Error: Offsite media downloads are blocked

If you ARE getting that error, please post the URL you are using for download.

Thanks!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
serveion
@serveion
8 years ago
223 posts
Hello @brian

Here is the url

http://dev.wowmusic.fm/promotion/download/promition_audio/3
updated by @serveion: 05/10/16 12:52:08PM
brian
@brian
8 years ago
10,144 posts

That check relies on the value of the HTTP_REFERER field, but without it the check "falls through" and fails. What I need to do here is update this check so if ALLOW_ALL_DOMAINS is entered, then it will allow even empty referrals to go through - that should fix it for you.

I will get that into the next core release.

Hope this helps!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
amartins
@amartins
8 years ago
48 posts
brian:That check relies on the value of the HTTP_REFERER field, but without it the check "falls through" and fails. What I need to do here is update this check so if ALLOW_ALL_DOMAINS is entered, then it will allow even empty referrals to go through - that should fix it for you.

I noticed this and I suspected that you were using Referer header to check this. For now I guess this is not a problem as I can append that header in Java HTTP request. I successfully downloaded a file in Linux (Ubuntu) using curl:
curl -o musicfile.mp3 -X GET -H "Content-type: *" -H "Referer: http://dev.wowmusic.fm" http://dev.wowmusic.fm/promotion/download/promotion_audio/7

Same with:
curl -o musicfile.mp3 -X GET -H "Content-type: *" -H "Referer: http://dev.wowmusic.fm" http://dev.wowmusic.fm/promotion/stream/promotion_audio/7

Is this last a valid option for streaming?
updated by @amartins: 05/10/16 02:19:12PM
michael
@michael
8 years ago
7,697 posts

You can make that link have the referrer field filled by using firebug to paste it into a link on the top page of the site. I did that for your link and a different error was shown:
Error: Invalid media id - no media item found
Which means the file was not found. Check that there is a file there.

--
actually, it looks like the URL is wrong. I think the prefix has a spelling mistake in it, try:
http://dev.wowmusic.fm/promotion/download/promotion_audio/7
amartins
@amartins
8 years ago
48 posts
michael:
actually, it looks like the URL is wrong. I think the prefix has a spelling mistake in it, try:
Indeed it has a mistake: is not promition_audio but promotion_audio.

And in Java (Android) just have to set the Referer key,value in the request header.

Tags