from librarian.output import OutputFile
from librarian.renderers import Register, TreeRenderer
from librarian.utils import Context, get_resource
-from librarian import core, VIDEO_PROVIDERS
+from librarian import core, get_provider
class HtmlFormat(Format):
class DivVideo(NaturalText):
def render(self, element, ctx):
output = super(DivVideo, self).render(element, ctx)
- provider = element.attrib.get('provider', '')
+ provider = get_provider(element.attrib.get('provider'))
video_id = element.attrib.get('videoid', '')
attribs = {
'width': '854',
'height': '480',
- 'src': VIDEO_PROVIDERS[provider]['embed'] % video_id,
+ 'src': provider['embed'] % video_id,
'frameborder': '0',
'allowfullscreen': '',
}