How to embed VLC in zk's zul? - vlc

Using HTML, I can successfully embed VLC by object tag( please see the codes below).
Nevertheless, I couldn't see any video being played when I embed the same html inside zul.
This one has succeeded:
<!DOCTYPE html>
<html>
<body>
<object
classid='clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921'
codebase='http://download.videolan.org/pub/videolan/vlc/last/win32/axvlc.cab'
id='vlc'
name='vlc'
class='vlcPlayer'
events='True'>
<param name='Src' value='rtsp://10.1.21.228/stream/live?ch=1_0' />
<param name='ShowDisplay' value='True' />
<param name='AutoLoop' value='False' />
<param name='AutoPlay' value='True' />
<embed id='vlcEmb' type='application/x-google-vlc-plugin' version='VideoLAN.VLCPlugin.2' autoplay='yes' loop='no' width='640' height='480'
target='rtsp://10.1.21.228/stream/live?ch=1_0' ></embed>
</object>
</body>
</html>
The following fails:
<?page title="new page title" contentType="text/html;charset=UTF-8"?>
<zk>
<html><![CDATA[
<object
classid='clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921'
codebase='http://download.videolan.org/pub/videolan/vlc/last/win32/axvlc.cab'
id='vlc'
name='vlc'
class='vlcPlayer'
events='True'>
<param name='Src' value='rtsp://10.1.21.228/stream/live?ch=1_0' />
<param name='ShowDisplay' value='True' />
<param name='AutoLoop' value='False' />
<param name='AutoPlay' value='True' />
<embed id='vlcEmb' type='application/x-google-vlc-plugin' version='VideoLAN.VLCPlugin.2' autoplay='yes' loop='no' width='640' height='480'
target='rtsp://10.1.21.228/stream/live?ch=1_0' ></embed>
</object>
]]></html>
</zk>
Please help, thanks.

Related

When I apply vlc on the web, my computer's CPU becomes 100%. What should I do?

We applied VLC with Object tag. Up to 10 object tags with the same RTSP are CPU stable. However, if the number of Object tags increases by 12 or more, the CPU becomes 100%. What should I do???
<div id="object_container">
<object type="application/x-vlc-plugin"
version="VideoLAN.VLCPlugin.2" id="vlc21" width="517"
height="388" classid="clsid:9BE31822-FDAD-461B-AD51-
BE1D1C159921">
<param name="MRL" id="mrlVideo" value="" />
<param name="volume" value="50" />
<param name="autoplay" value="True" />
<param name="loop" value="false" />
<param name="fullscreen" value="false" />
<param name="wmode" value="transparent" />
<param name="toolbar" value="true" />
<param name="windowless" value="true" />
</object>
</div>
<script>
var rtst_url = "rtsp://ID:password#ipcamera ip:554/H.264/media.smp";
var options = [":network-caching=80", ":file-caching=80", ":hevc-fps=-340282346638528859811704183484516925440.000000", ":prefetch-buffer-size=250000", ":postproc-q=1", ":goom-width=100", ":goom-height=100", ":sout-chromecast-conversion-quality=3", ":preferred-resolution=240"];
vlc10.playlist.clear();
vlc10.playlist.add(rtsp_url, null , options);
vlc10.audio.toggleMute();
vlc10.playlist.play();
</script>

phonegap inappbrowser IOS not working

I created a project in phonegap for IOS and I want to open a ulr in my IOS browser but not inside my app. I tried to use inAppBrowser plugin but it seems it doesn't to working.
I only use .html, .css, .js files and the config.xml and I am on Windows and I build my project with online tool Adobe Phonegap builder
If I get it right, according to this link https: build.phonegap.com/plugins/658 there is no need to install the plugin you want to use, as some suggest with the command cordova plugin add.... You can have your job done by reffering the plugin inside the config.xml file. Am I right?
My config.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns = " www.w3.org/ns/widgets"
xmlns:gap = " phonegap.com/ns/1.0"
id = "com.test.testingApp"
version = "1.0.0">
<name>test</name>
<!-- app icons and splashscreen -->
<icon src="icon.png" />
<gap:splash src="splash.png" />
<platform name="android">
<icon density="mdpi" src="res/android/icon-48-hdpi.png" />
<icon density="hdpi" src="res/android/icon-72-hdpi.png" />
<icon density="xhdpi" src="res/android/icon-96-hdpi.png" />
<icon density="xxhdpi" src="res/android/icon-144-hdpi.png" />
<gap:splash gap:density="mdpi" src="splash.png" width="320" height="470" />
<gap:splash gap:density="hdpi" src="splash.png" width="480" height="640" />
<gap:splash gap:density="xhdpi" src="splash.png" width="720" height="960" />
<gap:splash gap:density="xxhdpi" src="splash.png" />
</platform>
<platform name="ios">
<!-- iOS 7.0+ -->
<!-- iPhone / iPod Touch -->
<icon src="res/ios/icon-60.png" width="60" height="60" />
<icon src="res/ios/icon-60#2x.png" width="120" height="120" />
<!-- iPad -->
<icon src="res/ios/icon-76.png" width="76" height="76" />
<icon src="res/ios/icon-76#2x.png" width="152" height="152" />
<!-- iOS 6.1 -->
<!-- Spotlight Icon -->
<icon src="res/ios/icon-40.png" width="40" height="40" />
<icon src="res/ios/icon-40#2x.png" width="80" height="80" />
<!-- iPhone / iPod Touch -->
<icon src="res/ios/icon.png" width="57" height="57" />
<icon src="res/ios/icon#2x.png" width="114" height="114" />
<!-- iPad -->
<icon src="res/ios/icon-72.png" width="72" height="72" />
<icon src="res/ios/icon-72#2x.png" width="144" height="144" />
<!-- iPhone Spotlight and Settings Icon -->
<icon src="res/ios/icon-small.png" width="29" height="29" />
<icon src="res/ios/icon-small#2x.png" width="58" height="58" />
<!-- iPad Spotlight and Settings Icon -->
<icon src="res/ios/icon-50.png" width="50" height="50" />
<icon src="res/ios/icon-50#2x.png" width="100" height="100" />
</platform>
<preference name="phonegap-version" value="3.3.0" />
<!-- splashscreen delay -->
<preference name="SplashScreenDelay" value="5000" />
<access origin="*" browserOnly="true"/>
<!-- <content src=" mysite.com/myapp.html" /> for external pages -->
<content src="index.html" />
<preference name="loglevel" value="DEBUG" />
<!-- <preference name="orientation" value="portrait" /> -->
<preference name="loadUrlTimeoutValue" value="20000" />
<preference name="InAppBrowserStorageEnabled" value="true" />
<!--
<preference name="splashscreen" value="resourceName" />
<preference name="backgroundColor" value="0xFFF" />
<preference name="loadUrlTimeoutValue" value="20000" />
<preference name="InAppBrowserStorageEnabled" value="true" />
<preference name="disallowOverscroll" value="true" />
<preference name="keepRunning" value="false" />
-->
<feature name="App">
<param name="android-package" value="org.apache.cordova.App"/>
</feature>
<feature name="Geolocation">
<param name="android-package" value="org.apache.cordova.GeoBroker"/>
</feature>
<feature name="Device">
<param name="android-package" value="org.apache.cordova.Device"/>
</feature>
<!--
<feature name="Accelerometer">
<param name="android-package" value="org.apache.cordova.AccelListener"/>
</feature>
<feature name="Compass">
<param name="android-package" value="org.apache.cordova.CompassListener"/>
</feature>
<feature name="Media">
<param name="android-package" value="org.apache.cordova.AudioHandler"/>
</feature>
<feature name="Camera">
<param name="android-package" value="org.apache.cordova.CameraLauncher"/>
</feature>
<feature name="Contacts">
<param name="android-package" value="org.apache.cordova.ContactManager"/>
</feature>
<feature name="File">
<param name="android-package" value="org.apache.cordova.FileUtils"/>
</feature>
-->
<feature name="NetworkStatus">
<param name="android-package" value="org.apache.cordova.NetworkManager"/>
</feature>
<feature name="Notification">
<param name="android-package" value="org.apache.cordova.Notification"/>
</feature>
<!--
<feature name="Storage">
<param name="android-package" value="org.apache.cordova.Storage"/>
</feature>
<feature name="FileTransfer">
<param name="android-package" value="org.apache.cordova.FileTransfer"/>
</feature>
<feature name="Capture">
<param name="android-package" value="org.apache.cordova.Capture"/>
</feature>
<feature name="Battery">
<param name="android-package" value="org.apache.cordova.BatteryListener"/>
</feature>
-->
<feature name="SplashScreen">
<param name="android-package" value="org.apache.cordova.SplashScreen"/>
</feature>
<feature name="SplashScreen">
<param name="ios-package" value="CDVSplashScreen" />
</feature>
<!--
<feature name="Echo">
<param name="android-package" value="org.apache.cordova.Echo"/>
</feature>
<feature name="Globalization">
<param name="android-package" value="org.apache.cordova.Globalization"/>
</feature>
-->
<feature name="InAppBrowser">
<param name="android-package" value="org.apache.cordova.inappbrowser.InAppBrowser"/>
</feature>
<feature name="InAppBrowser">
<param name="ios-package" value="CDVInAppBrowser" />
</feature>
<!-- Deprecated plugins element. Remove in 3.0 -->
<plugins>
<gap:plugin name="org.apache.cordova.inappbrowser" version="0.3.3" />
</plugins>
</widget>
My index.html file is:
<html>
<head>
<meta charset="utf-8" />
<meta id="extViewportMeta" name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" />
<title>Hello World</title>
<script type="text/javascript" charset="utf-8" src="cordova.js"></script>
<script type="text/javascript" charset="utf-8" src="cordova_plugins.js"></script>
<link rel="stylesheet" href=" code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.min.css">
<script src=" code.jquery.com/jquery-1.10.2.min.js"></script>
<script src=" code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.min.js"></script>
</head>
<body>
<div data-role="page">
<!-- MAIN BODY -->
<div data-role="content" role="main" style="padding-bottom:230px;">
<div class="main_header">
<br />
PlanTech
<br />
PlanTech
</div>
</div>
</div>
<div id="highlight"></div>
</body>
</html>
The problem is that both links open inside my app (and not in a separate browser as they supposed to). As a result, there is no chance to get back to my index.html page after one of the links is clicked without ending the app and restarting it.
I would appreciate it if someone could help me go through this, because I searched several times the internet and I am stuck.
Thanks in advance everyone for your time.
I have a solution for this ... there is no chance to get back to my index.html page after one of the links clicked
If you go through complete documentation,
1 - Return the window object like
var ref = window.open ('www.google.com', '_blank', 'location=yes');
2 - Add an event listener for exit event.
ref.addEventListener(exit, myexitcallback);
3 - close method will close the browser window. So, in your function call back :
function myexitcallback{
ref.close();
}
Hope this will solve your problem.
Good luck.
Finally, I found the solution to my question myself. As usual it was in front of my eyes, but I would find it not in a thousand years if I wasn't lucky enough to see it.
As the config.xml itself suggests: <!-- Deprecated plugins element. Remove in 3.0 -->
So I had to change the following code
<plugins>
<gap:plugin name="org.apache.cordova.inappbrowser" version="0.3.3" />
</plugins>
with THIS:
<gap:plugin name="org.apache.cordova.inappbrowser" version="0.3.3" />

Grails and swf application

I want to execute a flash application from grails 2.3.1.
I have a probleme loading my swf file's dependencies from a gsp.
Firstly, I tried to put all file needed into my web-app folder, and it worked like a charm :
wab-app
css
flash
index.html // <- Use for my first test.
flash.swf
prefs.xml
data-flash-folder
video-folder
txt-folder
xml-folder
intro.swf
main.swf
prefs.xml
static.xml
When I go to this url : http://localhost:8080/application-name/flash/index.html, all work like a charm.
So I decided to call it from a controller :
class FrontFlashController {
def openFlash() {
}
}
Here is my gsp calling flash :
<g:applyLayout name="frontFlash">
<div id="flash-render">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="1000" height="700" title="myFlash" >
<param name="movie" value="flash/flash.swf" />
<param name="FLASHVARS" value="idSession=rffcu96vn6j4tq3o56j1bgn5o7&lang=fr&xmlPath=prefs.xml">
<param name="quality" value="high" />
<embed src="/application-name/flash/flash.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="1000" height="700" flashvars="idSession=rffcu96vn6j4tq3o56j1bgn5o7&module=module&maxchapter=6&gochapter=3&jeu=0&cumul=285"></embed>
</object>
</div>
</g:applyLayout>
When calling the action by this url : http://localhost:8080/application-name/frontFlash/openFlash, my file 'flash.swf' is correctly loaded but none of his dependencies.
Here my firebug stack :
"NetworkError: 404 Not Found - http://localhost:8080/application-name/frontFlash/data-folder/static.xml"
"NetworkError: 404 Not Found - http://localhost:8080/application-name/frontFlash/data-folder/textes/default_en.xml"
"NetworkError: 404 Not Found - http://localhost:8080/application-name/frontFlash/data-folder/prefs.xml"
"NetworkError: 404 Not Found - http://localhost:8080/application-name/frontFlash/data-folder/intro.swf"
"NetworkError: 404 Not Found - http://localhost:8080/application-name/frontFlash/data-folder/main.swf"
Seems to grails is looking directly into my folder view instead of swf file folder.
How can I fix it ?
More, later I want to link swf ressource outside of my grails application, how can I do that ?
Snite
Try to use g.createLinkTo in src, like
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" title="myFlash" >
<param name="movie" value="flash/flash.swf" />
<param name="FLASHVARS" value="idSession=rffcu96vn6j4tq3o56j1bgn5o7&lang=fr&xmlPath=prefs.xml">
<param name="quality" value="high" />
<embed src="${g.createLinkTo(dir: 'flash', file: 'flash.swf')}" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" flashvars="idSession=rffcu96vn6j4tq3o56j1bgn5o7&module=module&maxchapter=6&gochapter=3&jeu=0&cumul=285"></embed>
</object>
I fix the problem adding <base href="/application-name/flash/"> into my head.
Here my final version of openFlash.gsp :
<!DOCTYPE html>
<html lang="en-US">
<head>
<title>FLASH</title>
<base href="/application-name/flash/">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
swfobject.registerObject("myId", "9.0.0", "expressInstall.swf");
</script>
</head>
<body>
<div>
<g:if test="${flash}">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="1000" height="700" title="Module">
<param name="movie" value="flash.swf" />
<param name="FLASHVARS" value="idSession=rffcu96vn6j4tq3o56j1bgn5o7&lang=fr&xmlPath=prefs.xml">
<param name="quality" value="high" />
<embed src="${g.createLinkTo(dir: 'flash', file: 'flash.swf')}" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="1000" height="700" flashvars="idSession=rffcu96vn6j4tq3o56j1bgn5o7&maxchapitre=6&gochapitre=3&jeu=0&cumul=285"></embed>
</object>
</g:if>
<g:else>
<g:if test="${flash.error}">
<br />
<div class="alert alert-error">${flash.error}</div>
</g:if>
</g:else>
</div>
</body>
</html>

Thymeleaf flash(swf)issue

<body>
<object type="application/x-shockwave-flash" data="file3.swf"
id="applicationID" style="margin:0 50px;width:auto;height:auto;">
<param name="movie" value="file3.swf" />
<param name="wmode" value="transparent" /> <!-- Or opaque, etc. -->
<param name="FlashVars" value="" />
<param name="quality" value="high" />
<param name="menu" value="false" />
</object>
</body>
This is my thymeleaf page here file3.swf is the file i want play .
But when i run the page the flash does not play..!
I dont know how to show flash file in bowser, I assume that its correctly done :p
Have you check the firebug to see how its rendered ?

How do I display video in my view? - ASP.NET MVC

I am using asp.net mvc, and I'd like to add media player control in my view page, so how do I do that?
My first three google finds:
1) A control (doesn't know if it works with mvc though)
http://www.beansoftware.com/free-asp.net-controls/asp.net-media-player-control.aspx
2) Silverlight Player
http://www.asp.net/aspnet-in-net-35-sp1/videos/introduction-to-the-aspnet-mediaplayer-control
3) Embed
if it doesnt matter which mediaplayer will be used:
<embed id="videocontent" width="550" height="480" type="video/avi" autstart="true" loop="false" runat="server" style="border: gray 1px solid"></embed>.
or in valid xhtml
<object classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" id="player" width="320" height="260">
<param name="url" value="<%= ViewData["src"] %>" />
<param name="src" value="<%= ViewData["src"] %>" />
<param name="showcontrols" value="true" />
<param name="autostart" value="true" />
<!--[if !IE]>-->
<object type="video/x-ms-wmv" data="<%= ViewData["src"] %>" width="320" height="260">
<param name="src" value="<%= ViewData["src"] %>" />
<param name="autostart" value="true" />
<param name="controller" value="true" />
</object>
<!--<![endif]-->
</object>
+1 to Christina, but #1 may not work in an MVC app.
Her answers, plus you'll want to create a controller action that returns a FileResult. Check this question (its about an image, but a file is a file all the web round):
Can an ASP.NET MVC controller return an Image?

Resources