is there a way to flush the page cache? (window.init and audio autoplay won't work) - ibooks

If I have an interactive widget that has something like
window.init = function() {alert('foo');};
or
<audio src="foo.mp3" autoplay="" loop=""></audio>
then when I close the interactive widget and bring it back up again, the init() doesn't run again and the audio won't automatically play.
In the case of audio, the sounds stops playing when you close the interactive widget. When you reopen the interactive widget, the sound does not start playing automatically.
However, if I page left or right a few pages (until I see the "loading..." indicator), then the interactive widget cache gets flushed. I can then go back to the page with the interactive widget and the init() will run and audio will play again.
(Note that for <audio> to have a sound play automatically and loop, the autoplay and loop properties just have to exist. The value of those properties doesn't matter so I can just have quote quote)
Is this a known problem with ibooks?
Is there any way to force that cache flush?

You could try setting a function on widget.didEnterWidgetMode (more documentation here) that resets the progress when the widget gets opened again.
edit: So if you look at this Apple thread on widget creation for iBooks Author, they mention adding a Javascript snippet for AppleClasses/AppleWidget.js. The code for that file is here (at least, according to someone on the internet :)), and in that file there's the same widget.didEnterWidgetMode function.

Related

Randomize SVG When Printing (On Physical Paper)

I'm curious as to whether there is a method for what I want to do. For instance: Let's say I have an SVG and decide to animate it, and every time it's run, the stroke-offset I have set is randomized, and infinite.
An example of the stroke animation is this, minus the randomization:
https://css-tricks.com/wp-content/uploads/2014/02/animate-stroke.gif
Now. If I want to open that SVG and print it (Pressing Ctrl/Cmd + P) straight from the desktop (not within any other application)— is it possible for the SVG to run it's randomization when I print it?
Again, I understand some may comment—"Print is dead, what are you doing..." But this is out of curiosity.
Print isn't dead. It just sat back and watched as we fiddled with our new toys.
Using Javascript, you can detect when printing is happening by adding a listener to the beforeprint event. See: Detecting browser print event
Then stop the animation (by adding a class, for example), and set your stroke-dashoffset to whatever you want.
Then reset everything back afterwards by listening for the afterprint event.

full screen video play back on nivo lightbox

I am using the nivo lightbox in my theme I have added a youtube video link , when user clicks on button video starts to play. But it is not playing on full screen. How can I make the video play full screen on nevo lightbox? thanks
I noticed that nobody gives an answer to this question anywhere and I needed it too. Vimeo goes fine but Youtube specically needs the iframe's allowfullscreen="true", so I looked into the code of jquery.nivo.js (and/or jquery.nivo.min.js if you use it). search for "$('<iframe>', and add the option allowfullscreen: true,
Do this search twice and repeat this addition a second time further down. allowfullscreen: 'true', gives the same result, no problem. Whether a boolean (true) or a string ('true') doesn't matter. jquery picks up the additional option flauwlessly and youtube videos will show their fullscreen button nicely. It was probably forgotten by the makers of the nivo lightbox. To add it in the min.js I simply broke the single line in two parts, search for the var and added the option without spaces, after which I concatenated the two parts back again. Works flawlessly. I've used the boolean method but have no special reasons. It may be a fraction faster than the string.

Can I create a video controller/ overlay in LiveCode

I have been using LiveCode for a couple of weeks now and have a question.
I would like to create a custom video controller with play, stop, rewind etc with LiveCode that shows and hides at the bottom of the screen if you touch the video currently playing in the video player on a mobile device.
I have created the menu page with a selection of 4 videos to choose from and selecting any video goes to the next card and plays the video. On completing the video it goes to the previous card allowing the next selection. The video controls on the Quicktime player with LiveCode are rather crude and I would like to create a better looking interface. Is this possible with LiveCode?
Yes it is possible.
Look at the following commands and functions in the dictionary:
start command
stop command
playStopped message
currentTime property
currentTimeChanged property
playLoudness property
In addition, make sure to look at what's in each entries "see also" list.

flash sound malfunction

Problem summary:
A sound (stream) placed inside a movie clip that is within another movie clip will start playing continuously when I use the play control to jump around on the main timeline.
Details:
I am using Flash CS3 but the same issue occurs with CS6. I've spent quite a bit time to search/research for the issue but didn't find a solution. To demonstrate the problem, I've reduced the flash movie to a very simple structure.
One the main timeline:
The first frame has a movie clip (Game MC) and a stop action.
Following the first frame, there are several frames, mostly empty except some text.
The last frame has a stop action.
On the Game MC timeline:
There is only one frame. On that frame, there is a movie clip (Card MC), and the stop action.
On the Card MC timeline:
It starts with 3 blank frames and a stop action.
Starting at frame 4, a sound (.wav format) is placed and is set to be "stream."
At the end of this timeline, there is a stop action.
From Flash CS3, I press Ctrl+Enter to test the movie. The movie stops on frame 1 of the main timeline with the card showing, no sound, as expected. Now I use "." to move the play head forward one frame at a time. No problem. I see the frames after the first frame. Still no sound, as expected. So far so good.
The problem starts when I use "," to move the play head backward, the sound in the Card MC starts to play, regardless where the play head is, even when the Game MC (thence the Card MC) is not on the stage. Worse, each press of "," will trigger another start of the same sound overlapping with the previous one. And the sound would continue in loops until I close the swf.
However, the problem will not occur if I place the Card MC directly on the main timeline. It only occurs when it is inside another movie clip (Game MC).
I need to solve this problem because the full version of the flash card game is to be placed in an HTML page with a javascript based play control, which allows the viewer to jump around in the swf timeline.
The fla file is at: https://docs.google.com/file/d/0B_5mgotjr4l5RDZaOGxFeFFWN1U/edit?pli=1
Any insight will be greatly appreciated.
Keith
This turns out to be a bug in Flash indeed and was told that it would not be in the next version of Flash. The workaround is to use the Sound class to load and play the sound.

Spotify 0.8.2.527 disables #font-face in apps

Was reading the blog post; http://www.spotify.com/uk/blog/archives/2012/02/23/spotify-now-with-gapless-playback-crossfade/
Downloaded the preview and now font face is disabled. We've tried eot, woff, ttf, svg. In the network panel, only SVG loads in, but in the preview tab and on page it renders as Times New Roman. It was working before, but now doesn't work with our current implementation or a stock font-squirrel implementation. Any ideas, it worked fine in 0.8.10.3
EDIT - SVG works, but not .woff or .ttf as before. All of them work in 0.8.10.3
This has been temporarily disabled in the new version due to memory leaks and unexpected crashes of the client.
We'll enable it again when we upgrade to a newer version of Chromium Embedded Framework.
That's not all that doesn't work. Now, gapless playback, crossfade and even the repeat function are stuck on (the last intermittently as my playlist sometimes repeats and sometimes does not, though the repeat annunciator remains off). The boxes for gapless and crossfade are unchecked. If I check them, close the client, start it again, uncheck them, close the client and start it again, the boxes remain unchecked, but the ferstunkener build 572 still messes-up the transitions, truncating up to five seconds or so from the start of each cut.

Resources