Create subtitle div if target specified but not in DOM tree
I came across this while resolving #752.
If a subtitle target is specified, but it doesn't exist in the DOM tree, it silently errors. The subtitle is not displayed in this case.
Comments and changes to this ticket
- State changed from assigned to peer-review-requested
- Assigned user cleared.
Tested on FF 8, IE 9, Opera 11.52, Chrome 16, Safari 5.1.1
Unit Tests added.
- State changed from peer-review-requested to review-needs-work
- Assigned user set to Steven W
Intuitive solution to a hard problem.
If you don't supply a target, the default div is created, with a guid for the id. Makes sense to me.
If they supply a target, the subtitle uses that target. Also makes sense.
But, what if the user wants to not supply a target div, and have the default one created, and later, get a reference to that element.
This way, the user can supply the id to the container, and later reference it. Also, if the user attempts to supply a target, and it ends up going onto the video, it is pretty obvious the id is not correct.
Intuitive and organic. I love it.
- State changed from peer-review-requested to super-review-requested
- Assigned user changed from Scott Downe to cadecairos
Going to drop some info for super reviewer.
Basically, if you supply an id to subtitle's target, it will use that div if it exists, and create one with that id if it does not exist. Also, if another track event tries to use that id, it will just use the created one, so there won't be any collisions.
- State changed from review-looks-good to staged
- Assigned user changed from cadecairos to Steven W
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
Popcorn.js is an HTML5 video framework that lets you bring elements of the web into your videos.
Popcorn.js is a project of Web Made Movies, Mozilla's Open Video Lab.