Hi Team,
I would like to know how toUse html5 to play video instead of swfobject.js Embed flash.
Best Regards,
Moving From Flash(swfobject.js) To HTML5
Forum rules
Please, before asking something see the documentation wiki or use the forum search function.
Please, before asking something see the documentation wiki or use the forum search function.
-
- Fresh Boarder
- Posts: 11
- Joined: Thu Aug 02, 2018 2:34 am
-
- Moderator
- Posts: 11345
- Joined: Fri Dec 21, 2007 11:23 am
- Location: Sineu - ( Illes Balears ) - Spain
- Contact:
Re: Moving From Flash(swfobject.js) To HTML5
I can guide in the source code section you should modify. Do you have IT skills for doing it?
If you have not downloaded the personal development environment, please do it https://docs.openkm.com/kcenter/view/ok ... nment.html
If you have not downloaded the personal development environment, please do it https://docs.openkm.com/kcenter/view/ok ... nment.html
-
- Fresh Boarder
- Posts: 11
- Joined: Thu Aug 02, 2018 2:34 am
Re: Moving From Flash(swfobject.js) To HTML5
Hi, I am it.
The OpenKM personal development environment is ready, how can I proceed?
Best Regards,
The OpenKM personal development environment is ready, how can I proceed?
Best Regards,
-
- Moderator
- Posts: 11345
- Joined: Fri Dec 21, 2007 11:23 am
- Location: Sineu - ( Illes Balears ) - Spain
- Contact:
Re: Moving From Flash(swfobject.js) To HTML5
I checked the current code and seems in what will be version 6.3.10 we use html previewer. Take a look at Preview.class ( https://github.com/openkm/document-mana ... eview.java ). Look for this code section from line 252
I suggest this player https://www.mediaelementjs.com/
Code: Select all
/**
* Set the media file to reproduce
*
* @param mediaUrl The media file url
*/
public void showMediaFile(String mediaUrl, String mimeType) {
hideWidgetExtension();
vPanel.clear();
if (previewEvent != null) {
vPanel.add(hReturnPanel);
vPanel.setCellHeight(hReturnPanel, String.valueOf(TURN_BACK_HEIGHT) + "px");
}
vPanel.add(video);
vPanel.setCellHorizontalAlignment(video, HasAlignment.ALIGN_CENTER);
vPanel.setCellVerticalAlignment(video, HasAlignment.ALIGN_MIDDLE);
this.mediaUrl = mediaUrl;
Util.removeMediaPlayer();
video.setHTML("<div id=\"mediaplayercontainer\"></div>\n");
if (mimeType.equals("audio/mpeg")) {
mediaProvider = "sound";
} else if (mimeType.equals("video/x-flv") || mimeType.equals("video/mp4")) {
mediaProvider = "video";
} else if (mimeType.equals("application/x-shockwave-flash")) {
mediaProvider = "";
}
Util.createMediaPlayer(mediaUrl, mediaProvider, "" + width, "" + height);
}
-
- Fresh Boarder
- Posts: 11
- Joined: Thu Aug 02, 2018 2:34 am
Re: Moving From Flash(swfobject.js) To HTML5
Hi Jllort:
Thanks for your reply.
I would like to ask, I need to design an event listener in frontend/index.jsp? (Just like swfobject.js?)
Thanks for your reply.
I would like to ask, I need to design an event listener in frontend/index.jsp? (Just like swfobject.js?)
-
- Moderator
- Posts: 11345
- Joined: Fri Dec 21, 2007 11:23 am
- Location: Sineu - ( Illes Balears ) - Spain
- Contact:
Re: Moving From Flash(swfobject.js) To HTML5
The idea behind the preview always is the same, embedded the content into an iframe ( or div ).
If you success previewing a document with download URL then you got it, basically using the right download URL to download the document from OpenKM ( because you are authenticated you should not worried about if the URL is protected or not ).
I suggest first do a jsp sample with static content ( static openkm download URL ) and when you got these pieces running then go ahead modifying Preview.java class and maybe some servlet
If you success previewing a document with download URL then you got it, basically using the right download URL to download the document from OpenKM ( because you are authenticated you should not worried about if the URL is protected or not ).
I suggest first do a jsp sample with static content ( static openkm download URL ) and when you got these pieces running then go ahead modifying Preview.java class and maybe some servlet