Beispiel #1
0
 def test_utils(self):
     notembed = utils.embed(None, None)
     self.assertTrue(notembed == u"")
     multimedia = api.content.create(
         container=self.portal,
         type='media_link',
         title='video',
         remoteUrl='http://vimeo.com/95988841')
     view = multimedia.restrictedTraverse('@@medialink_oembed_view')
     embed = utils.embed(multimedia, view.request)
     self.assertTrue('<iframe src="https://player.vimeo.com/video/95988841?app_id=122963" width="480" height="270"'in embed)
Beispiel #2
0
 def get_videos(self):
     videos = []
     collection = self.get_videos_collection()
     # limit = collection.getLimit()
     limit = 2
     brains = [b for b in collection.queryCatalog()][:limit]
     for brain in brains:
         video = brain.getObject()
         videos.append(utils.embed(video, self.request))
     return videos
Beispiel #3
0
 def get_videos(self):
     videos = []
     collection = self.get_videos_collection()
     if not collection:
         return None
     limit = api.portal.get_registry_record(
         'cpskin.core.interfaces.ICPSkinSettings.media_viewlet_visible_videos')  # noqa
     brains = [b for b in collection.queryCatalog()][:limit]
     for brain in brains:
         video = brain.getObject()
         videos.append(utils.embed(video, self.request))
     return videos
 def embed(self):
     return utils.embed(self.context, self.request)
Beispiel #5
0
 def embed(self):
     return utils.embed(self.media_link(), self.request)
 def embed(self):
     return utils.embed(self.context, self.request)
Beispiel #7
0
 def embed(self, obj):
     return utils.embed(obj, self.request)
Beispiel #8
0
 def embed(self):
     return utils.embed(self.media_link(), self.request)
Beispiel #9
0
 def get_video(self, video):
     result = utils.embed(video, self.request)
     return result
 def embed(self, obj):
     return utils.embed(obj, self.request)
Beispiel #11
0
 def get_video(self, video):
     result = utils.embed(video, self.request)
     return result