provide a special view for Flash videos
git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@2791 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
parent
d57b30f2e0
commit
d3bda353be
6 changed files with 166 additions and 2 deletions
|
@ -56,4 +56,6 @@
|
|||
permission="zope.View"
|
||||
/>
|
||||
|
||||
<include package=".video" />
|
||||
|
||||
</configure>
|
||||
|
|
4
integrator/content/video/__init__.py
Normal file
4
integrator/content/video/__init__.py
Normal file
|
@ -0,0 +1,4 @@
|
|||
"""
|
||||
$Id$
|
||||
"""
|
||||
|
45
integrator/content/video/browser.py
Normal file
45
integrator/content/video/browser.py
Normal file
|
@ -0,0 +1,45 @@
|
|||
#
|
||||
# Copyright (c) 2008 Helmut Merz helmutm@cy55.de
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
"""
|
||||
View class(es) for accessing Flash videos.
|
||||
Mittwoch
|
||||
$Id$
|
||||
"""
|
||||
|
||||
from zope import interface, component
|
||||
from zope.cachedescriptors.property import Lazy
|
||||
|
||||
from loops.common import adapted
|
||||
from loops.integrator.content.browser import ExternalAccessRenderer
|
||||
|
||||
|
||||
class FlashVideo(ExternalAccessRenderer):
|
||||
|
||||
def __call__(self):
|
||||
return self.index(self)
|
||||
|
||||
def publishTraverse(self, request, name):
|
||||
if name == 'start':
|
||||
return self
|
||||
return self.adapted()[name]
|
||||
|
||||
@Lazy
|
||||
def title(self):
|
||||
return self.adapted.title
|
||||
|
15
integrator/content/video/configure.zcml
Normal file
15
integrator/content/video/configure.zcml
Normal file
|
@ -0,0 +1,15 @@
|
|||
<!-- $Id$ -->
|
||||
|
||||
<configure
|
||||
xmlns:zope="http://namespaces.zope.org/zope"
|
||||
xmlns:browser="http://namespaces.zope.org/browser"
|
||||
i18n_domain="loops">
|
||||
|
||||
<browser:page
|
||||
name="video.html"
|
||||
for="loops.interfaces.INode"
|
||||
class="loops.integrator.content.video.browser.FlashVideo"
|
||||
template="video.pt"
|
||||
permission="zope.View" />
|
||||
|
||||
</configure>
|
97
integrator/content/video/video.pt
Normal file
97
integrator/content/video/video.pt
Normal file
|
@ -0,0 +1,97 @@
|
|||
<!-- saved from url=(0013)about:internet -->
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<style type="text/css">
|
||||
.button a:link, .button a:visited {
|
||||
margin: 1em 0 1em 0;
|
||||
padding: 2px 4px 2px 4px;
|
||||
background-color: #e8e8e8;
|
||||
text-decoration: None;
|
||||
color: Black;
|
||||
border-width: 2px;
|
||||
border-style: solid;
|
||||
border-color: #f4f4f4 #989898 #989898 #f4f4f4;
|
||||
}
|
||||
.button a:active { border-color: #989898 #f4f4f4 #f4f4f4 #989898; }
|
||||
|
||||
</style>
|
||||
|
||||
<title tal:content="view/title">00_Einleitung</title>
|
||||
<script language="javascript"> AC_FL_RunContent = 0; </script>
|
||||
<script language="javascript"> DetectFlashVer = 0; </script>
|
||||
<script src="AC_RunActiveContent.js" language="javascript"></script>
|
||||
<script language="JavaScript" type="text/javascript">
|
||||
<!--
|
||||
// -----------------------------------------------------------------------------
|
||||
// Globale Variablen
|
||||
// Erforderliche Hauptversion von Flash
|
||||
var requiredMajorVersion = 9;
|
||||
// Erforderliche Unterversion von Flash
|
||||
var requiredMinorVersion = 0;
|
||||
// Erforderliche Flash-Revision
|
||||
var requiredRevision = 115;
|
||||
// -----------------------------------------------------------------------------
|
||||
// -->
|
||||
</script>
|
||||
<script language="JavaScript" type="text/javascript"
|
||||
tal:define="movieName request/id|string:"
|
||||
tal:content="string:movieName = '$movieName';">
|
||||
</script>
|
||||
</head>
|
||||
<body bgcolor="#000000" style="font-family: Arial,Helvetica">
|
||||
<!--Im Film verwendete URLs-->
|
||||
<!--Im Film verwendeter Text-->
|
||||
<div style="width: 1000">
|
||||
<script language="JavaScript" type="text/javascript">
|
||||
<!--
|
||||
if (AC_FL_RunContent == 0 || DetectFlashVer == 0) {
|
||||
alert("Diese Seite erfordert die Datei AC_RunActiveContent.js.");
|
||||
} else {
|
||||
var hasRightVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
|
||||
if(hasRightVersion) { // sofern eine akzeptable Version ermittelt wurde
|
||||
// Flash-Film einbetten
|
||||
AC_FL_RunContent(
|
||||
'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0',
|
||||
'width', '1000',
|
||||
'height', '768',
|
||||
'src', '00_Einleitung',
|
||||
'quality', 'high',
|
||||
'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
|
||||
'align', 'middle',
|
||||
'play', 'true',
|
||||
'loop', 'true',
|
||||
'scale', 'showall',
|
||||
'wmode', 'window',
|
||||
'devicefont', 'false',
|
||||
'id', movieName,
|
||||
'bgcolor', '#000000',
|
||||
'name', '00_Einleitung',
|
||||
'menu', 'true',
|
||||
'allowScriptAccess','sameDomain',
|
||||
'allowFullScreen','false',
|
||||
'movie', movieName,
|
||||
'salign', ''
|
||||
); //end AC code
|
||||
} else { // Flash ist veraltet, oder das Plug-In wurde nicht ermittelt
|
||||
var alternateContent = 'Alternativer HTML-Inhalt sollte hier platziert werden. '
|
||||
+ 'Für diesen Inhalt ist der Adobe Flash Player erforderlich. '
|
||||
+ '<a href=http://www.macromedia.com/go/getflash/>Flash installieren</a>';
|
||||
document.write(alternateContent); // Nicht aus Flash stammenden Inhalt einfügen
|
||||
}
|
||||
}
|
||||
// -->
|
||||
</script>
|
||||
<noscript>
|
||||
// Stellen Sie alternativen Inhalt für Browser bereit,
|
||||
// die keine Skriptuntersttzung bieten bzw. in denen Skripts deaktiviert wurden.
|
||||
Alternativer HTML-Inhalt sollte hier platziert werden. Für diesen Inhalt ist der Adobe Flash Player erforderlich.
|
||||
<a href="http://www.macromedia.com/go/getflash/">Flash installieren</a>
|
||||
</noscript>
|
||||
<div style="text-align: center"
|
||||
class="button">
|
||||
<a href="javascript:history.back()">Zurück</a>
|
||||
</div>
|
||||
</div></body>
|
||||
</html>
|
|
@ -5,10 +5,11 @@
|
|||
<div metal:define-macro="flashvideo">
|
||||
<metal:resources use-macro="item/conceptMacros/concepttitle" />
|
||||
<div class="button">
|
||||
<a href="." target="_blank"
|
||||
<a href="."
|
||||
i18n:translate=""
|
||||
tal:define="baseUrl python: view.getUrlForTarget(item.context)"
|
||||
tal:attributes="href string:$baseUrl/xa/${item/startName}">Play Movie</a>
|
||||
tal:attributes="href string:$baseUrl/video.html/start?id=${item/adapted/address}">
|
||||
Play Movie</a>
|
||||
</div>
|
||||
<metal:resources use-macro="item/conceptMacros/conceptchildren" />
|
||||
<metal:resources use-macro="item/conceptMacros/conceptresources" />
|
||||
|
|
Loading…
Add table
Reference in a new issue