[wp-trac] [WordPress Trac] #32214: Video subtitles removed from shortcode
WordPress Trac
noreply at wordpress.org
Mon Jun 1 06:31:56 UTC 2015
#32214: Video subtitles removed from shortcode
--------------------------+-------------------------
Reporter: starepod | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 4.2.3
Component: TinyMCE | Version: 4.2
Severity: normal | Resolution:
Keywords: needs-patch | Focuses: javascript
--------------------------+-------------------------
Comment (by scriptrunner):
It looks like HTML5 and Shortcodes were being mixed together. As reported
by @starepod, after adding subtitles, the editor showed something like
this:
`[video width="480" height="360" mp4="http://localhost/wp-
content/uploads/2015/06/test.mp4"]> srclang="en" label="English"
kind="subtitles" src="http://localhost/wp-
content/uploads/2015/06/test.vtt"<[/video]`
which is putting the nested track tag as HTML5 inside the partent video
tag as a shortcode. So my first update was to change the output to:
`[video width="480" height="360" mp4="http://localhost/wp-
content/uploads/2015/06/test.mp4"][track srclang="en" label="English"
kind="subtitles" src="http://localhost/wp-
content/uploads/2015/06/test.vtt"][/track][/video]`
This presented two more issues, one which I've also added to the patch,
the other I haven't solved yet.
1) There was no track shortcode, so I added that, primarily using code
from the original plugin.
2) Once you save the page/post, then you can't edit the video again, as
it's throwing a JavaScript error in jQuery:
`jquery....=1.11.2 (line 2, col 12716)
Error: Syntax error, unrecognized expression: [track srclang="en"
label="English" kind="subtitles" src="http://localhost/wp-
content/uploads/2015/06/test.vtt"][/track]
....value:null},gb.error=function(a){throw new Error("Syntax error,
unrecognized ex...`
This one seems tricky and I haven't found a solution yet. I'm pretty sure
it has to do with the `wp_ajax_parse_media_shortcode()` function in `wp-
admin/includes/ajax-actions.php`
I'll continue working on it, but perhaps someone more knowledgeable with
core can figure it out quicker. This is my first patch, so I hope a
partial one to get he ball rolling is ok. I also rely heavily on closed
captioning, so this ticket is dear to me :)
--
Ticket URL: <https://core.trac.wordpress.org/ticket/32214#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list