Coder Social home page Coder Social logo

splitbrain / dokuwiki-plugin-vshare Goto Github PK

View Code? Open in Web Editor NEW
16.0 7.0 19.0 133 KB

Plugin to easily embed videos from various video sharing sites into DokuWiki

Home Page: http://www.dokuwiki.org/plugin:vshare

CSS 2.44% PHP 91.34% JavaScript 6.22%
php dokuwiki-plugin video-player youtube vimeo

dokuwiki-plugin-vshare's Introduction

vshare Plugin for DokuWiki

All documentation for this plugin can be found at
http://www.dokuwiki.org/plugin:vshare

If you install this plugin manually, make sure it is installed in
lib/plugins/vshare/ - if the folder is called different it
will not work!

Please refer to http://www.dokuwiki.org/plugins for additional info
on how to install plugins in DokuWiki.

----
Copyright (C) Andreas Gohr <[email protected]>

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

See the COPYING file in your DokuWiki folder for details

dokuwiki-plugin-vshare's People

Contributors

alexgearbox avatar araname avatar cat5tv avatar chtiland avatar drbeco avatar fire-guo avatar iliya05 avatar instkffff avatar jacobpalm avatar jfmd21 avatar joestr avatar kastra28 avatar klap-in avatar leeyc0 avatar mabroukb avatar magistere avatar metalpail avatar mprins avatar nimahamidian avatar phobicdotno avatar qezwan avatar sawachan avatar splitbrain avatar ssahara avatar thiagolimah avatar tom-henderson avatar trhermans avatar unixhex avatar xesarni avatar yzctzl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

dokuwiki-plugin-vshare's Issues

Please add support for width=100% video player

Can you please implement the possibility of being able to automatically use the full width without having to give an exact width?

I would like to use '100%' or 'full' (i.e.) like 'small', 'medium' and 'large' to use the full width, regardless of the template used or whether I use columns, etc.

Best regards

Title does not display

docs show syntax for displaying text title for video example - {{ youtube>L-WM8YxwqEU?small |Some funny video}} but this has never worked for me.

slideshare regex matches all `id=([0-9]+)`

The | referes to all of slideshare\\.net\\/slideshow\\/embed_code\\/

'slideshare':  '(?:(?:slideshare\\.net\\/slideshow\\/embed_code\\/|id=)([0-9]+)|(https?\\:\\/\\/www\\.slideshare\\.net\\/(?:[a-zA-Z0-9_\\-]+)\\/(?:[a-zA-Z0-9_\\-]+)))'

Freature: responsive design for youTube

I have a page with a lot of youTube clips: https://biosignals.berndporr.me.uk/doku.php?id=ecg:gndamp
and the problem has been that the clips were too large on the phone and too small on a PC screen.
I just had a look at the code and the width are hard coded into it.

Suggestion: instead of hard coding the width in it it would be better to do a design which automatically adjusts the width in relative units.
a) for a PC the width about 80% of the screen
b) for a mobile about 99% of the screen
Below this is just a "hack" where basically changes the geometry of the iframe so that it has full width on a mobile and then 80% width on a PC. All that embedded into a div.

.scalewrapper {
    padding: 1%
}

/*
 * -- TABLET (AND UP) MEDIA QUERIES --
 */
@media (min-width: 40em) {
    .scalewrapper {
        padding-left: 10%;
        padding-right: 10%;
        padding-bottom: 5%;
    }
}

.videowrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    padding-top: 25px;
    height: 0;
}

iframe.vshare__none,
div.vshare__none {
    position: absolute;
    display: block;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index:0 !important;
}

php fragment from syntax.php:

                $R->doc .= '<div class="scalewrapper"><div class="videowrapper"><iframe ';
                $R->doc .= buildAttributes(array(
                            'src' => $data['url'],
                            'class'  => 'vshare__'.$align,
                            'frameborder' => 0,
                            'scrolling' => 'no'
                           ));
                $R->doc .= '>'.hsc($data['title']).'</iframe></div></div>';

Basically the iframe is positioned in absolute coordinate system within a div which has fake padding of the right size. Then that's wapped in a div for padding of that div which is then device dependent. I'm sure it can be simplified but as a hack it's OK for now. Happy to do a proper pull request at some point if there is appetite.

Change: embed twitch-clips not with object

Example:
Embedding this clip https://www.twitch.tv/derspendertv/clip/DrabTenderPoultryNerfBlueBlaster results in following HTML-Code:

<div class="vshare__none"><!--[if !IE]> -->
<object width="425" height="239" type="application/x-shockwave-flash" data="/lib/plugins/vshare/redir.php?url=http%3A%2F%2Fwww.twitch.tv%2Fwidgets%2Flive_embed_player.swf%3Fchannel%3DDrabTenderPoultryNerfBlueBlaster%26auto_play%3Dfalse%26start_volume%3D25&amp;hash=c0f8b691b2d0194d6bbb7920fa100dc9">
<!-- <![endif]-->
<!--[if IE]>
<object width="425" height="239" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">
    <param name="movie" value="/lib/plugins/vshare/redir.php?url=http%3A%2F%2Fwww.twitch.tv%2Fwidgets%2Flive_embed_player.swf%3Fchannel%3DDrabTenderPoultryNerfBlueBlaster%26auto_play%3Dfalse%26start_volume%3D25&amp;hash=c0f8b691b2d0194d6bbb7920fa100dc9" />
<!--><!-- -->
  <param name="channel" value="DrabTenderPoultryNerfBlueBlaster">
  <param name="auto_play" value="false">
  <param name="start_volume" value="25">
  <param name="FlashVars" value="channel=DrabTenderPoultryNerfBlueBlaster&amp;auto_play=false&amp;start_volume=25">
Das <a href="http://www.adobe.com/products/flashplayer/">Adobe Flash Plugin</a> wird benötigt, um diesen Inhalt anzuzeigen.
</object>
<!-- <![endif]-->
</div>

This results in a warning in Chrome that the Wiki-visitor have to activate Flash. But Flash is a dying technic ..

Solution:
Please use the possibilitys twitch allow to embed their clips as described here:
https://dev.twitch.tv/docs/embed/video-and-clips/

Declaration Errors Received Upon Installation

I receive the following errors after installing:

  • Warning: Declaration of syntax_plugin_vshare::handle($match, $state, $pos, &$handler) should be compatible with DokuWiki_Syntax_Plugin::handle($match, $state, $pos, Doku_Handler $handler) in C:\xampp\htdocs\dokuwiki\lib\plugins\vshare\syntax.php on line 209
  • Warning: Declaration of syntax_plugin_vshare::render($mode, &$R, $data) should be compatible with DokuWiki_Syntax_Plugin::render($format, Doku_Renderer $renderer, $data) in C:\xampp\htdocs\dokuwiki\lib\plugins\vshare\syntax.php on line 209

Related videos showing up

Ive read around everywhere that to not make the embedded related videos for youtube show up, you would put "?rel=0". But in Vshare, the "?" is used to separate the videoid and the size. So when i put for example, {{youtube>sdfwfcgr?rel=0}} it doesnt read the rel=0 part.

start at <time> in video

==== Cannot Start at ====
Youtube's key sharing feature is to allow videos to start at certain time by adding the syntax ?t=10m25s at the end of their short url. Currently this feature is not supported in Vshare, I think it is important to implement this though.

  • Added James 2014-08-29 10:16

[moved request from wikipage]

Adding caption

Could you add the ability to make a caption to a video (as they are made to the pictures)?
Something like: {{youtube>xxxxxx?small|Caption}}

"An error occurred, please try again later"

Hi - I am getting this error message when I follow the instructions for embedding a youtube video. I am also getting a similar message for vimeo.

I am using the DokuWiki Template and the latest version of DokuWiki.

Please help.

Thank you!

google drive videos

hello thanks for the great work

i tried to had google drive feature.
but i get this when trying to had a new link
{{google>undefined?medium}}

in sites.conf i hadded :
google iframe https://drive.google.com/file/d/@VIDEO@/preview

and in site.js :
'google': '\d[0-9A-Za-z]+'

then i touched local.php

but doesn t work
if i inspect the generated code

<iframe src(unknown) etc ... even if i put the real video identifier in {{google>XXXXX?medium}} i get the same src(unknown)

Mixed content when wiki uses https

Sites.conf specifies all URLs using http, which causes display problems when dokuwiki is served over https.

This can be resolved for youtube by removing http: so the URL begins with //, causing the browser to request the video using the same protocol as the wiki page.

youtube         iframe  //www.youtube.com/embed/@VIDEO@

I've only tested with with youtube. I don't know if the other sites listed in sites.conf serve the same content over https.

Please add support for Panopto

I am sure many companies use Panopto for their video hosting; I attempted to do it myself but could not get it to work. Note that company would be replaced by the company name.

sites.conf:
**company** iframe https://**company**.hosted.panopto.com/Panopto/Pages/Embed.aspx?id=@VIDEO@&autoplay=false&offerviewer=true&showtitle=true&showbrand=false&start=0&interactivity=all

sites.js
'**company**': 'panopto\\.com/.*[&?]id=([a-z0-9_\\-]+)'

Feature request: ios compatibility

vshare works great, but it depends on a flash player. Most of the video share sites have an IOS (ipad/iphone) optimized player. Is it possible to incorporate these optimized players?

Sample Videos needed

For the following services, I need some examples to check if they are correctly configured:

  • youku
  • msoffice
  • msstream

If someone is currently using these with the vshare plugin, please comment with the used syntax here.

The goal is to extend their settings in the sites.ini to have automated tests.

Archive.org link breaks Blog plugin

It should be noted that the recent addition of support in this plugin for videos at archive.org breaks the archive feature of the blog plugin. Suggest changing syntax in the vshare plugin from archive to archiveorg

add support to niconico

I discovered that niconico has changed it embedding syntax, and vshare can now serve niconico by adding single line in sites.conf:

niconico        iframe  http://embed.nicovideo.jp/watch/@VIDEO@

As such, I am deprecating my niconico plugin. May you add this line in sites.conf?

Historically the niconico embedding syntax is too obscure that vshare cannot serve it and I had to write my plugin to solve the problem. Since niconico uses now standard iframe instead of obscure code, my plugin has finished the historical role and in favour of using vshare now.

Request twitch.tv

Hi.

It would be great, if this plugin would support twitch.tv. Or is there a workaround?

Page with embedded videos jumps when hovering over Edit button

Release 2018-04-22a "Greebo"
vshare plugin 2018-02-05
Browser: Firefox 61.0

On https://openwrt.org/docs/techref/hardware/soldering#videos we have 3 youtube videos embedded via vshare plugin.

When I scroll down the page to reach the Edit button of the section containing the videos, and I hover the mousepointer over the Edit button, the page jumps down and with it the Edit button, making it impossible to edit this section only.

  • Editing the whole page is still possible.
  • Only the section containing the videos is affected. All other sections are working as expected, i.e. the Edit button lets me edit the respective section only.
  • with &autoplay=0 it does not happen, i.e. no page jumping, and normal section editing is working
  • with Chrome 67.0 this does not happen, i.e. i.e. no page jumping, and normal section editing is working

Would be nice to get rid of that jumping, so that normal section editing works again.

Thanks for looking into this!

Question: How does it work with Privacy?

Hi
It seems the tool I need. But I have a question. I do not wish to let youtoube know about every site a user open while he is browsing through dokuwiki. Is there an Option to only load the video scripts after clicking on the video like the Shariff Project do it for social media buttons?

SoundCloud support

Hi,

I have modified my sites.js and sites.conf to support SoundCloud. It would be great if you could add these:

in sites.js, add

 'soundcloud': 'soundcloud\\.com(\\d+)' 

in sites.conf, add
soundcloud iframe https://w.soundcloud.com/player/?url=http://api.soundcloud.com/tracks/@VIDEO@

You can see it in action at:
http://metasynth.com/wikifarm/metasynth/doku.php?id=blog:2013_06_14_found_image_exploration

(Note that our ISP is having some issues -- so the page may or may not load correctly depending on whether they have sorted things out)

Thanks,

Edward

Caption on video not appearing?

I think the caption may not be working, but I'm not sure. Here is my wikitext:

{{ youtube>2ovSQ4bl4yM?small&Rel=0 |COB6008 a Racing Cobra }}

This appears to produce the video centred on the screen, but no caption other than the one that Youtube apply.

So I have to write text above the embedded video, but the spacing on the page makes the text look like the caption for the video above it, which is confusing to the user.

I am using Detritus - please let me know if you have any additional info requirements about my setup.

Otherwise, I love the plugin!

bilibili is not working

bilibili is not working

{{bilibili>L -BV1aR4y1j78Q}}
{{youtube>L-WM8YxwqEU}}

youtube player is working perfectly.

YouTube iframe version?

The current way of embedding YouTube videos has changed to be an iframe; is it possible to support this syntax in vshare, please? The main benefit is that it allows serving the video as HTML5, which works on newer browsers without Flash installed.

Thanks.

Translation isn't apply.

I translated messages "Video Share Plugin", but they aren't apply. It may be because localization builder don't submit.

invalid button image URL?

File script.js contains link to the button image:

"icon":  DOKU_BASE+"lib/plugins/vshare/button.png",

but the image is not displayed (Tested in IE and Opera). When the line is changed to

"icon":  "../../plugins/vshare/button.png",

everything is fine.

error occured, please try later

Hi, i use the latest version of doku wiki and your plugin, but when i use this code

{{youtube>L-8rJhOnQS1Bs}}

Youtube say to me "error occured, please try later"
What can i do ?

Thanks

Playing with max volume (youtube)

Every time I play embedded youtube videos, it is played with max volume. It is too loud to listen comfortably. I hope you consider a parameter for volume control.

Embedded YouTube video appears and then disappears.

I tried to embed three YouTube videos in a single line, by aligning them all to left by doing {{youtube>6VnhC8u_d40?small }} {{youtube>j_zeixo-zJY?small }} {{youtube>tFrf0TVnqIQ?small }}

While this seems (?) to work, I see the videos as I expect them to for some moments and then they disappear.

Here's the live version of the same : https://www.ccextractor.org/public:gsoc:gsoc2017:ccaligner_word_by_word_audio_subtitle_synchronisation_saurabh_shrivastava_gsoc_2017

vshare

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.