hyperaudio / wordpress-hyperaudio

a wordpress plugin to display interactive transcripts
GNU General Public License v2.0
11 stars 8 forks source link

feature: separate player and transcript shortcodes #128

Closed composerjk closed 10 months ago

composerjk commented 11 months ago

@maboa: A little while back, I started a quick implementation of separate player and transcript shortcodes. So, one could place the player and transcripts in different spots; also, make it easier to have two transcripts attached to the same hyperaudio player. I'm in the process of moving this to live, so thought I would mention. Will try to clean up more in case you're interested in including something like it.

Here's an example with two synchronized transcript windows: transcript + chat. Transcripts are files in custom fields. Set up with something like:

Set up the player:

[hyperaudio_player id="haplayer1" width="100%" height="600px" transcript-height="1em" show-active="true" src='https://player.vimeo.com/video/{{dc:post:meta key="video_id"}}']

Transcript 1 in one spot:

[hyperaudio_transcript id="transcript1" player_id="haplayer1" file="{{dc:acf:post_field field="transcript_file"}}" show_hyperaudio_production="false"]

Chat 1 (i.e., transcript 2) in another spot:

[hyperaudio_transcript id="chat1" player_id="haplayer1" file="{{dc:acf:post_field field="chat_file"}}"]
image

The current code for the shortcodes is on our player-transcript-shortcodes branch. I also put together a test-separate-shortcodes-release branch to include recent PRs #123 and #124 I submitted since I'm moving this from staging to production. This still more cleanup to do, but I thought I'd share the progress and add a note. Will try to cleanup at some point and submit a PR when ready.

I also added an option to disable the A Hyperaudio Production mark with a show_hyperaudio_production attribute on the hyperaudio_transcript shortcode, so that one doesn't end up with it on every transcript.

I was just reminded that I had made a change (not included in the branches) to the default scrollerOffset from 0 to -160 so that the highlighted portions of the transcripts are more centered. Will open an issue to mention adding support of specifying that value.

maboa commented 11 months ago

Thanks for all of this @composerjk – looks like an interesting development. I'll take a look in the coming days.

maboa commented 10 months ago

Hi @composerjk – apologies for the delay in getting back to you. First of all, thanks for looking into this. I'm a little hesitant to merge this because one of the key objectives with this plugin is to make it as easy as possible to use – I wouldn't want to lose the simplicity we already have, so I think any changes should maintain backward compatibility, the issue there would be the added complexity of the codebase.

To help me evaluate – can I ask what you see as the use case for multiple transcripts connected to the same source?

Regarding the other issues show_hyperaudio_production and scrollerOffset I think we could proceed with those, although we should probably standardise a naming convention – camelCase or snake_case.

In any case I would kindly ask that each issue be separated into separate issues.

I'm going to convert this issue to a discussion so we can better go through the finer points. Hope that works for you.