Download Media from WordPress
This feature allows you to add a link to any WordPress page that will download media to the app that can be accessed offline.
This feature can be used to download course materials in a LearnDash app, or download video or audio on any post or page.
How is this different from the Media List?
The media list uses a WP-API route, and gets the download url from post meta. The feature described on this page is for WordPress (iframe) pages, and the download link is added in the WordPress post editor.
Note: AppPresser 4 uses a different way to display downloaded media in the app. Please click here.
To add a download link, visit any WordPress post or page on your site. Add a link that looks like this:
<a class="button app-download" href="https://mysite.com/wp-content/uploads/2018/12/my-media.mp4" data-download-title="Champion">Download Champion</a><br>
- class of "app-download" - this tells the app to download the media
- href - path to the media file
- data-download-title - title of the download, used to display in the app
Add the page to your app by visiting your app customizer => Menus => Add Item => WordPress/external link. Note: you cannot test downloads in the preview, you must build the app for your device.
Next you need a place to display the downloads in the app.
Next, you must enable media playback on native devices. Visit the Settings tab, and check "Enable Media Playback", then save.
Display Downloads in App
Now that the file has been downloaded, you need a place to display it in the app.
If you just purchased, you are using AppPresser 4. Create a new custom HTML page in your app customizer, and add this code:
Add the page to your menu, and rebuild your app. This feature does not work in the browser preview, you must be on a device to test.
AppPresser 3 Only
For AppPresser 3 apps, create a new Custom HTML page, and add this code:
<ion-item (click)="showDownloads()"> <ion-icon name="download" item-left></ion-icon> Show Downloads </ion-item>
You can change the markup, the important thing is the (click)="showDownloads()" part. That opens a modal that displays the downloads.
The user can click that button, then play the media that has been downloaded.