Forum Activity for @michael

michael
@michael
02/22/16 02:47:26PM
7,832 posts

Using a media player with Playlists


Using Jamroom

If you look in the source code of a playlist page, you will see the paths:
.....
        new jPlayerPlaylist( {
            jPlayer: "#jquery_jplayer_mKVyZRclSwUrAi",
            cssSelectorAncestor: "#jp_container_mKVyZRclSwUrAi"
        } , [
                        {
                title: "[audio] Song one ",
                artist: "admin",
                module: "jrPlaylist",
                item_id: "1",
                mp3: "http://jr500.hostsaba.com/uploaded_audio/stream/audio_file/1/key=G36hPE3VFysP/file.mp3",
                                poster: "http://jr500.hostsaba.com/uploaded_audio/image/audio_image/1/xxxlarge/image.jpg"
    } ,
                {
                title: "[audio] opera",
                artist: "admin",
                module: "jrPlaylist",
                item_id: "2",
                mp3: "http://jr500.hostsaba.com/uploaded_audio/stream/audio_file/2/key=G36hPE3VFysP/file.mp3",
                                poster: "http://jr500.hostsaba.com/uploaded_audio/image/audio_image/2/xxxlarge/image.jpg"
    } ,
                {
                title: "[audio] rain sounds",
                artist: "admin",
                module: "jrPlaylist",
                item_id: "3",
                mp3: "http://jr500.hostsaba.com/uploaded_audio/stream/audio_file/3/key=G36hPE3VFysP/file.mp3",
                                poster: "http://jr500.hostsaba.com/uploaded_audio/image/audio_image/3/xxxlarge/image.jpg"
    } ,
.....

If you look in the .tpl of the smarty file that generates those urls you will see how they are constructed there, eg:
/modules/jrAudio/templates/jrAudio_black_overlay_player.tpl

.....
        new jPlayerPlaylist({
            jPlayer: "#jquery_jplayer_{$uniqid}",
            cssSelectorAncestor: "#jp_container_{$uniqid}"
        },[
            {if is_array($media)}
            {foreach $media as $a}
            {if $a._item.$ext == 'mp3'}
            {
                title: "{$a.title}",
                artist: "{$a.artist}",
                mp3: "{$jamroom_url}/{$a.module_url}/stream/{$params.field}/{$a.item_id}/key=[ jrCore_media_play_key]/file.mp3",
                {if strstr($formats, 'oga')}
                oga: "{$jamroom_url}/{$a.module_url}/stream/{$params.field}/{$a.item_id}/key=[ jrCore_media_play_key]/file.ogg",
                {/if}
                poster: "{$jamroom_url}/{$a.module_url}/image/audio_image/{$a.item_id}/large"
            },
            {/if}
            {/foreach}
            {/if}
        ],{
.....

The key=[ jrCore_media_play_key] is replaced by a key to check that the file is being played from the site. If you dont care, you can disable the check by adding ALLOW_ALL_DOMAINS at:
ACP -> CORE -> SYSTEM CORE -> GLOBAL CONFIG -> GENERAL
(screenshot)
screenshot_allow_all_domains.jpg screenshot_allow_all_domains.jpg - 132KB

updated by @michael: 02/22/16 02:49:14PM
michael
@michael
02/22/16 02:10:04PM
7,832 posts

Using a media player with Playlists


Using Jamroom

try putting a static .mp3 file in the root of your system
/data/*
/modules/*
/skins/*
some-music-file.mp3

the url to that will be as expected:
http://YOUR-SITE.com/some-music-file.mp3

If you can get that to play first, then move to swapping that out to the jamroom url it should be easier to understand which part is causing trouble.
michael
@michael
02/22/16 02:03:37PM
7,832 posts

Phpstorm help for Jamroom


Using Jamroom

got it, yeah, jrCore_media_player is a smarty function, phpstorm doesnt show help for these, just for php functions.

Here are a few key patterns I use all the time:
ctrl+shift+alt+n = locate a function by name.

so if you put jrCore_media_player in there, it would bring up smarty_function_jrCore_media_player() which is where that function is defined and you could see how it works.

ctrl+shift+n = locate a file by name.
Useful if you know you want to go somewhere like the jrAudio/item_detail.tpl page It has partial complete so 'audio/item_detail' will get you to the same location.

alt+shift+l = prettify my code
Not related in this situation, but damned useful to make all your code look pretty.
michael
@michael
02/22/16 01:16:54PM
7,832 posts

Using a media player with Playlists


Using Jamroom

prefer other questions to go under their own heading in a new thread where possible as it helps others coming later who search for answers.

quite hard to understand you're follow up question sorry. I think its "can I use a player other than the default one for playing the playlists?" If it is then YES you can, you'd copy the template of the module you want to over-ride to your skin and prefix it with the modules name. so

/modules/jrPlaylist/templates/item_list.tpl
would be over-ridden at:
/skins/(YOUR SKIN)/jrPlaylist_item_list.tpl

--edit--
Docs: "Altering a Modules template"
https://www.jamroom.net/the-jamroom-network/documentation/development/1051/altering-a-modules-template
updated by @michael: 02/22/16 01:17:58PM
michael
@michael
02/22/16 01:12:11PM
7,832 posts

Phpstorm help for Jamroom


Using Jamroom

yep, your missing an explanation for me on how to checkout what your seeing, thats forcing me to make random guesses :)

Make sure your PhpStorm is in sync with whatever you have on your server.

you can ctrl+click to go to the function in the file where its defined and read the doc-block from there. If there is no doc-block then obviously it wont show.

I'm assuming you are talking about in .php files, not smarty files because it wont work there.

also checkout the:
HELP -> PRODUCTIVITY GUIDE

There is guaranteed to be stuff in there that you're not using. I've been using it since version 1.0 and there's still stuff I find that is new and exciting. Great piece of software.
michael
@michael
02/22/16 01:08:26PM
7,832 posts

Problem with Nova Skin update


Installation and Configuration

love that. thanks eddy for the update.

Guess is that it was probably the cache.
michael
@michael
02/22/16 01:07:36PM
7,832 posts

video not converting?


Using Jamroom

If you can attach a copy of the original file here, I can try uploading it to my system.

That would allow us to know if its a 'something in your system' error, or a 'problem with the file' type error.
michael
@michael
02/22/16 01:05:02PM
7,832 posts

Sql error whilst performing integrity check


Using Jamroom

This bit of code would fail:
UPDATE jr_jrgroup_member SET member_active = '0' WHERE `member_user_id` = 

It equates to the sentence "update the group member who's member ID is .......".

Yeah that would throw me for an error too, its annoying when people don't finish their sentences so its coherent. :)

Seams like something group related is trying to be actioned on a member but the members ID is not provided.

Got steps how to replicate it?
michael
@michael
02/22/16 01:00:36PM
7,832 posts

add "Empty Playlist" help text to the profile tab.


Design and Skin Customization

It can be done by changing the
/modules/jrPlaylist/templates/item_list.tpl

from the end:
{/if}
to
{else}
    (Add items to a playlist by browsing the site media)
{/if}

But whether it should be there by default or not, im not sure about. We dont have a "click the + button to add an audio file" for the audio module or any of the other ones.

So the question becomes a "should documentation of how the modules work be included in the modules themselves".

Not sure it should. mmmm....
michael
@michael
02/22/16 12:20:05PM
7,832 posts

In need of some jrCore_download_file advice


Jamroom Developers

if not flags, set/get temp value, eg:
 jrCore_set_temp_value('jrAudio', $zipfile_name, time());

Its like an associative array but gets stored/retrieved via the database instead of cookies or the session.

What I would do to debug is to put a breakpoint where you want to use the $_user, then go looking higher in the stack to see if its there any earlier on. Might be gettable with
global $_user;

--
Why do you need the $_user data to be available, is it causing an issue?
  425