Skip to content

Add video annotation support - #5450

Closed
harshavardhana wants to merge 5 commits into
mozilla:masterfrom
harshavardhana:pr_out_rebased_from_https_github_com_pramodhkp_pdf_js_tree_videosupport
Closed

harshavardhana wants to merge 5 commits into
mozilla:masterfrom
harshavardhana:pr_out_rebased_from_https_github_com_pramodhkp_pdf_js_tree_videosupport

Conversation

@harshavardhana

Copy link
Copy Markdown

This work is still work in progress, doesn't seem to work for http://acroeng.adobe.com/Test_Files/classic_multimedia//VolvoS40V50-Full.pdf

It does seem like it worked in the beginning, but doesn't seem to work for me.

Rebasing change from pull request #4376 to get some reviews and pitfalls.

@harshavardhana harshavardhana changed the title Rebased from - https://github.com/pramodhkp/pdf.js/tree/videosupport Rebased from - pdf.js/tree/videosupport Oct 27, 2014
@timvandermeij

Copy link
Copy Markdown
Collaborator

Before we can close #4376 and continue the work on this here, the author of this commit needs to be amended. See https://stackoverflow.com/questions/750172/change-the-author-of-a-commit-in-git/1320317#1320317 on how to do this. @pramodhkp needs to be stated as the author of this commit.

@harshavardhana
harshavardhana force-pushed the pr_out_rebased_from_https_github_com_pramodhkp_pdf_js_tree_videosupport branch from a548890 to 2290bb4 Compare October 28, 2014 18:12
@harshavardhana

Copy link
Copy Markdown
Author

Author updated as @pramodhkp

@timvandermeij

Copy link
Copy Markdown
Collaborator

Thank you. Fixes #2787.

@harshavardhana
harshavardhana force-pushed the pr_out_rebased_from_https_github_com_pramodhkp_pdf_js_tree_videosupport branch from 2290bb4 to 00f5452 Compare October 30, 2014 19:01
@harshavardhana harshavardhana changed the title Rebased from - pdf.js/tree/videosupport Add video annotation support Oct 30, 2014
Comment thread src/core/annotation.js Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use warn from src/shared/util.js instead of console.error.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@Rob--W

Rob--W commented Nov 1, 2014

Copy link
Copy Markdown
Member

Could we show a link to download the video when the browser cannot play the video? Then the user can download the file and play it with vlc if they wish. UI TBD.

@yurydelendik

Copy link
Copy Markdown
Contributor

The video sometimes can be found on the attachment tab

@harshavardhana
harshavardhana force-pushed the pr_out_rebased_from_https_github_com_pramodhkp_pdf_js_tree_videosupport branch from 19ce390 to ba74b4f Compare November 2, 2014 10:59
Comment thread src/core/annotation.js Outdated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: only use space after the colon, and not before it. This line should read:

'avi': 'video/avi',

The same applies on the next two lines as well.

@harshavardhana
harshavardhana force-pushed the pr_out_rebased_from_https_github_com_pramodhkp_pdf_js_tree_videosupport branch 2 times, most recently from 0e29ef9 to c5c5992 Compare November 2, 2014 20:42
@harshavardhana

Copy link
Copy Markdown
Author

Tested with this example - http://dante.ctan.org/tex-archive/macros/latex/contrib/movie15/doc/overlay-example.pdf

While the plugin and video playing still shows up - if i allow the popups it just crashes chrome on OSX. Will be testing on Linux.

@harshavardhana
harshavardhana force-pushed the pr_out_rebased_from_https_github_com_pramodhkp_pdf_js_tree_videosupport branch from c5c5992 to 84ae57c Compare November 11, 2014 04:06
@harshavardhana
harshavardhana force-pushed the pr_out_rebased_from_https_github_com_pramodhkp_pdf_js_tree_videosupport branch from 84ae57c to 03686e7 Compare November 20, 2014 07:33
@harshavardhana
harshavardhana force-pushed the pr_out_rebased_from_https_github_com_pramodhkp_pdf_js_tree_videosupport branch from 03686e7 to 9961b72 Compare January 7, 2015 22:55
@fbender

fbender commented Nov 16, 2015

Copy link
Copy Markdown

@timvandermeij What's blocking merging this PR (except rebasing, ping @harshavardhana )?

@fbender fbender mentioned this pull request Nov 16, 2015
@timvandermeij

Copy link
Copy Markdown
Collaborator

Nothing big I think. It needs a rebase and testing (unit tests especially).

@harshavardhana
harshavardhana force-pushed the pr_out_rebased_from_https_github_com_pramodhkp_pdf_js_tree_videosupport branch 2 times, most recently from 9667462 to 173f9a6 Compare November 26, 2015 08:28
@harshavardhana

Copy link
Copy Markdown
Author

Nothing big I think. It needs a rebase and testing (unit tests especially).

Can you tell me how would i go about adding those unit tests?

@humphd

humphd commented Dec 8, 2015

Copy link
Copy Markdown

I was trying your branch, but what's on github doesn't seem to work with that example pdf--the worker dying on

var annotationFactory = new AnnotationFactory();
with AnnotationFactory missing. Do you have something locally that fixes this?

Comment thread src/core/annotation.js Outdated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is incorrect. The AnnotationFactory should not be removed (causing the effect that the user above describes), but rather it should be adapted to add a case for Screen and Movie.

@humphd

humphd commented Dec 11, 2015

Copy link
Copy Markdown

I played with this some more, and with the Annotation ctor restored in this PR, I can see VideoAnnotations being parsed correctly; however, the getHtmlElementForVideoAnnotation function in annotation_helper.js that should create the video element and usable UI, is never called. I don't know the pdf.js internals enough to fix this, but I assume that the VideoAnnotation needs to somehow indicate that it has backing HTML and viewable content, such that the stuff in pdfPage.getAnnotations() should create and render the element. Looking at how the LinkAnnotation (appears) to do it via data.hasHtml = true;, I wondered if this would be enough, but it isn't; I suspect something has to get parsed out of the annotation's data that isn't currently being done. Any tips?

@timvandermeij

Copy link
Copy Markdown
Collaborator

data.hasHtml = true; should render the annotation and it is indeed absent in this PR, which should be changed. I have added some review comments above which might also contribute to the fact that the annotation is not rendered properly.

@humphd

humphd commented Dec 12, 2015

Copy link
Copy Markdown

I've made all the changes discussed above (the s/InteractiveAnnotation/Annotation/ stuff was already done), still no dice: humphd@635c061. @harshavardhana, I tried to send this to you as a PR, but github is being stupid and doesn't list you in the list of possible forks for pdf.js for some reason, so won't let me. @timvandermeij, what am I missing?

@harshavardhana
harshavardhana force-pushed the pr_out_rebased_from_https_github_com_pramodhkp_pdf_js_tree_videosupport branch from 4b52236 to 635c061 Compare December 13, 2015 09:23
@harshavardhana

Copy link
Copy Markdown
Author

I've made all the changes discussed above (the s/InteractiveAnnotation/Annotation/ stuff was already done), still no dice: humphd/pdf.js@635c061. @harshavardhana, I tried to send this to you as a PR, but github is being stupid and doesn't list you in the list of possible forks for pdf.js for some reason, so won't let me. @timvandermeij, what am I missing?

I pulled in your changes and pushed here. Thank you

Comment thread src/core/annotation.js

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes for these three lines should also be reverted.

@timvandermeij

Copy link
Copy Markdown
Collaborator

/botio-linux preview

@pdfjsbot

Copy link
Copy Markdown

Comment thread src/shared/util.js

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks to PR #6757 the changes in this file are no longer necessary as types MOVIE and SCREEN are now already available when you rebase this patch.

@fbender

fbender commented May 20, 2016

Copy link
Copy Markdown

@harshavardhana Are you still working on this? May you please address the review comments and rebase the branch?

@timvandermeij

timvandermeij commented Sep 11, 2016 •

Copy link
Copy Markdown
Collaborator

Closing as incomplete for the following reasons:

  • This hasn't been worked on for a long time.
  • The patch currently does not work for rendering video elements.
  • There are no tests.
  • The annotation code has been rewritten, so this needs to be fit into the new framework and therefore this patch is currently not in a mergeable state.

However, we keep the associated issue open and link to this PR from there so that others may use this work as inspiration for a new PR.

@harshavardhana
harshavardhana deleted the pr_out_rebased_from_https_github_com_pramodhkp_pdf_js_tree_videosupport branch September 11, 2016 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants