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

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>

Related

How to embed VLC in zk's zul?

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.

Loading site in iFrame in Cordova

I'm trying to show a website inside a Cordova project that has inside it an iFrame that shows another site. i.e:
<html>
<head></head>
<body>
<iframe src="http://www.somesite.com" style="border: 0;" scrolling="yes"/>
</body>
</html>
When I inspect the code in Safari I get this:
<html>
<head></head>
<body>
<iframe src="http://www.somesite.com" style="border: 0;" scrolling="yes">
#document
<html>
<head></head>
<body></body>
</html>
</iframe>
</body>
</html>
As you can see the contents of the iFrame are not rendered. If I open the site in a browser then it all works fine. If I open it in an iOS project with no cordova and I just use a simple UIWebView it is fine.
I have also found that when Codrova calls:
- (BOOL)webView:(UIWebView*)theWebView shouldStartLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType
It returns NO when the iFrame request comes in.
Does anyone know what the cause of this may be?
This is my Cordova config.xml:
<?xml version='1.0' encoding='utf-8'?>
<widget android-version="#string/version" android-versionCode="1" id="com.appswiz.hybridfactory" version="4.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<plugin name="cordova-plugin-whitelist" version="1" />
<allow-navigation href="*" />
<allow-intent href="*" />
<access origin="*" />
<platform name="android">
<allow-intent href="market:*" />
<preference name="SplashScreen" value="splash" />
<preference name="SplashScreenDelay" value="20000" />
<preference name="LoadingDialog" value="Loading, please wait..." />
<preference name="orientation" value="portrait" />
</platform>
<platform name="ios">
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
<preference name="BackupWebStorage" value="local" />
<preference name="AllowInlineMediaPlayback" value="false" />
<preference name="BackupWebStorage" value="cloud" />
<preference name="DisallowOverscroll" value="true" />
<preference name="EnableViewportScale" value="false" />
<preference name="KeyboardDisplayRequiresUserAction" value="true" />
<preference name="MediaPlaybackRequiresUserAction" value="false" />
<preference name="SuppressesIncrementalRendering" value="false" />
<preference name="GapBetweenPages" value="0" />
<preference name="PageLength" value="0" />
<preference name="PaginationBreakingMode" value="page" />
<preference name="PaginationMode" value="unpaginated" />
<preference name="UIWebViewBounce" value="false" />
<preference name="TopActivityIndicator" value="whiteLarge" />
<preference name="EnableLocation" value="false" />
<preference name="EnableViewportScale" value="false" />
<preference name="AutoHideSplashScreen" value="false" />
<preference name="ShowSplashScreenSpinner" value="true" />
<preference name="OpenAllWhitelistURLsInWebView" value="false" />
<preference name="BackupWebStorage" value="none" />
<preference name="fullscreen" value="true" />
</platform>
<engine name="ios" spec="~4.1.1" />
<plugins>
<feature name="TwitterPlugin">
<param name="ios-package" value="TwitterPlugin" />
</feature>
</plugins>
<feature name="CalendarEventPlugin">
<param name="ios-package" value="CalendarEventPlugin" />
</feature>
<feature name="EmailComposer">
<param name="ios-package" value="EmailComposer" />
</feature>
<feature name="Updater">
<param name="ios-package" value="AWUpdater" />
</feature>
<feature name="YoutubeVideoPlayer">
<param name="ios-package" value="YoutubeVideoPlayer" />
</feature>
<feature name="File">
<param name="ios-package" value="CDVFile" />
<param name="onload" value="true" />
</feature>
<feature name="FileTransfer">
<param name="ios-package" value="CDVFileTransfer" />
</feature>
<feature name="Open">
<param name="ios-package" value="Open" />
</feature>
<feature name="Battery">
<param name="ios-package" value="CDVBattery" />
</feature>
<feature name="Camera">
<param name="ios-package" value="CDVCamera" />
</feature>
<feature name="Contacts">
<param name="ios-package" value="CDVContacts" />
</feature>
<feature name="Device">
<param name="ios-package" value="CDVDevice" />
</feature>
<feature name="Accelerometer">
<param name="ios-package" value="CDVAccelerometer" />
</feature>
<feature name="Compass">
<param name="ios-package" value="CDVCompass" />
</feature>
<feature name="Notification">
<param name="ios-package" value="CDVNotification" />
</feature>
<feature name="Geolocation">
<param name="ios-package" value="CDVLocation" />
</feature>
<feature name="InAppBrowser">
<param name="ios-package" value="CDVInAppBrowser" />
</feature>
<feature name="Media">
<param name="ios-package" value="CDVSound" />
</feature>
<feature name="Capture">
<param name="ios-package" value="CDVCapture" />
</feature>
<feature name="NetworkStatus">
<param name="ios-package" value="CDVConnection" />
</feature>
<feature name="SplashScreen">
<param name="ios-package" value="CDVSplashScreen" />
<param name="onload" value="true" />
</feature>
<feature name="Vibration">
<param name="ios-package" value="CDVVibration" />
</feature>
<feature name="AudioPlayerPlugin">
<param name="ios-package" value="PRXPlayerPlugin" />
<param name="onload" value="true" />
</feature>
<feature name="FacebookConnectPlugin">
<param name="ios-package" value="FacebookConnectPlugin" />
<param name="onload" value="true" />
</feature>
<plugin name="FacebookConnectPlugin" value="FacebookConnectPlugin" />
<access origin="https://m.facebook.com" />
<access origin="https://graph.facebook.com" />
<access origin="https://api.facebook.com" />
<access origin="https://*.fbcdn.net" />
<access origin="https://*.akamaihd.net" />
<feature name="PushNotification">
<param name="ios-package" value="PushPlugin" />
</feature>
<feature name="Calendar">
<param name="ios-package" value="Calendar" />
</feature>
<name>AppsWizAppShell</name>
<description>
The AppsWizShell.
</description>
<author email="admin#appswiz.com" href="http://www.appswiz.com">
AppsWiz
</author>
<content src="index.html" />
<access origin="*" />
<allow-navigation href="http://*/*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
<preference name="AndroidPersistentFileLocation" value="Internal" />
<preference name="CameraUsesGeolocation" value="false" />
<preference name="BackupWebStorage" value="none" />
<preference name="AllowInlineMediaPlayback" value="false" />
<preference name="DisallowOverscroll" value="true" />
<preference name="KeyboardDisplayRequiresUserAction" value="true" />
<preference name="MediaPlaybackRequiresUserAction" value="false" />
<preference name="SuppressesIncrementalRendering" value="false" />
<preference name="GapBetweenPages" value="0" />
<preference name="PageLength" value="0" />
<preference name="PaginationBreakingMode" value="page" />
<preference name="PaginationMode" value="unpaginated" />
<preference name="UIWebViewBounce" value="false" />
<preference name="TopActivityIndicator" value="whiteLarge" />
<preference name="EnableLocation" value="false" />
<preference name="EnableViewportScale" value="false" />
<preference name="AutoHideSplashScreen" value="false" />
<preference name="ShowSplashScreenSpinner" value="true" />
<preference name="OpenAllWhitelistURLsInWebView" value="false" />
<preference name="fullscreen" value="true" />
</widget>
Thanks.

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" />

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