solved Cannot find 'error was encountered loading the media URL'

muckajay
@muckajay
9 years ago
19 posts
Can anyone please point me in the right direction so that I can change the text for the error code in the title. It comes up when a none logged in user tries to play music that is on the home page of the website. I want to change it to say they have to be logged in to listen to the music. Checked several language folders in audio support, the skin, users and profiles but not sure where else to look or if I am on the right trail?
updated by @muckajay: 09/11/15 05:55:15AM
paul
@paul
9 years ago
4,326 posts
That error message is hard coded in the Core index.php file. As such, it shouldn't normally occur. How do you have your site set up so that I can replicate it?


--
Paul Asher - JR Developer and System Import Specialist
muckajay
@muckajay
9 years ago
19 posts
If not logged in and yo try and press play on the music on the home page (as you have to be logged in to access the music)
paul
@paul
9 years ago
4,326 posts
So your site is set to 'limited access'?
In that case it would be a good idea to wrap any player buttons on the homepage with a test for logged in users -

{if jrUser_is_logged_in()}
    Button Code
{/if}



--
Paul Asher - JR Developer and System Import Specialist
muckajay
@muckajay
9 years ago
19 posts
Tried it that way but not keen. Any way we can change that original error code? We found the language file in audio support and changed it there but it didn't show the change when logged out. Does this need changing anywhere else as we cannot find it @paul
michael
@michael
9 years ago
7,714 posts
Yeah, as paul said, the text is hard-coded. What is better than trying to change that text is to change the action that occurs when the button is clicked.

I think the suggestion of doing it in the templates is the best one as its easiest to implement, but it is also possible to do at the module level.

The function that is firing that produces that error is:
view_jrCore_stream_url_error()

and it contains an event

"events and listeners"
https://www.jamroom.net/the-jamroom-network/documentation/development/1011/events-and-listeners

So you could tap into that event to return different text or redirect the user to the login page via a small module with a listener in it.

I think the better way would be to expand on pauls idea. So if you want to show the button, but want it to do something different for logged out users, then this structure.

{if jrUser_is_logged_in()}
    Button Code
{else}
   Show a picture of the button that links to the login page
{/if}

That way if the user is logged in, the song plays. if the user is logged out, clicking the button takes them to the login page.
muckajay
@muckajay
9 years ago
19 posts
Thanks @michael we have gone with @paul's idea after all.

Tags