Custom Video Tag Player

alt=
@yarnell
2 years ago
2 posts
Good day,
I can't for the life of me... figure out how to change the id="jp_video_0" in the video tag. Same with the id="jp_audio_0" in the audio tag. My first question is... Will replacing it effect the stats? Second question... How do I replace it?
Thanks.
updated by @yarnell: 08/10/22 04:20:32PM
michael
@michael
2 years ago
7,646 posts
Not sure the location your talking about, got a URL?

Almost everything is controlled by a template (.tpl files). These are mostly in your skin /skins/(your skin)/*.tpl

In some instances these can be in modules like this /modules/jrVideo/templates/some_template.tpl you can over-ride that by copying it to your skin and giving it the name /skins/(your skin)/jrVideo_some_template.tpl Use that naming convention to over-ride module templates with the custom version in your skin. You can then adjust that however you like and it will survive an update to the module.

--edit--
Then to locate which template is in use in a certain area of the system there's a developer tool at
ACP -> MODULES -> DEVELOPER -> DEVELOPER TOOLS -> GLOBAL CONFIG -> Template names in source.

Enable that then look at the source code to find out what template is in use.
updated by @michael: 05/08/22 06:10:51PM
alt=
@yarnell
2 years ago
2 posts
hmm. I already know what template its in. my question is regarding the tag that is generated by jplayer. I will just ask the broader question i guess. I'd like to replace jplayer with https://plyr.io. how would I do that?
michael
@michael
2 years ago
7,646 posts
There's two basic concept angles to come at it from:
1) include it as part of your skin.
2) create it as a stand alone module.

The first is probably simpler to get setup but not as flexible the second takes more effort to get setup but is much more reusable/distributable.

An example of it in a skin is: Take a look through the code base search for 'jrPost_video_action_player' You will find it in /skins/jrPost/include.php in the _init() function and also as a file in /skins/jrPost/jrPost_video_action_player.tpl

then in use like this
{jrCore_media_player type="jrPost_video_action_player" module="jrVideo" field="video_file" item_id=$item.action_item_id autoplay=false}
Thats an example of a skin over-ride of the player code with new player code.

(I haven't looked at this area in a few years)

The second method involves creating a module, i'll need to get refreshed on how this would work.
michael
@michael
2 years ago
7,646 posts
Here's the start of a module to get plyr going. Their git code is in the /modules/jrPlyr/contrib/plyr-master folder.

The work player code needs to go into /modules/jrPlyr/templates/jrPlyr_video_player.tpl

You can see that player on the web at:
http://yoursite.test/plyr/demo/video_id=2

Where video_id=2 is a video that exists on your site somewhere. substitute 2 for whatever video actually exists.

That should get you going, if you need it more fleshed out we have the "Sponsor a module" system:
https://www.jamroom.net/the-jamroom-network/documentation/module-developer-guide/4931/sponsor-a-module

To reduce development costs to whoever wants stuff that also benefits the community. Maybe of interest, maybe not.
zip
jrPlyr.zip  •  385KB


updated by @michael: 05/10/22 10:43:12PM

Tags