News:

Dear forum visitors, if the support forum is not available, please try again a few minutes later. Thanks!

Main Menu
Support-Forum

js integration

Started by jhoefs, 26.07.2022 18:38:54

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jhoefs

Hi everyone! I'm wanting to use jDownloads to help deliver audio in a subscription service, with a custom JS player I already created, and I'm wondering if this is going to work? so I'm reaching out to the community

I already have a media player created from howler.js - what I'd like to do is simply deliver the links to the webpage through PHP, so that the JS can pick it up and start playing when the user hits play.

I'd like to also have all the features of jDownload - limit daily downloads, deliver only to subscribers, etc. I think this, along with a referrer policy on my CDN, should secure the subscription service.

Will this work? Does jDownloads have to be delivered only through their modules? Or will a URL to a file still trigger 1) checking to see if user is subscriber and 2) enforcing daily download limits?

I was even thinking I could use jDownloads content module to publish the link on that page, but make it invisible, and just grab the link from it with JS. Will this work? Or are there things happening behind the scenes with jDownloads that would prevent that from working visa vie limits/ACL?

Thank you so much!

  •  

ColinM

Hi
Several people use jD for delivering services as you outline
jD provides audio and  video players.  Think you could subsitute your audio player.

All of the features you mention are included.  jD makes use of the Joomla!user group and view access so you can control which each user group can do and see.
Downloads are shown on the main page and also with Moules such as Top and Latest which show the most popular Downloads and the latest additions.  There are several other modules showing isay Featured Downloads. But the main 'listing' are on the main page view.
Colin
PS jD is currently running on Joomla 3.10 as we are busy convertig jD to Joomla 4
Colin M
  •  

jhoefs

#2
Well since I've been developing the player for a bit, It's alot better if I use this one, as the design of the app is integral to what I'm delivering. Would have to redesign everything if we switched players at this point

The app is built on Howler.js (a JS audio framework), and I'm thinking it should be pretty straightforward to integrate - how does the delivery flow go with your HTML5 player, from PHP -> HTML -> client interaction ?

I should be able to adapt that to deliver that to the Howler.js app - what do I need to know for that? What sort of communication will jDownload need for me to make that happen, in terms of its validation etc

The workflow looks like this - only subscribers can see this Joomla page, they open it, it's a fullscreen player, with special instructions and interactivity intrinsic to the delivery - the audio begins loading as soon as the page is called, which is important because this is HD audio, not mp3's, we cannot use mp3's for what I am doing - I simply need the filename, which will be different everyday, delivered to Howler.js behind the scenes. I would need jDownloads to still track the download by the user and register the event.

Does jDownloads change filenames or do any file name masking? I'd like to prevent other people from downloading the file, so this would be nice. If so, how does that work out with CDN's?

Thank you so much!
  •  

ColinM

Hi
I quite understand  and Yes it should be reasonably straight forward to changeover the audio  'provider'. Basically as a replacement for 'flowplayer'
But what I was suggesting is that you first become familiar with using jDownloads before changing over.

There is a load of documentation at https://www.jdownloads.net/
Colin
Colin M
  •  

jhoefs

That makes sense! I'll make a test page with one of the other audio players, and observe the workflow.
  •  

jhoefs

Ok, so I took a look at the layouts and that seems to be the key here. I think what I'll do is create a blank layout, with no visual output, that delivers the file url to the JS package.

It seems like {download_url} will always trigger an actual download, which I don't want. Is there a better placeholder to use to deliver the file url? Or perhaps I can catch and modify what jdownloads sends back. Or can it send it upon opening the page if a jdownloads generated link is used to send it there

I can simulate a click if needed for a button, so the file is delivered to the JS package immediately on page load, if that's the best methodology.

A couple things: will this successfully create the workflow with jdownloads, so that it registers the download and can limit the user to only 15 downloads a day, etc?

Will it be necessary for me to figure out a way to make all links on the site that go to that player page be generated through jdownloads, so that it registers the users action?

Thank you!
  •  

jhoefs

Well I'm still trying to figure this out. I can click through a link to get a direct download. I can preventdefault on that - however I am still struggling on how to intercept the actual file link and pass it to the JS player

I am looking around in the php and trying to see what I can make happen. If I put the url with the query string into the JS, and request it through there, will it return the correct file?

I looked at the audio file examples on your site, but none of them seemed to have a working player, and I tried setting up a file that plays through and HTML5 player with the extension, and that did not work either
  •  

ColinM

Hi
You are running too fast!!
Just please get the regular jD audio working as normal using in the first instance the HTML5 player.  Then switch the options to use the Flowplayer.
Then when you see that is ok I will help you substitute your player for Flowplayer.

The layouts are not the key and do not need changing.

I wil send you a Personal Message (PM) These are secure

Colin
Colin M
  •  

jhoefs

Not sure if this is going to work, the HTML5 player reveals the file location, which I don't want -

Also, it's not clear how to integrate with Flowplayer. Flowplayer provides a widget and a JS resource for people to setup a media playing situation, from the documentation of jdownloads it is not clear how you want us to set that up. Do you simply want the widget and script loaded on a page, and then jdownloads automatically finds that and uses it?
  •  

ColinM

Hi
All web brousers reveal the location when they are playing audio and video.  That is why we always advise people to use a preview.

My thoughts are that we replace flowplayer with your video player.
Is your player stand alone? How do you pass parameters to your player?

Colin
PS we are very busy with getting jd$ ready so that is causing delays
Colin M
  •  

jhoefs

I actually appreciate how helpful this forum, and your time. Thank you!  8)

I got passed that previous problem, and have server side implementation working and smooth!

I'm on to something else: I am trying to figure out where in the PHP the actual download filename is delivered. I will then add a query string to that last stage of the process - once I do that, I will have implemented URL signing with my CDN and a very robust secure delivery

I am hoping I can just inject a function that generates the URL signing string, and then appends it to the URL as a query string

  •  

ColinM

Hi
It is the Views which deliver the front end view on the screen. They are
site/views/xxxx/tmpl/default.php where xxxx is either category, downloads or mydownloads.

Colin
Colin M
  •