I got an issue that the fancybox doesn’t display the brightcove video on the iphone 4, while it works in Firefox, IE 7, IE8, IE9, Safari, and Chrome, and Android phones.
I have the js to populate the fancybox for the video as the following,
$(".myfancybox").fancybox({
'showCloseButton' : true,
'titlePosition' : 'inside',
'titleFormat' : formatVideoTitle,
'content' : formatVideoContent,
'scrolling' : 'no',
'autoScale' : true
});
A function called formatVideoContent will take the html (brightcove video html code, below, need videoPlayer, playerID and Key) and pass it to the ‘content’ parameter.
<object id="flashObj" width="486" height="412" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,47,0" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">
<param value="http://c.brightcove.com/services/viewer/federated_f9?isVid=1" name="movie">
<param value="#FFFFFF" name="bgcolor">
<param value="#videoPlayer=xxx&playerID=xxx&playerKey=xxx&domain=embed&dynamicStreaming=true" name="flashVars">
<param value="http://admin.brightcove.com" name="base">
<param value="false" name="seamlesstabbing">
<param value="true" name="allowFullScreen">
<param value="true" name="swLiveConnect">
<param value="always" name="allowScriptAccess">
</object>
I know that iOS does not support .flv or .mov, but the same brightcove video html code that I used in the fancybox works in regular html page on iphone, just didn’t work on iphone once plugging in the fancybox. Fancybox version is 1.3.4 and jQuery is 1.4.4.
Did anyone try to show brightcove video via the fancybox on iphone? Thanks for any hint.
....the same brightcove video html code that I used in the fancybox works in regular html page on iphone
You could create a separated html page with such code and open it in fancybox using the iframe type of content like this script :
$(".myfancybox").fancybox({
'showCloseButton': true,
'titlePosition' : 'inside',
'titleFormat' : formatVideoTitle,
// 'content' : formatVideoContent,
'scrolling' : 'no',
// 'autoScale' : true,
'width' : 486,
'height' : 412,
'type' : 'iframe'
});
That's plain embed code for Brightcove's Flash player. It won't work on iOS. You need to use their javascript code, as it's that javascript that determines whether to replace the object with a Flash or HTML player as appropriate. That looks like this:
<object id="bcPlayer" class="BrightcoveExperience">
<param name="bgcolor" value="#FFFFFF" />
<param name="width" value="480" />
<param name="height" value="270" />
<param name="playerID" value="xxxx" />
<param name="playerKey" value="xxxx" />
<param name="isVid" value="true" />
<param name="isUI" value="true" />
<param name="dynamicStreaming" value="true" />
<param name="#videoPlayer" value="xxxx" />
</object>
You'll need to include the Brightcove javascript in the page:
<script type="text/javascript" src="http://admin.brightcove.com/js/BrightcoveExperiences.js"></script>
And you'll need to call brightcove.createExperiences() after the player code is inserted.
This works:
<script type="text/javascript" src="http://admin.brightcove.com/js/BrightcoveExperiences.js"></script>
<script type="text/javascript">
formatVideoContent = '<object id="myExperience1353062063001" class="BrightcoveExperience">';
bcVideo += ' <param name="bgcolor" value="#FFFFFF" />';
bcVideo += ' <param name="width" value="400" />';
bcVideo += ' <param name="height" value="225" />';
bcVideo += ' <param name="playerID" value="1150189326001" />';
bcVideo += ' <param name="playerKey" value="AQ~~,AAAA0vRfoQE~,baHF9-H5aHJPAl3cZ-KjgHH9A7WtanGe" />';
bcVideo += ' <param name="isVid" value="true" />';
bcVideo += ' <param name="isUI" value="true" />';
bcVideo += ' <param name="dynamicStreaming" value="true" />';
bcVideo += ' <param name="#videoPlayer" value="1353062063001" />';
bcVideo += '</object>';
bcVideo += '<scr'+'ipt>brightcove.createExperiences();</scr'+'ipt>';
$(document).ready( function() {
$(".myfancybox").fancybox({
showCloseButton: true,
content: bcVideo,
scrolling: 'no',
width: '400',
height: '225'
});
});
</script>
Related
I have the following dashboard build with Tableau Public: https://public.tableau.com/app/profile/david8402/viz/map_parameters/Dashboard1
The dashboard accept as parameters a list of countries as a string of ISO3 separated by a character. For example using this URL https://public.tableau.com/app/profile/david8402/viz/map_parameters/Dashboard1?countries=ITA-AUS Italy and Australia will be highlighted in the map.
I want to embed this dashboard into a web page but if I use the classical embed script then I don't know how to pass the URL parameters related to the countries.
<div class='tableauPlaceholder' id='viz1650639649335' style='position: relative'>
<noscript>
<a href='#'>
<img alt='Dashboard 1 ' src='https://public.tableau.com/static/images/ma/map_parameters/Dashboard1/1_rss.png' style='border: none' />
</a>
</noscript>
<object class='tableauViz' style='display:none;'>
<param name='host_url' value='https%3A%2F%2Fpublic.tableau.com%2F' />
<param name='embed_code_version' value='3' />
<param name='site_root' value='' />
<param name='name' value='map_parameters/Dashboard1' />
<param name='tabs' value='no' />
<param name='toolbar' value='yes' />
<param name='static_image' value='https://public.tableau.com/static/images/ma/map_parameters/Dashboard1/1.png' />
<param name='animate_transition' value='yes' />
<param name='display_static_image' value='yes' />
<param name='display_spinner' value='yes' />
<param name='display_overlay' value='yes' />
<param name='display_count' value='yes' />
<param name='countries' value='USA' />
<param name='language' value='it-IT' />
</object>
</div>
<script type='text/javascript'>
var divElement = document.getElementById('viz1650639649335');
var vizElement = divElement.getElementsByTagName('object')[0];
if (divElement.offsetWidth > 800) {
vizElement.style.width = '520px';
vizElement.style.height = '587px';
}
else if (divElement.offsetWidth > 500) {
vizElement.style.width = '520px';
vizElement.style.height = '587px';
}
else { vizElement.style.width = '100%'; vizElement.style.height = '727px'; }
var scriptElement = document.createElement('script');
scriptElement.src = 'https://public.tableau.com/javascripts/api/viz_v1.js';
vizElement.parentNode.insertBefore(scriptElement, vizElement);
</script>
Any suggestion?
I also tried with the iframe but it loads the whole Tableau page and I want only the chart.
Cheers
I'm trying to create an application with Cordova (developing in eclipse, using JBoss Hybrid Mobile Tools + CordovaSim).
I have inspired the code snippet that's giving me problems on this example.
The error I get is:
!JavaScript ERROR: TypeError: 'undefined' is not an object (evaluating 'cordova.plugins.barcodeScanner') on line 6 for http://localhost:54726/js/QRScan.js
QRScan.js only contains the following code (so basically as in the example):
var scanBut = document.getElementById('QRScanButton');
scanBut.onclick = quickScan();
function quickScan(){
cordova.plugins.barcodeScanner.scan(
function (result) {
var s = "Result: " + result.text + "<br/>" +
"Format: " + result.format + "<br/>" +
"Cancelled: " + result.cancelled;
resultDiv.innerHTML = s;
},
function (error) {
alert("Scanning failed: " + error);
}
);
}
And I made sure my index.html contains the following line at the appropriate spot:
<script type="text/javascript" src="cordova.js"></script>
Finally my xml file should be configured correctly, I imported the correct plugin, the file looks like:
<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0"
id="csam.test" version="1.0.0">
<name>csam test</name>
<description>
A sample Apache Cordova application that responds to the
deviceready
event.
</description>
<author href="http://www.eclipse.org/thym" email="thym-dev#eclipse.org">
Eclipse.org -
Thym
</author>
<content src="index.html" />
<access origin="*" />
<preference name="fullscreen" value="true" />
<preference name="webviewbounce" value="true" />
<feature name="App">
<param name="android-package" value="org.apache.cordova.App" />
</feature>
<feature name="BarcodeScanner">
<param name="android-package" value="com.phonegap.plugins.barcodescanner.BarcodeScanner" />
<param name="ios-package" value="CDVBarcodeScanner" />
<param name="wp-package" value="BarcodeScanner" />
<param name="id" value="cordova-plugin-barcodescanner" />
</feature>
<engine name="android" version="4.0.1" />
</widget>
Plugins must wait for the deviceready event for use. Here is the piece of code from the demo which waits for deviceready added back in.
document.addEventListener("deviceready", init, false);
function init() {
document.querySelector("#startScan").addEventListener("touchend", startScan, false);
var scanBut = document.getElementById('QRScanButton');
scanBut.onclick = quickScan();
}
how to embed videos on the mobile app so that it works for iphone and droids? here is what i am using and it seems like it does not work for driod phones.... any help?
<noscript>
<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
codebase="http://www.apple.com/qtactivex/qtplugin.cab">
<param name="src" value="http://hostname/images/Large.jpg" />
<param name="href" value="http://hostname/mobile/videos/green.mp4" />
<param name="target" value="myself" />
<param name="controller" value="false" />
<param name="autoplay" value="false" />
<param name="scale" value="aspect" />
<embed type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/"
src="http://hostname/mobile/videos/green.jpg" href="http://hostname/mobile/videos/green.mp4" target="myself"
controller="false" autoplay="false" scale="aspect" />
</object>
</noscript>
</div>
<div class="video-desc"><span class="title">Clean Hands</span><span class="released">Sat, May 02, 2009</span><span class="description">Clean hands....</span></div></li></ul><ul class="menu"><li><h1 class="phone">Videos</h1><ul class="video-list"><li><div class="video">
You should be using HTML5's <video> tag to embed video for iPhone/Droid.
i need some help in making a C# application that embed's a flash .swf file
and what i want is to feed some data to it.
in html is like this
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase=
"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
width="625" height="100%" id="flash" name="flash" align="">
<param name="movie" value="http://www.mysite.com/flash/home.swf">
<param name="loop" value="false">
<param name="allowScriptAccess" value="always">
<param name="allowNetworking" value="all">
<param name="menu" value="false">
<param name="quality" value="high">
<param name="devicefont" value="true">
<param name="bgcolor" value="#FFFFFF">
<param name="FlashVars" value=
"sid=5005405F&data2=222&data3=443&data4=custom">
<embed src="http://www.mysite.com/flash/home.swf" loop="false" menu=
"false" allowscriptaccess="always" allownetworking="all" quality="high"
devicefont="true" bgcolor="white" width="625" height="100%" name="flash"
id="flash" align="" swliveconnect="true" type=
"application/x-shockwave-flash" pluginspage=
"http://www.macromedia.com/go/getflashplayer" flashvars=
"sid=5005405F&data2=222&data3=443&my_id=dunno&data4=dinos&cs_version=0">
what i want is to know how can i feed that data in C#
till now i can only load the .swf file when my app start's up
playerax.LoadMovie(0, Application.StartupPath + "\\home.swf");
playerax.Play();
Take a look at this tutorial:
Flash tutorial - How to send data to ASP.NET and read the answer
axShockwaveFlash1.FlashVars = "auto_play=true&channel=adventuretimed&start_volume=25";
i have a problem with VIMEO video .
I want to display it in fancybox :
this is HTML :
test
<div id="content" style="display:none;">
<object width="504" height="280" data="http://vimeo.com/moogaloop.swf" type="application/x-shockwave-flash">
<param value="always" name="allowscriptaccess"><param value="true" name="allowfullscreen">
<param value="http://vimeo.com/moogaloop.swf" name="movie">
<param value="clip_id=6999704&server=vimeo.com&fullscreen=1&show_title=1&show_byline=1&show_portrait=1&color=00ADEF" name="flashvars">
</object>
</div>
and js:
$(document).ready(function() {
$("a.zoom").fancybox();
});
Can somebody help me with this , maybe somebody knows hot to fix it ..
Thanks !!
try this html:
test
<div style="display:none;">
<div id="content">
<object width="504" height="280" data="http://vimeo.com/moogaloop.swf" type="application/x-shockwave-flash">
<param value="always" name="allowscriptaccess"><param value="true" name="allowfullscreen">
<param value="http://vimeo.com/moogaloop.swf" name="movie">
<param value="clip_id=6999704&server=vimeo.com&fullscreen=1&show_title=1&show_byline=1&show_portrait=1&color=00ADEF" name="flashvars">
</object>
</div>
</div>