Skip to content

Commit

Permalink
Add mime type overwrite
Browse files Browse the repository at this point in the history
  • Loading branch information
Andries-Smit committed Mar 9, 2017
1 parent 2cc0d17 commit bdcc158
Show file tree
Hide file tree
Showing 10 changed files with 43 additions and 26 deletions.
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ module.exports = function (grunt) {
grunt.registerTask(
"default",
"Watches for changes and automatically creates an MPK file, as well as copying the changes to your deployment folder",
["watch"]
["clean build", "watch"]
);

grunt.registerTask(
Expand Down
Binary file added dist/1.1.0/JWPlayer.mpk
Binary file not shown.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "JWPlayer",
"version": "1.0.0",
"version": "1.1.0",
"description": "JW Player",
"copyright": "Flock of Birds International BV",
"private": true,
Expand Down
48 changes: 29 additions & 19 deletions src/JWPlayer/JWPlayer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
<attributeType name="String" />
</attributeTypes>
</property>
<property key="mimeType" type="string" required="false">
<caption>Mine Type</caption>
<category>Video</category>
<description>Overwrite the file type detection based on file extension</description>
</property>
<property key="videoFallbackUrlAttr" type="attribute" required="false" >
<caption>Video Fallback URL</caption>
<category>Video</category>
Expand All @@ -20,6 +25,11 @@
<attributeType name="String" />
</attributeTypes>
</property>
<property key="mimeTypeFallback" type="string" required="false">
<caption>Mine Type Fallback</caption>
<category>Video</category>
<description>Overwrite the file type detection based on file extension</description>
</property>
<property key="imageUrlAttr" type="attribute" required="false">
<caption>Image URL</caption>
<category>Video</category>
Expand All @@ -31,17 +41,17 @@
<property key="autoStart" type="boolean" defaultValue="false">
<caption>Auto start</caption>
<category>Behaviour</category>
<description>Automatically start playing the video on page load</description>
<description>Automatically start playing the video on page load</description>
</property>
<property key="loopContent" type="boolean" defaultValue="false">
<caption>Loop Content</caption>
<category>Behaviour</category>
<description>Whether to loop playback of the playlist or not.</description>
<description>Whether to loop playback of the playlist or not.</description>
</property>
<property key="muteOnStart" type="boolean" defaultValue="false">
<caption>Mute on Start</caption>
<category>Behaviour</category>
<description>Whether to have the sound muted on start-up or not.(not on iOS Android)</description>
<description>Whether to have the sound muted on start-up or not.(not on iOS Android)</description>
</property>
<property key="preload" type="enumeration" defaultValue="none">
<caption>Preload</caption>
Expand All @@ -50,22 +60,22 @@
<enumerationValues>
<enumerationValue key="none">None</enumerationValue>
<enumerationValue key="auto">Auto</enumerationValue>
</enumerationValues>
</enumerationValues>
</property>
<property key="videoWidth" type="integer" defaultValue="640">
<caption>Width</caption>
<category>Appearance</category>
<description>Width of the player in pixels</description>
</property>
<property key="videoHeigth" type="integer" defaultValue="360">
<property key="videoHeight" type="integer" defaultValue="360">
<caption>Height</caption>
<category>Appearance</category>
<description>Height of the player in pixels. </description>
</property>
<property key="showControls" type="boolean" defaultValue="true">
<caption>Show Controls</caption>
<category>Appearance</category>
<description>Whether to display the video controls (control bar, display icons and dock buttons)</description>
<description>Whether to display the video controls (control bar, display icons and dock buttons)</description>
</property>
<property key="skin" type="enumeration" defaultValue="glow" required="true">
<caption>Skin</caption>
Expand All @@ -86,23 +96,23 @@
<property key="licenseKey" type="string" required="false">
<caption>License Key</caption>
<category>Settings</category>
<description>Key needed to use the commercial features. http://www.jwplayer.com/pricing</description>
<description>Key needed to use the commercial features. http://www.jwplayer.com/pricing</description>
</property>
<property key="onEventMF" type="microflow" entityProperty="playerEventEntity" required="false">
<caption>On Event Microflow</caption>
<category>Events</category>
<description>Microflow to be called when user triggers an event</description>
<returnType type="Void"/>
</property>
<description>Microflow to be called when user triggers an event</description>
<returnType type="Void"/>
</property>
<property key="playerEventEntity" type="entity" allowNonPersistableEntities="true" required="false">
<caption>Event Entity</caption>
<category>Events</category>
<description/>
</property>
<description/>
</property>
<property key="playerEventRel" type="entity" isPath="yes" pathType="reference" allowNonPersistableEntities="true" required="false" entityProperty="playerEventEntity">
<caption>Event Relation</caption>
<category>Events</category>
<description/>
<description/>
</property>
<property key="eventTypeAttr" type="attribute" required="false" entityProperty="playerEventEntity">
<caption>Event Type</caption>
Expand All @@ -123,12 +133,12 @@
<property key="logoFile" type="image" required="false">
<caption>Logo</caption>
<category>Logo</category>
<description>Image JPG, PNG or GIF image to be used as watermark.</description>
<description>Image JPG, PNG or GIF image to be used as watermark.</description>
</property>
<property key="logoLink" type="string" required="false">
<caption>Logo Link</caption>
<category>Logo</category>
<description>The HTTP URL which will load when your watermark image is clicked.</description>
<description>The HTTP URL which will load when your watermark image is clicked.</description>
</property>
<property key="shareLinkAttr" type="attribute" required="false">
<caption>Deeplink</caption>
Expand All @@ -137,23 +147,23 @@
<attributeTypes>
<attributeType name="String" />
</attributeTypes>
</property>
</property>
<property key="shareHeading" type="translatableString" required="false">
<caption>Heading</caption>
<category>Sharing</category>
<description>Short, instructive text to display at the top of the sharing screen. The default is Share Video. This is also is displayed as a tooltip for the sharing icon.</description>
<translations>
<translation lang="en_US">Share Video</translation>
<translation lang="en_GB">Share Video</translation>
<translation lang="en_GB">Share Video</translation>
<translation lang="nl_BE">Deel Video</translation>
<translation lang="nl_NL">Deel Video</translation>
</translations>
</property>
</property>
<property key="shareSites" type="string" required="false" defaultValue="facebook, twitter, email, tumblr, googleplus, reddit, linkedin">
<caption>Sites</caption>
<category>Sharing</category>
<description>Sites comma seperated. facebook, twitter, email, tumblr, googleplus, reddit, linkedin</description>
</property>
</property>
</properties>
</widget>

15 changes: 11 additions & 4 deletions src/JWPlayer/widget/JWPlayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ define(["dojo/_base/declare", "mxui/widget/_WidgetBase", "dojo/_base/lang",
videoUrlAttr: "",
imageUrlAttr: "",
videoFallbackUrlAttr: "",
// Appearance
mimeType: "",
mimeTypeFallback: "",
// Appearance
skin: "glow",
videoHeight: "270",
videoWidth: "480",
Expand Down Expand Up @@ -163,6 +165,9 @@ define(["dojo/_base/declare", "mxui/widget/_WidgetBase", "dojo/_base/lang",
this.playerInstance.mxObjId = this._contextObj.getGuid();
dojoStyle.set(this.domNode, "display", "");
} else {
if (this.playerInstance) {
this.playerInstance.stop();
}
dojoStyle.set(this.domNode, "display", "none");
}
},
Expand Down Expand Up @@ -215,9 +220,11 @@ define(["dojo/_base/declare", "mxui/widget/_WidgetBase", "dojo/_base/lang",
options = {
//file: this._contextObj.get(this.videoUrlAttr),
sources: [{
file: this._contextObj.get(this.videoUrlAttr)
file: this._contextObj.get(this.videoUrlAttr),
type: this.mimeType
}, {
file: this._contextObj.get(this.videoFallbackUrlAttr)
file: this._contextObj.get(this.videoFallbackUrlAttr),
type: this.mimeTypeFallback
}],
preload : this.preload,
controls: this.showControls,
Expand Down Expand Up @@ -287,4 +294,4 @@ define(["dojo/_base/declare", "mxui/widget/_WidgetBase", "dojo/_base/lang",
});
});

require(["JWPlayer/widget/JWPlayer"]);
require(["JWPlayer/widget/JWPlayer"]);
2 changes: 1 addition & 1 deletion src/package.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<package xmlns="http://www.mendix.com/package/1.0/">
<clientModule name="JWPlayer" version="1.0.0" xmlns="http://www.mendix.com/clientModule/1.0/">
<clientModule name="JWPlayer" version="1.1.0" xmlns="http://www.mendix.com/clientModule/1.0/">
<widgetFiles>
<widgetFile path="JWPlayer/JWPlayer.xml" />
</widgetFiles>
Expand Down
Binary file modified test/Mx5.14.1/Widgets/JWPlayer.mpk
Binary file not shown.
Binary file modified test/Mx5.21/widgets/JWPlayer.mpk
Binary file not shown.
Binary file modified test/MxMainline/Test.mpr
Binary file not shown.
Binary file modified test/MxMainline/widgets/JWPlayer.mpk
Binary file not shown.

0 comments on commit bdcc158

Please sign in to comment.