AutoPlay

Summary: Unobtrusive embedding of video players from simple links
Version: 20140408
Prerequisites: JavaScript
Status: Superseded by Ape
Maintainer: Petko
Users: (view? / edit)
Discussion: AutoPlay-Talk
License: GPL3+

This recipe is superseded by Ape.

Description

Easily embed Youtube, Vimeo and other video clips into your wiki pages.

The recipe is:

  • easy to use: introduces no new markup
  • unobtrusive: visitors with old browsers or with JavaScript disabled can still see and follow the link to the video site
  • future-proof - if the recipe is disabled, the links will continue to work.

Currently the recipe embeds public videos from Youtube, Vimeo and Facebook, future versions will add compatibility with other video sharing websites and with videos attached to the wiki.

Installation

  • Copy autoplay.jsΔ to your pmwiki/pub directory. Note that the file needs to be named "autoplay.js".
  • Add near the end of config.php such code:
    if($action=="browse" || @$_REQUEST['preview']) {
      $HTMLFooterFmt['AutoPlay'] = '<script type="text/javascript"
        src="$FarmPubDirUrl/autoplay.js"></script>';
    }

Usage

To embed a video from Youtube or Vimeo, simply copy the "Share" address of the video and paste it into the wiki page, wrapped with the %player% ... %% wiki style. You can use all features of links (text, tooltip title, etc.). For example:

%player% http://www.youtube.com/watch?v=HJCczbSF-B8 %%
%player% http://youtu.be/HJCczbSF-B8 %%
%player% [[http://youtu.be/HJCczbSF-B8|Eben Moglen on Facebook, Google and Government Surveillance]] %%

%player% [[http://vimeo.com/59674991|Paris impression]] %%

To embed a public video from Facebook, enter the URL address of the page, eg.:

%player% https://www.facebook.com/photo.php?v=1234567890 %%

You can set the size of the video by setting the width and height of the %player% style:

%player width=100pct height=400px% http://youtu.be/HJCczbSF-B8 %%

Configuration

No configuration is required.

Notes

The browser of the visitor needs to have JavaScript enabled, and (for some of the sharing sites) Flash.

Change log / Release notes

  • 20140408 fix error when the link is not a direct child of the player, reported by RandyB; add support for MSIE 6 and 7 (frame embedding, the actual video support depends on the possibility of the system to stream the video).
  • 20140407b fix player dimensions for some browsers, hide link when a player is embedded.
  • 20140407 enabled setting of player dimensions.
  • 20140406 first public release, ready to be tested.

See also

Cookbook /
Ape  Embed videos, maps, documents, and more in wiki pages (Stable)
Audio5  HTML5 Audio Support for PmWiki (Stable)
AutoPlay  Unobtrusive embedding of video players from simple links (Superseded by Ape)
Dailymotion  Markup for embedding DailyMotion videos (Stable)
Flash  Embedding Flash movies; plus recipes for embedding Flash from specific sites like YouTube, Vimeo, GoogleVideo, Flickr, Archive.org, and more...
FlashMediaPlayer  Embed flash media players in your pages (Beta)
Flowplayer  Flowplayer recipe (Beta)
FLVPlayer  Embedding of Flash video (.flv) files into wiki pages the easy way. (initial release)
HTML5Audio  Play HTML5 Audio (working)
Html5AVCtrl  Enable youtube-like keyboard and mouse control of HTML5 video and audio.
HTML5Video  Show HTML5 Video (working)
QuickTime  Embed QuickTime content on wiki sites. (Stable)
Video5  HTML5 Video Support for PmWiki (Stable)
VideoAttach  Handles Attach: videos, provides a video directive and optional support for popular Video Upload sites. (Beta)
WMPlayer  Embedding a Windows Media Player (stable)

Contributors

Recipe written and maintained by Petko.

Comments

See discussion at AutoPlay-Talk

User notes? : If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.