15 #include <mediapreviewplugin.h>
20 #include<audioplayer.h>
22 #include<hypertextview.h>
24 #include "videoplayer.h"
40 windowg =
new QMainWindow(0);
41 windowg->setStyleSheet(
"* { background-color: rgb(220,220,220) }");
58 QString *entityUID = (QString*) param;
63 Entity* entity = getProject()->getEntityById(*entityUID);
66 if(entity->getType() ==
"media")
69 QString attrType = entity->getAttribute(
"type");
71 QFileInfo finfo(getProject()->getLocation());
72 QString location = finfo.dir().absolutePath();
75 if (QFile::exists(entity->getAttribute(
"src")))
77 attrSrc = entity->getAttribute(
"src");
79 else if (QFile::exists(location+
81 entity->getAttribute(
"src")))
85 entity->getAttribute(
"src");
88 if (comp != entity->getUniqueId() && attrSrc !=
"")
90 comp=entity->getUniqueId();
99 if(attrSrc.endsWith(
".mp4") ||
100 attrSrc.endsWith(
".mpg")|| attrSrc.endsWith(
".mp2") ||
101 attrSrc.endsWith(
".mpe") || attrSrc.endsWith(
".mpg4") ||
102 attrSrc.endsWith(
".mng") || attrSrc.endsWith(
".qt") ||
103 attrSrc.endsWith(
".mov") || attrSrc.endsWith(
".avi") )
109 else if(attrSrc.endsWith(
".mp3") || attrSrc.endsWith(
".flv") ||
110 attrSrc.endsWith(
".wav") || attrSrc.endsWith(
".ua") ||
111 attrSrc.endsWith(
".mp2") || attrSrc.endsWith(
".mp4")||
112 attrSrc.endsWith(
".mpg4"))
119 else if(attrSrc.endsWith(
".jpeg") || attrSrc.endsWith(
".png") ||
120 attrSrc.endsWith(
".bmp") || attrSrc.endsWith(
".jpg") ||
121 attrSrc.endsWith(
".jpe"))
127 else if (attrSrc.endsWith((
".gif")))
133 else if (attrSrc.startsWith (
"http") ||attrSrc.endsWith(
".html") ||
134 attrSrc.endsWith(
".htm") || attrSrc.endsWith(
".xhtml"))
140 else if (attrSrc.endsWith(
".txt"))
146 else if (attrSrc.endsWith(
".ncl"))
152 else if (attrSrc.endsWith(
".lua") )
159 else if(attrSrc.endsWith(
".xml"))
164 else if(attrSrc.endsWith(
".css"))
171 else if (attrSrc.endsWith(
".xlt")|| attrSrc.endsWith(
".xlet")|| attrSrc.endsWith(
".class"))
178 if(attrType.contains(
"video/"))
182 else if(attrType.contains(
"audio/"))
188 else if(attrType.contains(
"image/gif") )
194 else if (attrType.contains(
"image/bmp")||attrType.contains(
"image/png")|| attrType.contains(
"image/jpg")
195 ||attrType.contains(
"image/jpeg")||attrType.contains(
"image/jpe"))
200 else if(attrType.contains(
"text/xml"))
202 type=
"Markup language";
204 else if (attrType.contains(
"text/html"))
209 else if(attrType.contains(
"text/css"))
214 else if(attrType.contains(
"text/plain"))
219 else if(attrType.contains(
"application/x-ginga-ncl")||attrType.contains(
"application/x-ncl-NCL"))
224 else if (attrType.contains(
"application/x-ginga-NCLua")|| attrType.contains(
"application/x-ncl-NCLua"))
230 else if(attrType.contains(
"application/x-ginga-NCLet"))
243 musicplayer->setParent(windowg);
244 windowg->setCentralWidget(musicplayer);
253 videoplay->setParent(windowg);
254 windowg->setCentralWidget(videoplay);
263 imageview->setParent(windowg);
264 windowg->setCentralWidget(imageview);
271 picgifview =
new gifview(attrSrc);
272 picgifview->setParent(windowg);
273 windowg->setCentralWidget(picgifview);
280 txtview->setParent(windowg);
281 windowg->setCentralWidget(txtview);
285 if(type==
"hypertext")
288 hyperview->setParent(windowg);
289 windowg->setCentralWidget(hyperview);
303 ncldocview =
new nclview(attrSrc);
304 ncldocview->setParent(windowg);
305 windowg->setCentralWidget(ncldocview);
312 luaobjview =
new luaview(attrSrc);
313 luaobjview->setParent(windowg);
314 windowg->setCentralWidget(luaobjview);