Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Multiple sources #1

Closed
freechelmi opened this issue Jun 26, 2012 · 11 comments
Closed

Support Multiple sources #1

freechelmi opened this issue Jun 26, 2012 · 11 comments

Comments

@freechelmi
Copy link

Support one or more sources like videoJs can do it :

<video id="my_video_1" class="video-js vjs-default-skin" controls
  preload="auto" width="640" height="264" poster="my_video_poster.png"
  data-setup="{}">
  <source src="my_video.mp4" type='video/mp4'>
  <source src="my_video.webm" type='video/webm'>
</video>

this would allow to upload both files webm and mp4 ( but synchronizing might generate duplicates )

@xbgmsharp
Copy link
Collaborator

I personally don't plan on doing it for multiple reason:
1- PWG synchronizing will consider them as duplicates, fix is the first stoper
2- I don't store my videos in 2 formats
3- There is other improvement todo in the plugin first before multiple source support, see TODO list
4- tech mod ( https://github.com/jhurliman/video-js/blob/master/docs/tech.md ) seen to be a very nice feature also.

I would surely appreciate if you could work together on this plugin. I am French also.

@freechelmi
Copy link
Author

Hi , I agree multiple source can be a very low priority feature, I'm trying to make my videos webm only from now on.

I then search how to show a message when the device ( mainly from apple) , like " You cannot play WEBM on this device , please instal THIS or go HERE to add webm support.

this would be done in the videojs itself I guess ?

the issue on the videojs side is here :

videojs/video.js#319

@xbgmsharp
Copy link
Collaborator

I think about it and I have a solution.
The main video is store in the album.
The same video in different format are store in the pwg_representative directory of the album.
This way it won't be sync or handle as a supported file by piwigo.
Then test if the file exist in that directory and add them as source.
Also you might know that MP4 format need to be the first source to be fully supported by iOS device.
I will implement this in the next release.

@xbgmsharp xbgmsharp reopened this Jul 6, 2013
@freechelmi
Copy link
Author

Great solution for multiple sources !

I'm trying to propose a patch for easy solutions when in webm-only mode.

I know for IOS users, too bad for them.

@xbgmsharp
Copy link
Collaborator

Work in progress, Initial support for multiple sources
c7135a6

@norbusan
Copy link
Contributor

Thanks for pulling.
I was looking into the template code and guess we have to loop over the $video array to create all source lines. The problem is, I have no idea what this template language is and didn't find a reference to it. Do you have any?

Thanks

Norbert

@xbgmsharp
Copy link
Collaborator

An array '$videos' is define with multiple files of the same videos if found.
This array need to be assign to the template and loop on it.
The issue and why I did not finish yet, is that the need array need have the mime type as well, because a video source need to have the following format:

    \<source src="$VIDEOJS_MEDIA_URL" type='video/$TYPE'\>

The template language is smarty, you can find 2 examples:
https://github.com/xbgmsharp/piwigo-videojs/blob/master/template/vjs-player.tpl#L36

https://github.com/xbgmsharp/piwigo-videojs/blob/master/admin/admin_sync.tpl#L56

Also MP4 format need to be first so the array need to sort.

    // Add the current file in array
    $videos = array(
            'url' => embellish_url(get_gallery_home_url() . $picture['current']['element_url']),
            'ext' => $extension
        );

@norbusan
Copy link
Contributor

Hi,
thanks for the remark, and thanks for the "smarty", didn't know about it.

I don't think we need to sort the array first, since videojs does accept the formats in any order, at least as far as I see.

Could we determine the format from the extension? Probably that is above the smarty template language and it is easier to put the code in the videos array generation routine and let it only be read out by the template. I will look into it.

@xbgmsharp
Copy link
Collaborator

Done via 9dd5455
Please test and report
Clean and improve are need more likely.
MP4 file need to first, if not iOS device does not work, done via 8c018e9

@norbusan
Copy link
Contributor

Hi,
thanks, I have installed it on my server and tried it, worked nicely, at least in firefox showing the webm version that is in pwg_representatives.

I will report more testing

@xbgmsharp
Copy link
Collaborator

Great looking for it.
Any feedback before the next release would be appreciate, http://piwigo.org/forum/viewtopic.php?pid=144619

xbgmsharp pushed a commit that referenced this issue Jan 22, 2018
Merge pull request #34 from monadh/master
tanty pushed a commit to tanty/piwigo-videojs that referenced this issue May 30, 2023
ffprobe may provide the longitude value as:

  "
    location        : +60.1568+024.8577/
  "

Hence, this will result in a piwigo-videojs longitude value of:

  "
    longitude: +024.8577/
  "

That will lead to the following fatal error:

  "
    Fatal error: Uncaught mysqli_sql_exception: Data truncated for column 'longitude' at row 1 in /app/www/public/include/dblayer/functions_mysqli.inc.php:132 Stack trace: #0 /app/www/public/include/dblayer/functions_mysqli.inc.php(132): mysqli->query() Piwigo#1 /config/www/plugins/piwigo-videojs/admin/admin_photo.php(126): pwg_query() Piwigo#2 /app/www/public/admin/plugin.php(53): include_once('...') Piwigo#3 /app/www/public/admin.php(345): include('...') Piwigo#4 {main} thrown in /app/www/public/include/dblayer/functions_mysqli.inc.php on line 132
  "

Fixes: 5e9b209 (Add support for exiftool and ffprobe)
Closes: Piwigo#167

Suggested-by: chrud
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants