Beispiel #1
0
 def video_url_data(self, video_url, autoplay=False, loop=False,
                    hide_controls=False, hide_fullscreen=False, hide_yt_logo=False,
                    hide_dm_logo=False, hide_dm_share=False):
     if not request.env.user.has_group('base.group_user'):
         raise werkzeug.exceptions.Forbidden()
     return get_video_url_data(
         video_url, autoplay=autoplay, loop=loop,
         hide_controls=hide_controls, hide_fullscreen=hide_fullscreen,
         hide_yt_logo=hide_yt_logo, hide_dm_logo=hide_dm_logo,
         hide_dm_share=hide_dm_share
     )
Beispiel #2
0
 def test_get_video_url_data(self):
     self.assertEqual(
         2, len(tools.get_video_url_data(TestVideoUtils.urls['youtube'])))
     #youtube
     self.assertEqual(
         'youtube',
         tools.get_video_url_data(
             TestVideoUtils.urls['youtube'])['platform'])
     #vimeo
     self.assertEqual(
         'vimeo',
         tools.get_video_url_data(TestVideoUtils.urls['vimeo'])['platform'])
     #dailymotion
     self.assertEqual(
         'dailymotion',
         tools.get_video_url_data(
             TestVideoUtils.urls['dailymotion'])['platform'])
     #youku
     self.assertEqual(
         'youku',
         tools.get_video_url_data(TestVideoUtils.urls['youku'])['platform'])
     #instagram
     self.assertEqual(
         'instagram',
         tools.get_video_url_data(
             TestVideoUtils.urls['instagram'])['platform'])