Closed Captions

Getting into LiveCode for iOS? Ask your questions here.

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Post Reply
sritcp
Posts: 431
Joined: Tue Jun 05, 2012 5:38 pm
Location: Alexandria, Virginia

Closed Captions

Post by sritcp » Fri Feb 12, 2021 5:06 pm

Can the LC video controller on iOS play mp4 (m4v) video files with embedded closed captions?
If not, is there a workaround to display closed-captioned video files?

Thanks,
Sri

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5384
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Closed Captions

Post by richmond62 » Fri Feb 12, 2021 5:38 pm

Empiricism.

Well, you should have no problem with open captions considering that they are part of the video file.

Closed captions are not part of the video file. They’re uploaded as a separate file (usually in SRT format) along with the video.

Now, your "embedded closed captions" sounds like open captions . . .

IF, however, you want to display an mp4 video and have it accompanied by a caption file that is NOT part of the video file
why not open your .srt file up in a text editor, copy-paste the text line by line into a scrolling text field and then display the lines
of that scrolling list field in a transparent text field overlapping your videoClip using wait to determine timing for text displays?

sritcp
Posts: 431
Joined: Tue Jun 05, 2012 5:38 pm
Location: Alexandria, Virginia

Re: Closed Captions

Post by sritcp » Fri Feb 12, 2021 7:48 pm

I am just getting to know the intricacies of CC, so the way my question is formulated is informed(!) by my ignorance!

Here’s what I “understand”:
CEA-608/CEA-708 format closed captions can have subtitles in multiple languages (one or none of them to be chosen by clicking the CC button in the video player/controller). The following is one discussion (I couldn’t fully understand):
https://forum.videohelp.com/threads/392 ... -MP4-files
It does say “embedded CEA-608/CEA-708 closed captions”, so….
IF, however, you want to display an mp4 video and have it accompanied by a caption file that is NOT part of the video file
why not open your .srt file up in a text editor, copy-paste the text line by line into a scrolling text field and then display the lines
of that scrolling list field in a transparent text field overlapping your videoClip using wait to determine timing for text displays?
Too much do-it-yourself for me! Also, closed captioning would support two (or more) languages. I was wondering if LC’s video controller/player could handle captioning files (separate .srt file).

If not, I guess, I have one of two options:
1. Have two versions of each video, subtitles in each language burned into the video.
2. Store each video as a webpage (with a suitable player), and retrieve the page in a browser inside the LC app.

May be there is an easier way!

Thanks,
Sri

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5384
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Closed Captions

Post by richmond62 » Fri Feb 12, 2021 8:00 pm

Too much do-it-yourself for me!
Welcome to LiveCode.

sritcp
Posts: 431
Joined: Tue Jun 05, 2012 5:38 pm
Location: Alexandria, Virginia

Re: Closed Captions

Post by sritcp » Fri Feb 12, 2021 10:01 pm

richmond62 wrote:
Fri Feb 12, 2021 8:00 pm
Too much do-it-yourself for me!
Welcome to LiveCode.
:lol:

I wonder if I can enter the HTML embed code for an external video player in LC and have it execute? Not the browser widget, it would mean I'll have to make and store the html file containing the embed code somewhere. Can it execute a snippet of html code provided inside the program? For instance, the sample embed code I have below (does not point to a real file):

Code: Select all

<iframe title="Maestra Player" width="560" height="315" allowFullScreen src="https://web.maestrasuite.com/embed/-a1b2c3d4e5g6h7”></iframe>
can it be executed inside LC? This video player provides a CC option from none to any of a dozen languages (I'd have had to create the .srt files in advance, of course).

Sri

sritcp
Posts: 431
Joined: Tue Jun 05, 2012 5:38 pm
Location: Alexandria, Virginia

Re: Closed Captions

Post by sritcp » Sat Feb 13, 2021 4:00 pm

Hey, setting the htmlText of the browser widget actually works !!!
I stored the embed code of the video player (with video file and closed captions) in a field and

Code: Select all

set the htmlText of widget "MyBrowser" to field "EmbedCode"
The player controls work (including turning on and off the captions),
except for the full screen button. (Is this a bug or a feature of the browser widget?)
Is there a better way to do this?

Thanks,
Sri

sritcp
Posts: 431
Joined: Tue Jun 05, 2012 5:38 pm
Location: Alexandria, Virginia

Re: Closed Captions

Post by sritcp » Sat Feb 13, 2021 7:12 pm

.... except for the full screen button. (Is this a bug or a feature of the browser widget?)
Feature

Sri.

Post Reply

Return to “iOS Deployment”